CCyberwiki

Common types of attack on web applications

Attacks on web applications fall into a small number of recurring types, and each type has a typical cause, such as query text built from request data or a record looked up by ID without an ownership check. Table 1 lists eight common types; each has its own main article.

Summary

Table 1. Eight common types of attack on web applications.
No.TypeDefinitionTypical causeOWASP Top 10:2025Main article
1InjectionInput changes the structure of a database query or commandQuery text assembled from request dataA05SQL injection
2Cross-site scriptingInput supplied by one user runs as script in other users' browsersUser content inserted into HTML without encodingA05Cross-site scripting
3Broken access controlA user reads or changes data that belongs to another userRecords looked up by ID without an ownership checkA01Insecure direct object reference
4Exposed credentialsA secret key is readable by unauthorised peopleKeys committed to a repository or shipped in client-side codeA07Exposed credentials in source code repositories
5Authentication attacksPasswords are guessed, or reused from other breachesNo limit on sign-in attempts; no second factorA07Credential stuffing
6Security misconfigurationA file, service or setting is more open than intendedDefault settings, debug pages, open ports, public bucketsA02Exposed sensitive files
7Vulnerable and malicious dependenciesThird-party code brings a known flaw or hostile codeOutdated packages; packages installed without reviewA03Vulnerable dependencies
8Server-side request forgeryThe server is made to fetch an address chosen by the attackerURL-fetching features with no allow-listA01Server-side request forgery

Injection

Main article: SQL injection

Injection happens when user input, joined into a query or a command, changes what that query or command does. In SQL injection, the form covered in the main article, the input alters a database query.1 The cause is query text assembled by joining strings, and passing values as parameters removes it. Command injection and template injection are other forms of the same weakness.2

Cross-site scripting

Main article: Cross-site scripting

In cross-site scripting (XSS), text supplied by one user is placed in a page without encoding and runs as script in the browsers of other users.3 The script runs with the victim's session, so it can read the page, act as the victim or send them to another site. The defences are Output encoding by the template system, keeping away from functions that insert raw HTML, such as React's dangerouslySetInnerHTML, and a Content Security Policy.

Broken access control

A user who changes a number in a URL and gets back another user's data is exploiting broken access control, the class of weakness that lets a user reach data or functions beyond their permissions. That case has its own name, insecure direct object reference, because the application returns a record by its identifier without checking who owns it.4 In applications built on Supabase, the same weakness appears as a table without row level security.

Exposed credentials

API keys, tokens and passwords become exposed when they are committed to a repository, included in JavaScript sent to the browser, or written to logs. Anyone who reads the credential can use the service as the application.5 The remedy is to revoke the credential at the provider; deleting the file leaves it in the repository's history. Related articles: Client-side code exposure, Abuse of leaked API keys.

Authentication attacks

Authentication attacks target the sign-in form. In credential stuffing, an attacker tries username and password pairs leaked from other services; in a brute-force attack, the attacker tries many passwords or one-time codes in turn.6 Both succeed where the application does not limit the number of attempts or does not require a second factor. A stolen session cookie skips the sign-in altogether; see Session hijacking.

Security misconfiguration

A misconfigured service or setting is more open than its owner intended: default accounts left enabled, debug pages and directory listings left on, database ports reachable from the internet, or cloud storage buckets readable by anyone.7 None of these needs a flaw in the application's own code, and automated scanners find them by requesting common paths and ports.

Vulnerable and malicious dependencies

A package version with a published vulnerability exposes every application that installs it. A malicious package, often named to resemble a popular one, runs its own code when it is installed.8 Keeping packages updated, reviewing a new dependency before installing it and committing a lock file reduce both risks.

Server-side request forgery

An application that fetches a URL supplied by a user can be handed the address of an internal service instead, such as a cloud provider's metadata endpoint or a database on the private network. This is server-side request forgery (SSRF).9 The request leaves from inside the network, past firewalls that block outside traffic. The defence is an allow-list of permitted destinations, checked after the host name has been resolved.

Relationship to other classifications

The table's fifth column refers to the OWASP Top 10:2025, a ranking of the most serious security risks to web applications published by the Open Worldwide Application Security Project (OWASP).10 The Top 10 files cross-site scripting under Injection (A05)2 and SSRF under Broken Access Control (A01), the category it ranks first.11 Each type also matches one or more entries in the Common Weakness Enumeration (CWE), cited in the infobox of its main article. MITRE ATT&CK describes the same attacks from the attacker's side, as techniques grouped by tactic. Mapping to the OWASP Top 10:2025 and Mapping to MITRE ATT&CK place every article of this wiki in both schemes.

See also

References

  1. back "CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')". Common Weakness Enumeration. MITRE.
  2. a b "A05:2025 Injection". OWASP Top 10:2025. OWASP Foundation.
  3. back "CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')". Common Weakness Enumeration. MITRE.
  4. back "CWE-639: Authorization Bypass Through User-Controlled Key". Common Weakness Enumeration. MITRE.
  5. back "CWE-798: Use of Hard-coded Credentials". Common Weakness Enumeration. MITRE.
  6. back "A07:2025 Authentication Failures". OWASP Top 10:2025. OWASP Foundation.
  7. back "A02:2025 Security Misconfiguration". OWASP Top 10:2025. OWASP Foundation.
  8. back "A03:2025 Software Supply Chain Failures". OWASP Top 10:2025. OWASP Foundation.
  9. back "CWE-918: Server-Side Request Forgery". Common Weakness Enumeration. MITRE.
  10. back "OWASP Top 10:2025". OWASP Foundation.
  11. back "A01:2025 Broken Access Control". OWASP Top 10:2025. OWASP Foundation.