Resources

People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!

A Shell Is Worth a Thousand Images: Big Images RCE's - 2154

XBOWPosted 27 Days Ago
  • XBOW is a hacking bot that has been used extensively in blackbox situations. Recently, it was reviewing Bing images when it found a low-severity SSRF bug no reverse image search. The SSRF allowed for user controlled data to be processed on the image backend.
  • XBOW attempted various image return types. One of them returned a 500 error. After some effort, they got an out of band request with a bingbot/2.0 user agent from the image processing. From the SSRF, 500 errors, and general idea that image processing of arbitrary images just leads to bugs in general, XBOW decided to review this further.
  • The hackbot tried XXE over and over again but this failed. Deadend detection is important; you can move onto the next thing. The next step focused on identifying what parser was being used. After scanning various image parsers, seeing the output on Bing and locally, they were able to figure out this was ImageMagick. Even crazier, by propping image types, they were able to reverse engineer the exact ImageMagick policy being used.
  • There's a super interesting quote in this: Working blind is unforgiving in a useful way: with nothing reflected to the client, you cannot guess your way forward, you can only reason" By having the black-box constraints, you are FORCED to see every tiny little edge that you can play. From status codes to return values, to OOB callbacks... all of it. Sometimes, constraints are good for hacking.
  • They were able to process SVG's. Because of an enabled feature for delegate-enabled decoder, they were able to trigger server-side commands. The payload was an SVG with an image tag that contains an HREF with a command injection payload.
  • The command ran as SYSTEM on the Bing image processing workers. They had to get the data via out of band callbacks. This vulnerable pipeline existed in multiple areas of the codebase.
  • The image pipeline is just dangerous in general. This parsing is fine with trusted data but horrible when attackers can trigger it. These types of things have existed in ImageMagick, and other image parsers for years.
  • I found the attack surface part interesting. I also really enjoyed the recon on the parser to be interesting, and is a really good case for AI. Overall, an amazing bug found through great blackbox testing.