Re:Don't run 'strings' on untrusted files
by imanaccount247 on Saturday October 25, 2014 @03:19PM
(#8509073)
No, lots of people think that. Those people do not use GNU software for this reason.
[ Parent
| on HN ]
Re:Don't run 'strings' on untrusted files
by rictic on Saturday October 25, 2014 @03:59PM
(#8509228)
What do they use then?
Re:Don't run 'strings' on untrusted files
by userbinator on Saturday October 25, 2014 @07:45PM
(#8509793)
The MINIX one looks OK, for example:
https://github.com/jncraton/minix3/blob/master/commands/simp...
It does attempt to parse a.out format, but any weird values in the header won't cause reading/writing beyond the end of a buffer.
Having a trivial binary format is not particularly great, nor is supporting one binary format and not another. Yet when you get to the complexity of ELF parsing, while I'm sure it's possible to code defensively and end up with fewer bugs than something like libbfd, parser bugs in general are the bread and butter of C.
Solution? In my opinion, either don't bother parsing any binary formats (who actually needs that functionality?), or use a safe language.