• 9point6@lemmy.world
    link
    fedilink
    arrow-up
    16
    ·
    16 hours ago

    Flashbacks to one of my early freelance PHP gigs I did about 2 decades ago where I opened up the existing backend source code to find a load of unsanitised user input directly from the query string getting interpolated into the various SQL queries the application made. Part of me also feels like the “bobby tables” xkcd already existed by this point, so I’ve got no idea how that website managed to not get nuked before I refactored it.

    To top it all off, of course the application authenticated with the database using the root user…

    Thankfully I think that was the worst I ever discovered in the wild

    • mmddmm@lemm.ee
      link
      fedilink
      arrow-up
      3
      ·
      13 hours ago

      To add. The specific edge case where you want to do the balaclava thing is when you are concatenating internally generated column and table names, operators, and entire conditions with extra parameters that you will add the correct way.