Podcast
Root Causes 268: WAFs Subverted by JSON Bypass
Hosted by
Jason Soroko
Fellow
Original broadcast date
January 12, 2023
In this episode we discuss rising attacks that overcome the protections of Web Application Firewalls (WAF). We explain these attacks, why this bypass might effective against you even if think it doesn't, and what you should do to ensure you're safe.
Podcast transcript
Lightly edited for flow and brevity.
TCTim CallanI have a news article up here we wanted to talk about. This is from December 12 I believe. It is December 12. This is a Dark Reading article. The headline reads: Popular WAFs Subverted by JSON Bypass. This is by Robert Lemos. December 12. Dark Reading. You can look it up on your own later but, Jason, what does this article say?
So, Web Application Firewalls can be in everything from your big cloud providers and your CDN – so things like AWS, Cloudflare and then, of course even some of your on-prem stuff like F5, other names like Imperva Palo Alto. So all these big, big security players, infrastructure players will include WAFs in one way, shape, or form or the other.
So, WAFs have been around a long time but what some people have figured out is that when you are talking to a database in behind the WAF, there can be commands that you are issuing to the database using languages and markup languages that the database understands but that Web Application Firewalls don’t seem to have caught up to yet in terms of understanding malicious vs. legitimate context.
TCTim CallanOk. So there needs to be an opportunity to issue these commands. I guess in this case JSON commands but they could be structured to do something malicious and the WAF doesn’t have the logic to detect that. Is that right?
And so therefore, it’s a complex message in that it contains both commands and data and I think what’s happening for the most part is that these Web Application Firewalls are like, oh, well this is a JSON formatted package so, I don’t really know what’s going on in this package so I’m just gonna let it through. And so there’s all kinds of other commands that are sent where it’s scrutinized heavily by the WAF and anything that’s in JSON doesn’t seem to be as scrutinized and therefore a lot of what you would call WAF bypass to do malicious things or unexpected things is possible by packaging into these JSON formatted text strings. So therefore, it’s not gonna affect a website that doesn’t have a database that accepts JSON, so therefore, you’re safe if you are not doing that. The problem though is that a lot of modern web setups now have some sort of data structure in the backend that is accepting JSON. So therefore, this is a really good reminder and isn’t it funny, Tim, how these kinds of articles come out just before the holiday season when people really don’t want to be doing this kind of work.
TCTim CallanWorst time to be doing this kind of thing. Exactly.
TCTim CallanSure. So you can’t just say, oh, we aren’t using JSON. This doesn’t apply to me. You have to ask yourself is your WAF configured to accept JSON because that’s how the hole gets opened. That’s a very good point.
TCTim CallanSo this is new awareness. The reason we are talking about this now, presumably this exploit has existed previously. Possibly for a long time. The reason we are talking about this now is this is where it’s come to light. Is that correct?
TCTim CallanAnd to your point, if this is on the upswing, these providers – you said names like Cloudflare and Palo Alto Networks and Imperva, AWS. These are well-resourced organizations that are really trying to be as bulletproof as they possibly can. So you’ve got to imagine that they would take something like that seriously. Especially if it’s an emerging threat and give whatever response they are able to give.
TCTim CallanAnd you could imagine that, too. You could imagine we have JSON syntax support and then the bad guys are gonna try and figure out how to write something that’s gonna fool us and then we are gonna figure out how to catch that and the bad guys are gonna write something else to fool us and we are gonna get into that whole arm’s race. You could certainly see that as how this progresses from here.
TCTim CallanThere you go. So maybe that’s a great place to leave it. That’s some good advice. If you are listening to this and you are responsible for the WAF or who is or it’s adjacent to your department, it’s good to think about that question and make sure that you are using that tool in the best way you are able to today.