3 ms·
> there is no string that could be injected to harm me Unfortunately that's not true at all. There are many instances of arbitrary code execution gained though
by rnhmjoj 9y ago
> there is no string that could be injected to harm me
Unfortunately that's not true at all. There are many instances of arbitrary code execution gained though a terminal emulator, with escape sequences[1] being the most common. For example exploiting common "git prompts"[2] scripts or running `strings` on a binary[3].
[1]: https://unix.stackexchange.com/a/15210 https://unix.stackexchange.com/a/15210
[2]: https://github.com/njhartwell/pw3nage https://github.com/njhartwell/pw3nage
[3]: http://lcamtuf.blogspot.it/2014/10/psa-dont-run-strings-on-untrusted-files.html http://lcamtuf.blogspot.it/2014/10/psa-dont-run-strings-on-u...
- rsync 9y agoThank you for bringing up the 'strings' problem - something I had forgotten about. It's worth noting, however, that there is nothing inherently dangerous about a strings-like utility. Rather, it is GNU strings which has unexpected complexity: "Perhaps simply by the virtue of being a part of that bundle, the strings utility tries to leverage the common libbfd infrastructure to detect supported executable formats and "optimize" the process by extracting text only from specific sections of the file. Unfortunately, the underlying library can be hardly described as safe: a quick pass with afl (and probably with any other competent fuzzer) quickly reveals a range of troubling and likely exploitable out-of-bounds crashes due to very limited range checking" ... which is the very issue I'm warning against, just at a different layer of abstraction ...