-
-
Notifications
You must be signed in to change notification settings - Fork 507
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
Using the same file as input and output produces a corrupt result without notice. #491
Comments
For reference, I implemented this check in str4d/rage#202 (after agreeing to change |
I implemented it and pushed a pull request. Feel free to try it. I'm already using it. |
I have (likely) the same issue using armored encoding. Will the PR fixing this be merged? Thanks for the update. |
Given that this regrettable characteristic irremediably corrupts original files, it's really scary that this is still active in the current release (1.1.1) one year after initial report... 🤷♂️ |
Ping @FiloSottile |
Thank you for the report. We can't save the user if they use the shell's |
Environment
What were you trying to do
Trying to encrypt a file in-place with
age -p -o file file
. I was trying to password-protect my age-secret-key,which corrupted it irrevocably.
What happened
The resulting file is written while it is read, resulting in a data-race causing the newly written data to be used
in the current encryption. Due to the header overwriting the original data, the original content is lost.
rage
seems to be able to detect this and abort before doing any damage, and it would be great if age could also detect this.The text was updated successfully, but these errors were encountered: