Describe the bug
Legacy Vault UI deep links using /ui/vault/secrets/... do not preserve the requested KV secret version when they are redirected to the new /ui/vault/secrets-engines/... route.
For example, a saved link that explicitly requests version 1:
https://vault/ui/vault/secrets/engine/kv/secret/details?version=1
is redirected to:
https://vault/ui/vault/secrets-engines/engine/kv/secret/details?version=2
The path migration is expected, but changing version=1 to version=2 is not. The equivalent URL that already uses the new route works correctly and displays version 1:
https://vault/ui/vault/secrets-engines/engine/kv/secret/details?version=1
This breaks durable links to historical secret versions stored in documentation, runbooks, tickets, and bookmarks. It can also cause users to view a different secret version than the one referenced by the original link.
To Reproduce
Steps to reproduce the behavior:
- Use a KV v2 secret for which at least versions 1 and 2 exist.
- Open a legacy UI deep link that explicitly requests version 1, replacing the host, mount, and secret path as needed:
https://vault/ui/vault/secrets/engine/kv/secret/details?version=1.
- Allow Vault UI to redirect the legacy
/secrets/ route to /secrets-engines/.
- Observe that the resulting URL requests
version=2 instead of version=1.
- Open
https://vault/ui/vault/secrets-engines/engine/kv/secret/details?version=1 directly and observe that version 1 is displayed correctly.
Expected behavior
The legacy route should redirect to the equivalent new route while preserving the complete query string, including the requested KV version. In this example:
/ui/vault/secrets/engine/kv/secret/details?version=1
should redirect to:
/ui/vault/secrets-engines/engine/kv/secret/details?version=1
Existing documentation links and bookmarks should continue to reference the same secret version after the route migration.
Environment:
- Vault Server Version (retrieve with
vault status): Not provided
- Vault CLI Version (retrieve with
vault version): Not applicable to this UI redirect
- Server Operating System/Architecture: Not provided
Vault server configuration file(s):
# No configuration known to be relevant; the behavior occurs in the Vault UI route redirect.
Additional context
This appears related to the migration of Vault UI routes from /secrets to /secrets-engines. A previously reported deep-link redirect problem was addressed in #31939, but the redirect also needs to preserve query parameters and their values. Please add regression coverage for legacy KV deep links with ?version=<n> so the redirect cannot silently select the latest or another secret version.
Describe the bug
Legacy Vault UI deep links using
/ui/vault/secrets/...do not preserve the requested KV secret version when they are redirected to the new/ui/vault/secrets-engines/...route.For example, a saved link that explicitly requests version 1:
https://vault/ui/vault/secrets/engine/kv/secret/details?version=1is redirected to:
https://vault/ui/vault/secrets-engines/engine/kv/secret/details?version=2The path migration is expected, but changing
version=1toversion=2is not. The equivalent URL that already uses the new route works correctly and displays version 1:https://vault/ui/vault/secrets-engines/engine/kv/secret/details?version=1This breaks durable links to historical secret versions stored in documentation, runbooks, tickets, and bookmarks. It can also cause users to view a different secret version than the one referenced by the original link.
To Reproduce
Steps to reproduce the behavior:
https://vault/ui/vault/secrets/engine/kv/secret/details?version=1./secrets/route to/secrets-engines/.version=2instead ofversion=1.https://vault/ui/vault/secrets-engines/engine/kv/secret/details?version=1directly and observe that version 1 is displayed correctly.Expected behavior
The legacy route should redirect to the equivalent new route while preserving the complete query string, including the requested KV version. In this example:
/ui/vault/secrets/engine/kv/secret/details?version=1should redirect to:
/ui/vault/secrets-engines/engine/kv/secret/details?version=1Existing documentation links and bookmarks should continue to reference the same secret version after the route migration.
Environment:
vault status): Not providedvault version): Not applicable to this UI redirectVault server configuration file(s):
# No configuration known to be relevant; the behavior occurs in the Vault UI route redirect.Additional context
This appears related to the migration of Vault UI routes from
/secretsto/secrets-engines. A previously reported deep-link redirect problem was addressed in #31939, but the redirect also needs to preserve query parameters and their values. Please add regression coverage for legacy KV deep links with?version=<n>so the redirect cannot silently select the latest or another secret version.