Web applications are one of the most attacked parts of any organisation, because they are exposed to the internet and often connected to valuable data. The OWASP Top 10 lists the most critical web application risks, and the same categories show up again and again in real breaches. Here are the ones every defender should understand.
Practise these attacks only in labs or on applications you have written permission to test.
Broken access control
Access control decides what each user is allowed to do. When it is broken, users can act outside their permissions.
Example: a user views their invoice at /invoices/1042, changes the number to 1043 and sees someone else's invoice. This is called an insecure direct object reference.
Prevention:
- Check permissions on the server for every request, not just in the user interface.
- Deny access by default.
- Log access control failures and alert on repeated attempts.
Injection
Injection happens when untrusted input is treated as part of a command or query. SQL injection is the classic example.
Example: a login form builds a query by joining strings, and the attacker types ' OR '1'='1 as the password to bypass the check.
Prevention:
- Use parameterised queries or a safe ORM, never string concatenation.
- Validate input against what you expect.
- Give the database account the minimum permissions it needs.
Cross-site scripting (XSS)
XSS lets an attacker run their own JavaScript in another user's browser, usually by getting the application to display unescaped input.
Example: a comment field accepts <script> tags, and every visitor who views the comment has their session token sent to the attacker.
Prevention:
- Escape output by default using a modern framework.
- Use a Content Security Policy to limit which scripts can run.
- Mark session cookies as
HttpOnlyso scripts cannot read them.
Authentication failures
Weak login and session handling lets attackers take over accounts.
Common causes: no protection against brute force, weak password rules, session tokens that never expire and missing multi-factor authentication.
Prevention: rate-limit login attempts, require MFA for sensitive accounts, and expire sessions after logout and inactivity.
Security misconfiguration
Many breaches have nothing to do with clever code. They happen because something was left open.
Examples: default admin passwords, detailed error messages showing stack traces, open cloud storage buckets and unnecessary services running in production.
Prevention: use hardened configuration baselines, remove what you do not need and review settings regularly.
Vulnerable and outdated components
Applications are built on libraries and frameworks. If one of them has a known vulnerability, your application inherits it.
Prevention: keep an inventory of dependencies, monitor security advisories and patch quickly.
Server-side request forgery (SSRF)
SSRF tricks the server into making requests on the attacker's behalf, often to internal systems or cloud metadata services that should never be reachable from outside.
Prevention: validate and restrict the URLs a server is allowed to fetch, and block access to internal address ranges.
Thinking like a defender
For each vulnerability, ask how you would detect it as well as prevent it. Web server logs, WAF alerts and SIEM rules can reveal injection attempts, access control probing and unusual outbound requests long before data leaves the building. Our Applied Cyber Security course covers both sides, with labs where you attack a vulnerable application and then catch yourself in the logs.
Learn this hands-on
Applied Cyber Security
Learn how attacks work and practise stopping them in hands-on labs.
View course