Comment by netsharc

Comment by netsharc a day ago

20 replies

Reminds me of an anecdote about an e-commerce platform: someone coded a leaky webshop, so their workaround was to watch if the string "OutOfMemoryException" shows up in the logs, and then restart the app.

Another developer in the team decided they wanted to log what customers searched for, so if someone typed in "OutOfMemoryException" in the search bar...

PhilipRoman a 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.

  • ycombinatrix a day ago

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

    • teraflop a day ago

      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.

      • swyx a day ago

        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)

    • MortyWaves 8 hours ago

      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.

    • owebmaster a day ago

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

        Error: OutOfMemoryException
      
      And

        Search: OutOfMemoryException
      
      Should not be related in any way
      • dusanz a day ago

        Until someone searches for "Error: OutOfMemoryException"

skipants a day ago

I've actually gone through this a few times with our WAF. A user got IP-banned because the WAF thought a note with the string "system(..." was PHP injection.