Protecting your systemsChapter 11

Web application security

The OWASP Top 10 2025 told through real cases, security headers, what a WAF can and cannot do, DAST and penetration testing, and the OWASP ASVS.

Nestor
Presented byNestor
10 min readUpdated on 2 October 2026

What you will learn

  • Understand the ten risk categories of the OWASP Top 10, 2025 edition
  • Follow an attacker’s reasoning against a web application, using real cases
  • Put the essential HTTP security headers in place
  • Know what a WAF protects, and what it does not
  • Choose between DAST, penetration testing and bug bounty, and require the OWASP ASVS

A counter open day and night

Brochure site, customer portal, online shop, extranet, the API behind a mobile app: your web applications can be reached from anywhere on the internet, 24 hours a day. Each one is a counter where anyone can walk up and ask questions. Most visitors ask the questions you planned for. An attacker asks the ones nobody thought of.

31%
of data breaches start with the exploitation of a software vulnerability, ahead of stolen passwords
Source: Verizon, 2026 Data Breach Investigations Report

This chapter follows the industry’s reference list, the OWASP Top 10, with real cases. It then reviews the protections: security headers, web application firewalls, testing and secure development practices.

The OWASP Top 10, the list to know

OWASP (the Open Worldwide Application Security Project) is a non-profit foundation that publishes free resources on software security. Its Top 10OWASP Top 10The reference ranking of the ten most critical categories of web application security risk, published by the OWASP Foundation and used worldwide to raise awareness and set requirements. ranks the ten main categories of risk for web applications. It is an awareness document, not a standard: it tells you where to look first.

The current version is the 2025 edition, the eighth. It draws on test results for more than 2.8 million applications, contributed by 13 organisations, plus a survey of practitioners covering risks that automated tools struggle to spot.

Rank Category (2025) In plain words
A01 Broken Access Control A user reaches something that is not theirs
A02 Security Misconfiguration Default settings, debug mode, needless features
A03 Software Supply Chain Failures Vulnerable or tampered components
A04 Cryptographic Failures Poorly encrypted data, badly stored passwords
A05 Injection Input interpreted as a command
A06 Insecure Design A flaw in the very logic of the service
A07 Authentication Failures Sign-in that is too easy to bypass or guess
A08 Software or Data Integrity Failures Updates or data accepted without checks
A09 Security Logging and Alerting Failures The attack happens and nobody notices
A10 Mishandling of Exceptional Conditions An error that leaves the door open

Compared with the 2021 edition, two categories are new (A03, widened to the whole software supply chain, and A10), and server-side request forgery (SSRF)Server-side request forgery (SSRF)A flaw that lets an attacker make the server itself send requests to addresses of the attacker’s choosing, including internal systems that are normally unreachable from the internet. has been folded into access control.

Five risks, told as stories

Broken access control (A01)

Picture the portal of a fictional company, Ressoria RH. Once you have signed in, your payslip appears at an address ending in a number: 1042. What happens if you type 1043? If the application only checks that you are signed in, and not that payslip 1043 belongs to you, it shows a colleague’s. This is an insecure direct object reference (IDOR)Insecure direct object reference (IDOR)An access control flaw in which an application serves a resource (an invoice, a file, an account) based on its identifier alone, without checking that the user is entitled to see it., the simplest form of broken access control.

100%
of applications tested for the OWASP Top 10 2025 showed some form of broken access control
Source: OWASP Top 10:2025, A01

The fix: deny by default, check on the server, for every request, that the user is allowed to act on this particular object, and write automated tests that try to reach another account’s data.

Injection (A05)

Injection happens when an application drops user input into a command (a database query, an operating system command) without keeping the two apart. The input stops being plain data and becomes an instruction. SQL injectionSQL injectionAn attack that slips database commands into an input field or URL in order to read, change or delete data the attacker should never be able to touch. is the best-known form, and cross-site scripting (XSS)Cross-site scripting (XSS)A web application flaw that lets an attacker inject JavaScript into a page viewed by other users, and so act inside their browser on their behalf. is its cousin in the browser.

Real case

MOVEit Transfer, 2023. From 27 May 2023, the Cl0p criminal group exploited an SQL injection flaw (CVE-2023-34362) in this internet-facing file transfer software. It planted a web shell and stole the contents of the underlying databases. According to CISA, thousands of organisations were affected. In March 2024, CISA and the FBI pointed out that SQL injection has been considered “unforgivable” since at least 2007, because preventing it is well understood.

The fundamental protection has been known for more than twenty years: the parameterised query. The command and the data travel separately, so the input can never be interpreted as code.

// Parameterised query: the input stays data, never SQL code.
// The client_id condition also checks that the invoice belongs to the signed-in customer.
$stmt = $pdo->prepare('SELECT * FROM invoices WHERE id = :id AND client_id = :client');
$stmt->execute(['id' => $invoiceId, 'client' => $signedInClient]);

Security misconfiguration (A02)

An administrator account still using its default password, debug mode left on in production, error messages that display technical details, directory listings, open cloud storage: misconfiguration climbed from fifth to second place in 2025. The cure is reference configurations that are hardened, version-controlled and applied automatically at every deployment.

Vulnerable components (A03)

In 2017, the US credit reporting agency Equifax suffered a breach affecting around 147 million people. The attackers exploited a critical flaw in the Apache Struts framework: the company had been alerted in March 2017 but had not applied the patch in time. In 2019, Equifax agreed to pay at least $575 million, and up to $700 million, in a settlement with the FTC, the CFPB and US states. Chapter 12 explains how to keep track of your dependencies.

Authentication (A07)

Between April and September 2023, an attacker tried username and password pairs stolen in other breaches against the 23andMe website: this is credential stuffingCredential stuffingAn automated attack that tries large numbers of username and password pairs stolen elsewhere against a site, betting that people reuse the same passwords.. Accounts belonging to customers who reused their password opened up, and with them highly sensitive data, including family trees and health reports. In the UK alone, 155,592 people were affected. In June 2025, the Information Commissioner’s Office fined the company £2.31 million, criticising in particular the lack of mandatory MFA and a response that came far too late: logging and alerting (A09) had failed too.

The fixes: MFA, limits on the number of attempts, detection of unusual sign-ins, and rejection of passwords known to be compromised.

And the rest

  • A04, cryptography: encrypt traffic and store passwords with a slow, salted hashing function (chapter 8).
  • A06, design: a discount code usable endlessly, a transfer that can be approved twice. No tool sees these logic flaws: you need threat modelling from the design stage.
  • A08, integrity: only accept an update, a plug-in or serialised data after checking where it comes from.
  • A10, exceptional conditions: when an error occurs, the application must “fail closed”, meaning it refuses access, without showing technical details.

Security headers: the browser’s seat belt

Your visitors’ browsers can help protect them, provided your server gives them instructions. Those instructions travel as HTTP headers added to every response, for the price of a few lines of configuration. The first one to set is HSTSHSTSA security header through which a website tells the browser to connect to it over HTTPS only, which stops an attacker from downgrading the connection to unencrypted HTTP..

Header Purpose
Strict-Transport-Security (HSTS) Enforces HTTPS and prevents a forced downgrade to HTTP
Content-Security-Policy (CSP) Lists the allowed sources of scripts and content, which sharply limits the impact of XSS
X-Content-Type-Options: nosniff Stops the browser from guessing a file’s type
frame-ancestors (CSP) or X-Frame-Options Prevents your pages from being shown inside another site’s frame (clickjacking)
Referrer-Policy Limits what is passed on to the next site
Permissions-Policy Turns off camera, microphone and geolocation when they are not needed

Add session cookies flagged Secure, HttpOnly and SameSite, remove headers that advertise your software versions, and forget the old X-XSS-Protection header, which OWASP now recommends disabling in favour of CSP.

Tip

Test your headers in two minutes. Free tools such as Mozilla’s Observatory analyse the headers of a public website and give it a grade. Start with HSTS and nosniff, then build your CSP gradually, in “report only” mode before you make it blocking.

The WAF: useful, not magic

A web application firewall (WAF)WAF (web application firewall)A filter placed in front of a website or API that inspects each web request and blocks those that look like attacks (SQL injection, XSS, abusive bots). sits in front of the application and inspects requests. It blocks known attack patterns, limits request rates and can act as a “virtual patch”: when a flaw is published, a rule filters attempts to exploit it while the code is being fixed.

Its limits are real, though:

  • it does not understand your business: asking for invoice 1043 instead of 1042 is a perfectly normal request as far as it can tell;
  • it can be bypassed: an attacker tries variations until one slips past the rules;
  • it needs tuning: too strict and it blocks customers, then ends up in “detect only” mode; too loose and it is useless;
  • it can become the flaw: in the Capital One case (chapter 10), a misconfigured web application firewall was the way in.

Testing: DAST, penetration testing and bug bounty

Three approaches complement each other. Dynamic testing (DAST)DAST (dynamic analysis)Automated testing of a running application, sending it requests the way an attacker would in order to observe its reactions and detect exploitable flaws. points a scanner at the running application, from the outside. Penetration testingPenetration testing (pentest)A simulated attack, carried out by authorised specialists, to find the weaknesses in a system before a real attacker exploits them. hands the application to human experts. A bug bounty pays researchers for each flaw they find.

Approach Strengths Limits
DAST Fast, repeatable, can run at every release Struggles with business logic and permissions between users
Penetration test Finds logic flaws and chains of small weaknesses One-off and more expensive
Bug bounty Many varied eyes, all year round Needs an organisation able to triage and fix quickly

A sensible rhythm: DAST at every release, a penetration test at least once a year and after every major change. The OWASP Web Security Testing Guide (WSTG) describes the method; source code analysis (SAST) is covered in chapter 12.

What the law says

Never without written authorisation. Testing an application that does not belong to you, even “to help out”, may amount to fraudulent access to an automated data processing system under the French Criminal Code, punishable by 3 years’ imprisonment and a €100,000 fine (Article 323-1). A penetration test is always carried out under a written mandate that sets the scope and dates (chapter 17).

Secure development: habits that pay off

The OWASP ASVS: from a list to requirements

The Top 10 tells you where to look; the ASVS (Application Security Verification Standard) tells you what to require. Version 5.0, released on 30 May 2025, brings together around 350 verifiable requirements, organised in 17 chapters and three levels: a first level within reach of any application, an intermediate level suited to most applications handling sensitive data, and an advanced level for the most critical ones.

In practice, write “compliant with OWASP ASVS 5.0, level 2” into the specification you give a development contractor. You get a precise requirement that an auditor can verify, instead of a vague “secure application”.

Key takeaways

  1. Broken access control is the number one risk: every request must be checked on the server, object by object.
  2. Injection is prevented at source with parameterised queries: user input must never become code.
  3. Security headers (HSTS, CSP, nosniff, frame-ancestors) are cheap protection that would be a shame to forget.
  4. A WAF filters known attacks and buys time, but it does not understand your business logic and cannot replace correct code.
  5. Test continuously (DAST), have humans audit you (penetration testing) and use the OWASP ASVS as your requirements framework.

Were you paying attention?

Three questions to check, no score, no account.

1. On a customer portal, a user changes the invoice number in the address bar and sees another customer’s invoice. Which OWASP Top 10 category is this?
2. What is the fundamental protection against SQL injection?
3. Why is a WAF not enough against an IDOR flaw?

Sources

From theory to practice

So how does your system measure up?

Create your account and get an A+ to F grade for your domains’ encryption in minutes, with every finding explained and the fix to apply.

Run the audit from your account: an A+ to F grade for your domains’ encryption in minutes, with every finding explained and the fix to apply.

Contact us

A question, a project, a partnership? Write to us: the team answers by email, usually within one business day.

Your details are only used to answer you. Do not include passwords or vulnerability details.