Re:If you use GNU grep on text files, use the -a (--text) op...
by arendtio on Tuesday April 21, 2020 @02:10PM
(#22937640)
Actually, I never considered log files untrusted input, but as this example shows, it would be wise to do so.
[ Parent
| on HN ]
Re:If you use GNU grep on text files, use the -a (--text) op...
by JoachimSchipper on Tuesday April 21, 2020 @02:45PM
(#22938044)
FWIW, attacks like Javascript or SQL injection via logfiles are hardly unknown. Log files are plenty scary. ;-)
Re:If you use GNU grep on text files, use the -a (--text) op...
by hinkley on Wednesday April 22, 2020 @02:00AM
(#22942705)
Someone did a POC of a CSRF against the admin interface for Cisco routers. They sent garbage packets that sufficiently confused the 'hex editor' display view in the admin web pages in such a way that it made a request to another page, changing permissions.
Re:If you use GNU grep on text files, use the -a (--text) op...
by mr_toad on Tuesday April 21, 2020 @08:02PM
(#22940629)
I’ve seen ansi sequences embedded in (malformed) http requests in my server logs. Presumably they expect people to view the log in a terminal or editor with some sort of vulnerability.
Re:If you use GNU grep on text files, use the -a (--text) op...
by _jal on Tuesday April 21, 2020 @07:41PM
(#22940500)
Oh yes. And a target for PII redaction.
Logs need a lot of attention.
Re:If you use GNU grep on text files, use the -a (--text) op...
by avodonosov on Tuesday April 21, 2020 @03:14PM
(#22938340)
Also beware of CWE-117
Re:If you use GNU grep on text files, use the -a (--text) op...
by arendtio on Tuesday April 21, 2020 @03:29PM
(#22938483)
https://cwe.mitre.org/data/definitions/117.html
'CWE-117: Improper Output Neutralization for Logs'
That is something probably often forgotten when simply dumping some requests into a log, but at least it should be obvious that the source of the content is untrusted. On the other hand, a log file is a file on your server, so you would probably think of it as nothing dangerous, as everybody has cared about CWE-117, right? ;-)
Re:If you use GNU grep on text files, use the -a (--text) op...
by JohnL4 on Wednesday April 22, 2020 @09:15AM
(#22945182)
As a developer, if I catch an exception handling some piece of data, I'm logging that data. Nothing irks me more than a file-not-found exception without knowing WHICH file. For example.