Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI interprets URL-encoded secrets when accessing it #25905

Open
NoaFayn opened this issue Mar 13, 2024 · 3 comments
Open

UI interprets URL-encoded secrets when accessing it #25905

NoaFayn opened this issue Mar 13, 2024 · 3 comments
Labels
bug Used to indicate a potential bug reproduced This issue has been reproduced by a Vault engineer ticketed ui

Comments

@NoaFayn
Copy link

NoaFayn commented Mar 13, 2024

Describe the bug
When using the UI to navigate in the KV secrets, if a "directory" was URL-encoded with slashes, it will be interpreted as a path.

To Reproduce
Steps to reproduce the behavior:

  1. Create a secret in the KV engine (e.g.: secrets/test1%2ftest2/test3)
  2. Navigate using the UI to secrets
  3. Now, when clicking on the test1%2ftest2 "directory" (which is correctly displayed in the UI), the UI interprets the %2f as a slash, and tries to display secrets in secrets/test1/test2/, which doesn't exist.

Expected behavior
It is expected that when clicking on the "directory" test1%2ftest2, the UI correctly handles the %2f as part of the name, and doesn't interpret it as a slash.

Environment:

  • Vault Server Version (retrieve with vault status): 1.15.6
  • Vault CLI Version (retrieve with vault version): N/A
  • Server Operating System/Architecture: Docker on Debian 11

Additional context
Note that accessing a secret (instead of a "directory") containing %2f works as expected.

@peteski22 peteski22 added ui bug Used to indicate a potential bug labels Mar 13, 2024
@ccapurso ccapurso added the reproduced This issue has been reproduced by a Vault engineer label Mar 20, 2024
@Monkeychip
Copy link
Contributor

@NoaFayn thank you for the issue. I'm trying to figure out the best way to approach a fix, and it might be helpful to understand what your workflow is for creating a directory with a URL encoded slash.

  1. Do you create this directory in the CLI and then move to the UI?
  2. Is the directory path automatically generated for you?
  3. Are you manually writing out the encoded slash in the UI when creating a secret path?

If number 3 is your workflow, can you help me understand why you'd want a directory name with a encoded slash?

@NoaFayn
Copy link
Author

NoaFayn commented May 14, 2024

Hi @Monkeychip, your first guess is the correct one for my workflow. Its actually through the API that I'm creating the directory (but it shouldn't matter), and then I'm accessing it with the UI. We have a script creating secrets automatically (and each directory represents a "product" ID which happens to contain a "/" in it) and we use the UI to access them.
However, I just want to point out that it doesn't matter how the directory name is created (UI or API), the problem is when the path is accessed. (I've actually tried to create the directory from the UI and it results in the same behaviour.)

@99
Copy link
Contributor

99 commented Sep 13, 2024

Hi, I'm just curious if this was resolved.
We are experiencing this issue in 1.17.1 currently (after upgrading from 1.14.x)

This one might be a similar issue, but it seems like it was fixed
#23940 (comment)?

Or not? Referring to this comment? #23940 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to indicate a potential bug reproduced This issue has been reproduced by a Vault engineer ticketed ui
Projects
None yet
Development

No branches or pull requests

5 participants