← Back to context

Comment by PhilipRoman

1 day ago

Careless analysis of free-form text logs is an underrated way to exploit systems. It's scary how much software blindly logs data without out of band escaping or sanitizing.

Why would someone "sanitize" OutOfMemoryException out of their logs? That is a silly point to make.

  • The point is not to sanitize known strings like "OutOfMemoryException". The point is to sanitize or (preferably) escape any untrusted data that gets logged, so that it won't be confused for something else.

    • i think GP's point is how would you even sanitize the string "OutOfMemoryException" which presumably comes from a trusted system

      i guess demanding "Structured logs for everything or bust" is the answer? (i'm not a big o11y guy so pardon me if this is obvious)

      10 replies →

  • Absolutely incredible how dense HN can be and that no one has explained. Obviously that isn’t what they are saying, they are saying it’s profoundly stupid to have the server be controlled by a simple string search at all.

  • An OutOfMemoryException log should not be the same as a search log

      Error: OutOfMemoryException
    

    And

      Search: OutOfMemoryException
    

    Should not be related in any way