Architectural Threat Map
Transcript
Made automatically from the video's sound, so it may contain mistakes. Click a line to play from there.
Right, let's get straight into this explainer. Welcome to episode zero of our web security concept series for Zoomy Labs. Look, if you're a software engineer, a security architect, or a platform builder, you are absolutely in the right place.
Today, we're completely shifting our perspective. We're going to stop viewing web security as just this sprawling, endless checklist of random bugs. Instead, we're mapping it out as a unified architectural system.
So we're ditching the hacker in a hoodie cliches right out of the gate. We're looking strictly at the engineering realities of untrusted inputs and protocol layers, so you can actually build paved roads that work. But to really understand this system, we have to start with a pretty fundamental question about the baseline reality of the platforms we're building on.
Namely, why is the web inherently hostile by design? You know, it's not just because there are bad actors out there on the internet. It is quite literally built into the very architecture of how the web functions. And this setup brilliantly illustrates the friction we're dealing with every single day.
Think about it. Browsers are quite literally built to execute untrusted code from arbitrary origins, all at the exact same time, whilst holding on to ambient credentials like your session cookies.
It's a completely chaotic sandbag. And honestly, that's on a good day. Then flip over to the back end environment. Your backend isn't just one monolithic thing.
It ingests chaotic inputs across multiple layers of interpretation. We're talking HTTP routers, proxy servers, JSON parsers, SQL interpreters, shell interpreters, and the kicker. All of these layers have completely conflicting assumptions about the data they're passing.
It is literally a perfect storm for vulnerabilities. Because of this harsh reality, we have to kill the outdated carcasselor Mote analogy right here, right now. As the NIST Zero Trust Architecture publication lays out perfectly, implicit trust, based purely on network location is completely dead in modern cloud native apps.
You just cannot assume an input is safe simply because it came from inside your corporate firewall. Every single asset, every user and every input has to be continuously verified, no exceptions.
The architectural threat map. We'll be looking at the five core trust boundaries. You see, every single piece of data entering or leaving your application crosses five explicit trust boundaries.
We've got the bare wire, the cross-origin browser tab, untrusted DOM inputs, your identity and session state, and finally backend passers. Vulnerabilities, they don't just happen by magic, right? They arise exactly when untrusted inputs cross these specific boundaries without the proper engineering controls in place.
So let's break them down. Starting right at the edge on the bare network layer. Our primary defence against wire attackers consists of incredibly strict cryptographic controls.
As outlined by the OWASP Transport Layer Protection Cheat Sheet, if an attacker is intercepting traffic on the wire, we aren't relying on our application logic to stop them. Absolutely not.
We're relying on TLS 1.3 and HSTS to ensure that the data simply cannot be read or tampered with in transit. It's that foundational. Okay, so once the data survives the wire, it hits the browser tab.
Here, the MDN documentation on the same origin policy perfectly highlights that this is our primary isolation mechanism. Think of it this way. If a user has your application open in one tab and a malicious website open in another, the same origin policy, along with cross-origin resource sharing or cores, is exactly what stops that malicious third-party site from reaching across the browser and hijacking the active session or reading sensitive API data.
Now, inside that browser, Port Swigger's categorization of DOM-based vulnerabilities, reveals our third boundary, taint flow. When untrusted client input, which is the source, reaches an execution point, the sync, without proper sanitization, well, the architecture just fails.
This is exactly how you end up with DOM-based JavaScript injection, prototype pollution or DOM clobbering. The control here is absolutely crucial. You need strict context-aware sanitization before that data ever hits the DOM sync.
But here's the thing securing the code isn't enough if you can't secure the user. And that brings us to identity and session. State management essentially dictates whether attackers can abuse ambient authority or hijack authentication patterns.
Whether you're using cookies, OAuth, JWTs, or parse keys, the controls you implement at this boundary are literally what stands between a secure session and a catastrophic credential stuffing or session hijacking attack. You have to explicitly define how trust is maintained across otherwise stateless HTTP requests.
And finally, we hit the most chaotic boundary of all, the back end. The data has survived the browser, it survived the network, and now it hits your servers. This is where mismatched parser assumptions trigger massive system-wide failures.
When an edge proxy reads an HTTP request differently than the origin server, you get HTTP request smuggling. When a database passes user input as a command, you get blind SQL injection. When an XML parser blindly processes external entities, you get XXE.
It all comes down to edge to origin to data passers, basically failing to agree on what the data actually is. Root causes, unifying the OWASP top 10. You know, most people learn security by staring at massive, completely disconnected vulnerability checklists.
They're just treating symptoms from bug bounty reports. But as platform builders, we really need to view these exploits as variations of just three core systemic flaws. In band data as code injection, parser desynchronization, and the confused deputy problem.
If you can wrap your head around these three, you'll understand the route of almost every single modern web vulnerability. Let's look at the first one. Whether it's a SQL injection, escaping a database query, an XXE attack, manipulating XML document type definitions, or an OS command injection, the root cause is identical.
It's in band data as code injection. This is the architectural failure of treating untrusted data as executable code within the exact same channel. You're basically asking a parser to figure out where the data ends and the instructions begin.
And trust me, attackers will always find a way to confuse that boundary. And this leads us directly to our second root cause, which perfectly explains why advanced exploits are so incredibly dangerous today. Parser desynchronization happens when interacting systems, like, say your front-end load balancer and your back end API server interpret the exact same data payload differently.
One sees a single HTTP request, while the other sees two. Your edge firewall allows the payload because it thinks it's harmless, but your back end executes the hidden attack surface. Your defenses have simply desynchronized from the application logic.
The third root cause is the confused deputy problem, which is very tightly coupled with ambient authority. This is what underpins classic attacks like cross-site request forgery. The browser has ambient authority, meaning it automatically attaches session cookies to outgoing requests.
An attacker doesn't even need to steal the cookie, they just need to trick the browser, our confused deputy, into abusing its own authority to perform an action on the attacker's behalf. Defense in depth trade offs.
Here's the reality check. Every single time you lock down a trust boundary, say you're enforcing incredibly strict content security policies or implementing some really complex GraphQL input validation, you are spending currency.
You're spending developer velocity and you're spending system usability to buy security. It introduces security friction. But our goal as architects isn't to just eliminate velocity, it's to build secure paved roads so that doing the secure thing is actually the easiest possible path for the developer.
And keeping that balance is absolutely vital, because let's face it, your architecture is never static. As the OWASP Attack Surface Analysis Cheat Sheet notes, every new API, every new parameter, every new unvetted piece of technology you bolt on expands the paths for untrusted data.
Adding a new web service that doesn't follow your existing architectural patterns, that requires a completely new risk assessment. You're introducing new parsers and new boundaries that desperately need controlling. So as we wrap up this overview and prepare to break down each of these five boundaries in our upcoming deep dive explainers, I want to leave you with a final provocative thought.
Map out your data flow today. Look at your own trust boundaries, and ask yourself this when untrusted input enters your system, which parser will fail first? Take some time to think about that, and I'll see you in episode one where we're going to tackle the network layer.