Cybersecurity
Secure by Design: What the New OWASP Top 10 Means for Your Next Web App
The 2025 OWASP Top 10 added “Software Supply Chain Failures” and kept Broken Access Control at number one. A practical breakdown, with code, of the habits that prevent real breaches.
By Philip Mutuku · Published · Updated · 5 min read
Security advice tends to arrive as a wall of acronyms. So let's anchor this in something concrete: the OWASP Top 10, the most widely referenced list of web application security risks, refreshed in November 2025.[1] The headline changes tell you a lot about where real-world attacks are going.
What changed in the 2025 list
- A01: Broken Access Control is still number one, and now absorbs Server-Side Request Forgery (SSRF).[1]
- A03: Software Supply Chain Failures is a new, broader category. It evolved from “Vulnerable and Outdated Components” to cover compromised dependencies, malicious packages, tampered builds and insecure update mechanisms.[1]
- A10: Mishandling of Exceptional Conditions is new: apps that fail open, leak stack traces or behave unpredictably under error conditions.[1]
The message: attackers are increasingly targeting what you import and how you fail, not just what you wrote. And the oldest problem, letting people do things they shouldn't, still tops the list.
- $4.44M global average cost of a data breach in 2025, down 9% from $4.88M[2]
- 241 days on average to identify and contain a breach, a nine-year low[2]
- #1 Broken Access Control, still the top web application risk[1]
1. Fix access control at the data layer
The classic mistake is checking that a user is logged in but not that the record belongs to them. Change /api/invoices/101 to /api/invoices/102 and you're reading someone else's invoice. This is called an Insecure Direct Object Reference (IDOR), and it's a form of broken access control.
// VULNERABLE: authenticated, but not authorised
router.get('/invoices/:id', authenticateToken, async (req, res) => {
const [rows] = await pool.query('SELECT * FROM invoices WHERE id = ?', [req.params.id]);
res.json(rows[0]);
});
// SAFE: the ownership check is part of the query itself
router.get('/invoices/:id', authenticateToken, async (req, res) => {
const [rows] = await pool.query(
'SELECT * FROM invoices WHERE id = ? AND owner_id = ?',
[req.params.id, req.user.id]
);
if (rows.length === 0) return res.status(404).json({ message: 'Not found' });
res.json(rows[0]);
});
Notice the second version returns 404, not 403, so attackers can't even confirm that other IDs exist. Deny by default, and enforce the rule on the server. Hiding a button in the UI is not access control.
2. Treat your dependencies as part of your attack surface
A typical JavaScript project pulls in hundreds of transitive packages. In 2024, a backdoor was discovered in XZ Utils (CVE-2024-3094), a compression library embedded in most Linux distributions. It was planted by a maintainer-in-disguise who spent years earning trust, and it was caught largely by luck, when an engineer noticed SSH logins were slightly slow.[3] The lesson isn't “don't use open source.” It's that trust must be verified, not assumed.
Habits that materially reduce supply chain risk:
- Commit your lockfile and install with
npm ciin CI so builds are reproducible. - Run
npm audit(or an equivalent scanner) on every pull request, and fail the build on high-severity issues. - Pin and review updates. Use a bot such as Dependabot or Renovate, but read what changes before merging.
- Prefer fewer, well-maintained dependencies. Every package you add is code you didn't write but are responsible for.
- Lock down CI secrets. Build pipelines are a favourite target because they hold deploy keys.
3. Fail safely
The new A10 category is about what your app does when something goes wrong. Two common patterns: errors that leak internals to the user, and errors that fail open, where an auth check throws an exception and the code carries on as though it passed.
// Fails OPEN: if verification throws, the request proceeds
try {
await verifyPermission(user, resource);
} catch (e) {
console.log('permission check failed, continuing');
}
// Fails CLOSED: any error means denial, and the client sees nothing sensitive
try {
await verifyPermission(user, resource);
} catch (e) {
logger.error({ err: e, userId: user.id, resource }); // full detail stays server-side
return res.status(403).json({ success: false, message: 'Access denied' });
}
The Kenyan context: security is also compliance
If you collect personal data from Kenyan users, the Data Protection Act, 2019 applies, and the Office of the Data Protection Commissioner expects data controllers and processors to register, apply appropriate security safeguards and report breaches.[4] A leaked customer database is not just an embarrassment; it can be a legal liability. Encrypt data in transit and at rest, collect only what you need, and know where it lives.
Turning a top-ten list into a team habit
Reading the OWASP list once does not change what a team ships. What changes outcomes is a small number of repeatable practices attached to work you already do. The aim is to make the secure path the easy path, so that nobody has to remember a rule at the moment they are racing a deadline.
- Add security to the definition of done. Every ticket that touches authentication, payments or personal data needs a line stating who can access it and how that is enforced.
- Review with a threat lens. In code review, ask one extra question: “What could an attacker send here that we did not expect?”
- Automate the boring checks. Dependency scanning, secret scanning and a basic static analyser should run on every pull request and block merges on high-severity findings.
- Test the negative cases. For each endpoint, write a test that proves a user from another account is refused.
- Rehearse an incident. Once a year, walk through “a key leaked on GitHub”. Who rotates it, who informs customers, who writes the report?
Three bugs that appear again and again
Insecure direct object references
An endpoint such as /invoices/1042 that returns the invoice without checking it belongs to the signed-in user. The fix is not hiding the ID; it is a server-side check on every read and write, ideally enforced in a shared data-access function so no developer can forget it.
Secrets in the repository
API keys, database passwords and payment credentials committed “just for now”. Version control remembers forever. Use environment variables or a secrets manager, add a pre-commit secret scanner, and rotate anything that has ever been committed.
Verbose error messages
Stack traces and SQL errors returned to the browser help attackers map your system. Log the detail on the server with a correlation ID, and show users a plain message with that ID so support can find the log.
Frequently asked questions
Is a penetration test required before launch?
Not legally for most applications, but it is wise for anything handling payments, health data or large volumes of personal data. A test is most valuable after you have fixed the issues automated tools can find, so the testers spend their time on logic flaws.
We are a small team. Where do we start?
Start with the cheapest high-impact items: enforce access control on every endpoint, turn on dependency and secret scanning, enable multi-factor authentication for admin accounts and cloud consoles, and keep tested backups. These four cover a large share of real-world incidents.
And if you've added AI features…
Chatbots and agents add their own risks: prompt injection, insecure output handling and excessive permissions are all catalogued in the OWASP Top 10 for LLM Applications.[5] Anything an LLM outputs should be treated like untrusted user input before it touches a database, a shell or a browser.
References & further reading
- OWASP Foundation, “OWASP Top 10:2025” (released November 2025). https://owasp.org/Top10/
- IBM & Ponemon Institute, “Cost of a Data Breach Report 2025”. https://www.ibm.com/reports/data-breach
- NIST National Vulnerability Database, CVE-2024-3094 (XZ Utils backdoor). https://nvd.nist.gov/vuln/detail/CVE-2024-3094
- Office of the Data Protection Commissioner, Kenya: Data Protection Act, 2019 and guidance. https://www.odpc.go.ke
- OWASP GenAI Security Project, “OWASP Top 10 for LLM Applications”. https://genai.owasp.org/llm-top-10/