---
title: "Web application security"
description: "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."
url: https://krakenshield.eu/knowledge/a-to-z/11-web-application-security/
lang: en
updated: 2026-10-02
publisher: KrakenShield (KRAKEN HOLDING SAS)
overview: https://krakenshield.eu/llms.txt
---
# 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.

Protecting your systems Chapter 11

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.

## 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.

> **Nestor Former hacker turned defender:** I never “broke” a web application the way people imagine. I asked it awkward questions, politely, until it told me something it should never have said.

## 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 10](https://krakenshield.eu/knowledge/glossary/owasp-top-10/) 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)](https://krakenshield.eu/knowledge/glossary/ssrf/) 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)](https://krakenshield.eu/knowledge/glossary/idor/), 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 injection](https://krakenshield.eu/knowledge/glossary/sql-injection/) is the best-known form, and [cross-site scripting (XSS)](https://krakenshield.eu/knowledge/glossary/xss/) is its cousin in the browser.

> **Real case**
> 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 stuffing](https://krakenshield.eu/knowledge/glossary/credential-stuffing/). 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.

> **Nestor Former hacker turned defender:** The best moment to get in is when the application no longer knows what to do. An error handled so badly that it ends up saying “oh well, come in anyway”: I came across more than one.

## 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 [HSTS](https://krakenshield.eu/knowledge/glossary/hsts/).

| 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**
> 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)](https://krakenshield.eu/knowledge/glossary/waf/) 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.

> **Nestor Former hacker turned defender:** A WAF is great at stopping burglars who shout “I’m a burglar!” I used to ask politely for the neighbour’s invoice, and it saw nothing wrong with that. Keep the WAF, but fix the code.

## Testing: DAST, penetration testing and bug bounty

Three approaches complement each other. [Dynamic testing (DAST)](https://krakenshield.eu/knowledge/glossary/dast/) points a scanner at the running application, from the outside. [Penetration testing](https://krakenshield.eu/knowledge/glossary/penetration-testing/) 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**
> 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

- **Use a modern framework** and its built-in protections: automatic output escaping, anti-[CSRF](https://krakenshield.eu/knowledge/glossary/csrf/) tokens, session management.
- **Centralise access control** in a single layer, instead of repeating it (and forgetting it) on every page.
- **Validate on the server** : any check done in the browser can be bypassed.
- **Parameterise every query** , and never build a command by string concatenation.
- **Keep secrets out of the code** and dependencies up to date (chapter 12).
- **Log security events** : failed sign-ins, access refusals, permission changes, with alerts.
- **Have code reviewed** and model threats before every sensitive feature.

## 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”.

> **Nestor Former hacker turned defender:** When a client shows me a specification that cites the ASVS, I know the application was designed to hold up. My penetration test report gets shorter, and that is excellent news for everyone.

## 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.

## Sources

- [OWASP Top 10:2025](https://owasp.org/Top10/2025/)
- [OWASP Top 10:2025, A01 Broken Access Control](https://top10.owasp.org/2025/A01_2025-Broken_Access_Control/)
- [OWASP Application Security Verification Standard (ASVS)](https://owasp.org/www-project-application-security-verification-standard/)
- [OWASP Web Security Testing Guide (WSTG)](https://owasp.org/www-project-web-security-testing-guide/)
- [OWASP Cheat Sheet Series, HTTP Security Response Headers](https://cheatsheetseries.owasp.org/cheatsheets/HTTP_Headers_Cheat_Sheet.html)
- [OWASP Cheat Sheet Series, SQL Injection Prevention](https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html)
- [Légifrance, French Criminal Code, Articles 323-1 et seq. (in French)](https://www.legifrance.gouv.fr/codes/section_lc/LEGITEXT000006070719/LEGISCTA000006149839/)
- [CISA and FBI, advisory AA23-158A on Cl0p exploiting MOVEit Transfer (June 2023)](https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-158a)
- [CISA and FBI, Secure by Design Alert: Eliminating SQL Injection Vulnerabilities (March 2024)](https://www.cisa.gov/resources-tools/resources/secure-design-alert-eliminating-sql-injection-vulnerabilities-software)
- [FTC, Equifax settlement over the 2017 data breach (July 2019)](https://www.ftc.gov/news-events/news/press-releases/2019/07/equifax-pay-575-million-part-settlement-ftc-cfpb-states-related-2017-data-breach)
- [ICO, 23andMe fined £2.31 million (June 2025)](https://ico.org.uk/about-the-ico/media-centre/news-and-blogs/2025/06/23andme-fined-for-failing-to-protect-uk-users-genetic-data/)
- [Verizon, 2026 Data Breach Investigations Report](https://www.verizon.com/business/resources/reports/dbir/)

## Preparing for the CISSP?

This chapter is a foundation for domains 6 and 8 of our CISSP preparation, which adds everything else the exam asks for.

[All chapters](https://krakenshield.eu/knowledge/a-to-z/)
