|
|
|
|
|
by labawi
2369 days ago
|
|
IMHO it's not that bad. It's actually quite usable, and reasonably easy to handle safely. Use bash: set -eu -o pipefail
# unfortunately pipefail is not POSIX
and some care when writing scripts. Possibly decrypt to a file first.A proper and likely footgun would be decrypting and passing tainted plaintext and only then exiting nonzero. E.g. decrypt < file | sh # owned
Definitely should be documented either way. |
|
The footgun you described can still happen if there's a verification error somewhere in the middle. You could still conceivably craft exploits using only truncation of the plaintext, depending on the situation.
No one should "decrypt < file | sh" (or anything | sh without verifying), but they will. Doesn't matter if we have POSIX or non-POSIX shell flags that can fix it, the defaults are bad.
There's nothing tools like age can do about that, though.
Edit: I was thinking more along the lines of
where postprocess exits zero. This is where the default shell behavior fails. The "decrypt < file | sh" antipattern is something not even the shell can do anything about.