Web attacks: how the common ones work, and what stops them

A web attack uses an application's own requests against it: it sends input the code mishandles, or asks for something the user should not be allowed to do. Unlike a flood, it needs no volume. The pages in this section take the common web application attacks one at a time, by the name people search for them.

Section Web attacks Updated Attacks by name

Quick facts

What they target
The application's handling of input, sessions and permissions
Volume needed
Usually none: a single request can be enough
Where they are listed
OWASP Top 10:2025 groups them into categories
Where they are fixed
In the application code and configuration
What a WAF adds
It matches recognisable attack shapes in requests, which buys time; it does not fix the code

Each attack page links up to its OWASP category, where the category's data and prevention guidance are summarised.

The attacks in this section

Three attacks account for most of what people look up, and the rest of the section follows the same pattern: what goes wrong, which OWASP category it belongs to, and what a filter can see.

AttackWhat goes wrongOWASP categoryWhat a WAF can see
SQL injectionInput changes a database queryA05 InjectionMost: query syntax arrives in the request
Cross-site scriptingInput is sent back to other users as scriptA05 InjectionPart: markup in the request; not every DOM-based case
Cross-site request forgeryA user's browser is made to send a request they did not intendA01 Broken Access ControlLittle: the forged request looks legitimate
Command injectionInput reaches an operating system command or code evaluatorA05 InjectionMost: shell syntax arrives in the request
Server-side request forgeryThe server fetches an address the attacker choseA01 Broken Access ControlPart: obvious internal targets, not redirects or DNS tricks
XML external entitiesAn XML parser fetches files or URLs named in the documentA02 Security MisconfigurationPart: entity declarations in plain XML bodies
ClickjackingAnother site frames your page under a decoyA06 Insecure DesignNone: it happens in the browser
Path traversalA file name in the request climbs out of the intended folderA01 Broken Access ControlMost: traversal sequences in parameters
CRLF injectionLine breaks in input start new headers or log linesA05 InjectionPart: encoded line breaks in single-line values
HTTP request smugglingA front-end and a back-end disagree on where a request endsA06 Insecure DesignPart: conflicting length headers, where the filter refuses them
Business logic flawsValid requests produce outcomes the business never intendedA06 Insecure DesignNone: there is no pattern to match
Insecure direct object referenceChanging an identifier reaches another user's objectA01 Broken Access ControlNone: the request is valid
Session hijackingA stolen or planted session token is used as the userA07 Authentication FailuresLittle: the script that steals cookies, not the stolen token
CORS misconfigurationA response lets any site read a signed-in user's dataA02 Security MisconfigurationNone: it is in the response and the browser

More attacks are added to this section as their pages are written; the OWASP category pages already describe the others at category level.

Why web attacks work

Almost every web attack comes down to one of three mistakes: data that is treated as instructions, a request that is trusted because of where it seems to come from, or a permission that is checked in the page but not on the server.

None of these is visible from outside until someone tries it, which is why the same few attacks have stayed common for years. The fix is known for each; applying it everywhere is the hard part.

WHICH MISTAKE EACH ATTACK USES DATA TREATED AS INSTRUCTIONS TRUST IN THE ORIGIN CHECK ONLY IN THE PAGE SQL INJECTION CROSS-SITE SCRIPTING CROSS-SITE REQUEST FORGERY // three attacks, two kinds of mistake
// the mistake behind each attack decides where it is fixed

What a WAF can and cannot do about them

A web application firewall reads requests, so it does well where an attack has to put recognisable syntax into one: query fragments, script tags, command separators. It can refuse those while the code is fixed, which is called virtual patching.

It does poorly where the attack request is indistinguishable from a real one: a forged request carrying the victim's own cookies, or a request for another user's record. Those are fixed only in the application, by checking intent and ownership on the server.

Where to start fixing

  1. Keep data out of instructions. Parameterised queries and output encoding close injection and cross-site scripting.
  2. Check every request on the server. Ownership, role and intent, not only what the page allowed the user to click.
  3. Make cookies harder to misuse. The SameSite attribute and anti-forgery tokens stop forged cross-site requests.
  4. Watch before enforcing. Run filtering in monitor mode first to see which of your own fields look like attacks.

Questions

What are web attacks?

Web attacks are attacks on a website or web application through its own requests: input that the code mishandles, or requests for actions the user should not be allowed to take. SQL injection, cross-site scripting and cross-site request forgery are the most common.

What is the most common web application attack?

Injection attacks, including SQL injection and cross-site scripting, are among the most common; OWASP places injection in its Top 10:2025, alongside broken access control in first place.

Can a WAF stop web attacks?

Partly. A WAF can refuse requests carrying recognisable attack syntax, which protects vulnerable code while it is fixed. It cannot stop attacks that look like legitimate requests, such as forged requests or access to another user's data.