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

file storage backend: Spuriously deletes storage keys ending with .temp #23135

Closed
maxb opened this issue Sep 17, 2023 · 0 comments
Closed

file storage backend: Spuriously deletes storage keys ending with .temp #23135

maxb opened this issue Sep 17, 2023 · 0 comments
Labels
bug Used to indicate a potential bug core/storage reproduced This issue has been reproduced by a Vault engineer

Comments

@maxb
Copy link
Contributor

maxb commented Sep 17, 2023

I happened to browse the diff of #15946 when it was mentioned in another issue.

I immediately spotted a defect in the code.

It uses ".temp" as a suffix for temporary files without caring whether that temporary file name will accidentally collide with a legitimate other storage entry...

$ vault secrets enable kv
Success! Enabled the kv secrets engine at: kv/
$ vault write kv/example.temp foo=bar
Success! Data written to: kv/example.temp
$ vault list kv
Keys
----
example.temp
$ vault write kv/example foo=bar
Success! Data written to: kv/example
$ vault list kv
Keys
----
example

kv/example.temp was unexpectedly overwritten by writing to kv/example !!!

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 core/storage reproduced This issue has been reproduced by a Vault engineer
Projects
None yet
Development

No branches or pull requests

3 participants