Web security
Web security concerns the weaknesses that let software or a website visitor do something a web application did not intend, and the protections against them. An application can mistake outside data for instructions, accept requests users did not intend, or show controls whose real effect is hidden (OWASP Foundation, 2017; MITRE, n.d.b; MITRE, n.d.a). Browsers defend against these weaknesses by limiting what pages can read, run and embed, and sites can set some of those limits themselves (WHATWG, 2026b; West & Sartori, 2026; Vanderlinden & Franken, 2026). Historical studies found that many deployed content rules could be bypassed and some framing rules protected inconsistently. The counts used to track weaknesses each capture a different set of cases (Weichselbaum et al., 2016; Calzavara et al., 2020; OWASP Foundation, 2025c; Ezenwoye & Liu, 2022; Ayala et al., 2025).
Origins and permission to share
The same-origin policy limits access between pages from different origins. For an ordinary web address, the origin combines the scheme, such as HTTPS, the host name and the network port. Pages with the same origin share authority, while the browser isolates different origins from each other to varying degrees (WHATWG, 2026b).
Sites can give a different origin permission to read a response. Cross-Origin Resource Sharing (CORS) specifies that permission through HTTP headers, fields that accompany the web server’s response. The permission describes whether the browser may share the response with that origin (WHATWG, 2026a).
Data mistaken for instructions
The most familiar weaknesses arise when software treats outside data as part of a command.
Injection
Injection happens when software treats outside data as part of a command or query. In SQL injection, a database interprets a value as part of the instructions written in SQL, a language for querying and changing stored data. Specifying the query separately and binding each input as a parameter keeps the supplied value from changing those instructions (OWASP Foundation, 2017; MITRE, n.d.e; OWASP Cheat Sheets Series Team, n.d.c).
Cross-site scripting
Cross-site scripting (XSS) is the same failure in the browser. A web application incorporates untrusted data in a page, and the browser interprets it as code. Output encoding changes how the data is written so the browser treats it as data. Which encoding works depends on where the value appears in the page (MITRE, n.d.d; OWASP Cheat Sheets Series Team, n.d.a).
Browsers also enforce rules a site can set. Content Security Policy (CSP) lets a site specify which resources a page can load or execute. Trusted Types addresses a narrower problem: it can require designated kinds of values at certain browser interfaces in place of arbitrary text. This constrains how a page handles untrusted input and helps prevent cross-site scripting (West & Sartori, 2026; Kotowicz, 2026; OWASP Cheat Sheets Series Team, n.d.a).
What automatic escaping covers Weak evidence: few or small studies support this
One 2011 study found a gap between what frameworks could protect automatically and what the applications in its sample needed. Automatic escaping applies output encoding without requiring the developer to add it at each point where data appears. The protection depends on context, because a rule that is safe in one part of a page can be unsafe in another (Weinberger et al., 2011b).
Actions mistaken for consent
A second family of weaknesses makes an application act on a request or a click the user did not mean.
Cross-site request forgery
Cross-site request forgery (CSRF) occurs when an application accepts a request that does not reflect the user’s intent. OWASP recommends that applications without built-in framework protection check a CSRF token on the server for any request that changes application data or settings. The token is a value the server can check when it receives the request (MITRE, n.d.b; OWASP Cheat Sheets Series Team, n.d.b).
Browsers also control when they send cookies, small values a site asks the browser to store, with requests from other sites. The SameSite setting distinguishes requests within a site from requests involving another site. With Strict, the browser sends the cookie only for same-site requests. Lax allows a cookie to accompany certain cross-site visits to a new page in the main browser window (Bingler et al., 2025).
Clickjacking and framing rules
Clickjacking misleads someone into taking an action by hiding what their interaction actually controls. The defence is a framing policy, which limits which other pages may display the protected page inside them (MITRE, n.d.a). A frame is an area of one page that displays another. The CSP rule named frame-ancestors limits which pages can embed the resource. The X-Frame-Options header can forbid embedding or restrict it to pages with the same origin (West & Sartori, 2026; Vanderlinden & Franken, 2026).
What deployed content and framing rules protect Strong evidence: many studies agree on this
A count of CSP headers says little about protection, because the rules serve different purposes. The 2025 Web Almanac, a yearly public crawl of websites, reported CSP headers on 21.9% of its sample, up from 18.5% in 2024. A study of archived pages from 2012 through 2018 had already documented a shift from restricting content toward other security goals. Its survey of over 100 site operators found that perceived complexity discouraged use of even simpler CSP features (Vanderlinden & Franken, 2026; Roth et al., 2020).
Early studies found gaps by examining individual policy rules. In 2016, researchers classified 94.72% of the 26,011 distinct CSP policies they examined as readily bypassable under their criteria. A 2020 study found that about 10% of distinct framing policies gave inconsistent protection across browsers. Both percentages count each distinct policy once, however many sites use it (Weichselbaum et al., 2016; Calzavara et al., 2020).
Browsers ignore framing rules supplied in a form they do not recognise. In the 2025 crawl, roughly half of observed CSP headers included the framing rule. The same crawl found 5,564 instances of X-Frame-Options in page markup, where browsers ignore it; each tag in the page’s source counts as one instance (Vanderlinden & Franken, 2026).
Encrypted connections
HTTPS uses encryption to keep messages private in transit and lets the browser check which server it reached. HTTP Strict Transport Security (HSTS) tells the browser to use a secure connection whenever it contacts a known host, for a period the rule specifies (Kerschbaumer et al., 2025; Hodges et al., 2012).
The 2025 Web Almanac found HTTPS on 97.3% of the mobile homepages in its crawl. It observed HSTS headers on 36% of the mobile pages it visited, up six percentage points from the previous edition (Vanderlinden & Franken, 2026).
Measurements from people’s browsers count connections made during use, and they vary by country. In January 2025, 92.1% of connections that loaded a main page in Firefox 134 were encrypted, with 98.0% in Denmark and 51.2% in Sudan. Each figure describes that release and month (Kerschbaumer et al., 2025).
What the rankings measure
The OWASP Top 10 is an awareness document that summarizes security risks for web applications. For the 2025 edition, OWASP selected eight categories from contributed test data and two from a community survey. Its call for data asked, for each weakness, how many applications were tested and how many had at least one finding. What contributors find largely reflects what they can test automatically at scale (OWASP Foundation, 2025b; OWASP Foundation, 2025c).
The same weakness can be grouped differently across editions. Injection ranked first in 2017, third in 2021 and fifth in 2025. In 2021, OWASP also moved cross-site scripting into the injection category. The change in what the category contains limits what its rank can say about changes in the underlying weaknesses (OWASP Foundation, 2017; OWASP Foundation, 2025c; OWASP Foundation, 2021).
OWASP’s Application Security Verification Standard (ASVS) sets requirements for designing, developing and testing web applications and services. Version 4.0 dates to 2019. Version 5.0.0, published in May 2025, kept three levels of verification requirements and updated their definitions (OWASP Foundation, n.d.; OWASP Foundation, 2025d).
What vulnerability records measure
Counts of disclosures describe the reports in a dataset. A preprint classifying 13,346 US National Vulnerability Database records for web applications from 2011 through 2020 found that 27.6% concerned XSS, 9.9% SQL injection and 5.8% cross-site request forgery. An open-source software study identified valid weaknesses in bounty reports and advisories that had no identifier in the system used to track publicly disclosed vulnerabilities (Ezenwoye & Liu, 2022; Ayala et al., 2025).
Archives offer a view of change in the pages themselves. A study of prominent sites from 1997 to 2016 found that injection weaknesses in browser code became more likely alongside the spread of JavaScript-driven applications in the early 2000s (Stock et al., 2017). A disclosure study from 2012 found that SQL injection reports shifted from more popular to less popular applications, with no corresponding shift for XSS (Scholte et al., 2012).
What scanners and bounties find Weak evidence: few or small studies support this
Automated security scanners can miss weaknesses even when evaluators know the full set of flaws. Five scanners tested on an e-commerce benchmark missed most of its known injection weaknesses in almost all modes tested. In an evaluation of 75 web applications, code-inspecting and running-software tools together reported no findings in one category of the 2021 OWASP Top 10 (Althunayyan et al., 2022; Qadir et al., 2025).
Scanners can disagree about the same applications. In a 2017 study, two scanners disagreed widely in their reports across 140 applications, yet four scanners showed no significant overall performance differences on benchmarks (Alsaleh et al., 2017).
Bug bounty programs, which pay outside researchers for eligible vulnerability reports, have supplied a share of the fixes in two browsers. A three-year study of Chrome and Firefox found that bounties accounted for 28% and 24%, respectively, of patched vulnerabilities listed in their security advisories (Finifter et al., 2013). A later study of HackerOne programs counted valid monthly reports, but lacked the data to adjust for their severity or for the scope of programs. These outcomes measure what was reported or fixed in the programs studied (Sridhar & Ng, 2021).
Further reading
- The HTML and Fetch standards describe the origin boundary and how a server can allow a response to be shared outside it (WHATWG, 2026b; WHATWG, 2026a).
- OWASP’s introduction to the 2025 Top 10 explains how the project combines test data and survey responses (OWASP Foundation, 2025c).
- The 2025 Web Almanac security chapter tracks browser security headers and HTTPS in a public crawl (Vanderlinden & Franken, 2026).
- Roth and colleagues trace changes in the uses of CSP and ask site operators how they decide which protections to deploy (Roth et al., 2020).
- Althunayyan and colleagues report a scanner comparison using known weaknesses in one test application (Althunayyan et al., 2022).
- Finifter and colleagues estimate the share of patched weaknesses that came from bounty programs in two browsers (Finifter et al., 2013).
First published .
Known gaps
What this article cannot tell you yet.
- The disclosure datasets do not estimate present-day prevalence across web applications or establish a comparable trend for all four weakness classes. The article gives no clickjacking prevalence estimate.
- The evidence on automatic escaping does not establish whether adopting it lowers the rate of reported cross-site scripting vulnerabilities in modern frameworks.
- The historical studies of content and framing policies use different samples and measures from the 2025 crawl. Their findings cannot establish a current rate of ineffective policies.
- The HTTPS traffic figures come from one browser release. Comparable visit-level estimates across other browsers are missing.
- The bounty studies covered here do not establish a general effect on breach rates.
References
- Solid source
- Rated highly trustworthy by the research, and every passage taken from it was found in it.
- Weak source
- Rated low, or a passage taken from it was not found in it.
- Medium trust
- Rated medium by the research.
- Not checked
- Rated high, but its passages could not all be checked against it.
Show all 34 references
- Alsaleh, M., Alomar, N., Alshreef, M., Alarifi, A., & Al-Salman, A. (2017). Performance-Based Comparative Assessment of Open Source Web Vulnerability Scanners. Security and Communication Networks. https://faculty.ksu.edu.sa/sites/default/files/6158107_1.pdf Solid source Peer-reviewed, read in large part.
- Althunayyan, M., Saxena, N., Li, S., & Gope, P. (2022). Evaluation of black-box web application security scanners in detecting injection vulnerabilities. Electronics, 11(13), 2049. https://orca.cardiff.ac.uk/id/eprint/151240/ Solid source Peer-reviewed, abstract only.
- Ayala, J., Tung, Y., & Garcia, J. (2025). Investigating Vulnerability Disclosures in Open-Source Software Using Bug Bounty Reports and Security Advisories. arXiv. https://arxiv.org/abs/2501.17748 Medium trust Preprint, read in large part.
- Bingler, S., West, M., & Wilander, J. (2025). Cookies: HTTP State Management Mechanism. Internet Engineering Task Force Internet-Draft, draft-ietf-httpbis-rfc6265bis-22. https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis-22 Solid source Documentation, read in large part.
- Calzavara, S., Roth, S., Rabitti, A., Backes, M., & Stock, B. (2020). A Tale of Two Headers: A Formal Analysis of Inconsistent Click-Jacking Protection on the Web. 29th USENIX Security Symposium, 683–697. https://www.usenix.org/conference/usenixsecurity20/presentation/calzavara Medium trust Peer-reviewed, abstract only.
- Ezenwoye, O., & Liu, Y. (2022). Web Application Weakness Ontology Based on Vulnerability Data. arXiv. https://arxiv.org/abs/2209.08067 Medium trust Preprint, read in large part.
- Finifter, M., Akhawe, D., & Wagner, D. (2013). An Empirical Study of Vulnerability Rewards Programs. 22nd USENIX Security Symposium, 273–288. https://www.usenix.org/conference/usenixsecurity13/technical-sessions/presentation/finifter Medium trust Peer-reviewed, abstract only.
- Hodges, J., Jackson, C., & Barth, A. (2012). HTTP Strict Transport Security (HSTS). RFC Editor, RFC 6797. https://www.rfc-editor.org/rfc/rfc6797 Solid source Documentation, read in large part.
- Kerschbaumer, C., Braun, F., Friedberger, S., & Jürgens, M. (2025). The State of https Adoption on the Web. Workshop on Measurements, Attacks, and Defenses for the Web (MADWeb) 2025. https://research.mozilla.org/files/2025/03/the_state_of_https_adoption_on_the_web.pdf Medium trust Peer-reviewed, read in large part.
- Kotowicz, K. (2026). Trusted Types. W3C Working Draft. https://www.w3.org/TR/2026/WD-trusted-types-20261007/ Solid source Documentation, read in large part.
- MITRE (n.d.b). CWE-352: Cross-site request forgery. Common Weakness Enumeration. https://cwe.mitre.org/data/definitions/352.html Solid source Documentation, read in large part.
- MITRE (n.d.a). CWE-1021: Improper restriction of rendered UI layers or frames. Common Weakness Enumeration. https://cwe.mitre.org/data/definitions/1021.html Solid source Documentation, read in large part.
- MITRE (n.d.e). CWE-89: Improper neutralization of special elements used in an SQL command. Common Weakness Enumeration. https://cwe.mitre.org/data/definitions/89.html Solid source Documentation, read in large part.
- MITRE (n.d.d). CWE-79: Improper neutralization of input during web page generation. Common Weakness Enumeration. https://cwe.mitre.org/data/definitions/79.html Solid source Documentation, read in large part.
- OWASP Foundation (2017). 2017 Top 10. OWASP Top Ten 2017. https://owasp.github.io/www-project-top-ten/2017/Top_10 Solid source Documentation, read in large part.
- OWASP Foundation (2021). Introduction. OWASP Top 10:2021. https://top10.owasp.org/2021/A00_2021_Introduction/ Solid source Documentation, read in large part.
- OWASP Foundation (2025c). Introduction. OWASP Top 10:2025. https://top10.owasp.org/2025/0x00_2025-Introduction/ Medium trust Documentation, read in large part.
- OWASP Foundation (2025b). Establishing a Modern Application Security Program. OWASP Top 10:2025. https://top10.owasp.org/2025/0x03_2025-Establishing_a_Modern_Application_Security_Program/ Medium trust Read in large part.
- OWASP Foundation (2025d). Preface. OWASP Application Security Verification Standard 5.0.0. https://github.com/OWASP/ASVS/blob/v5.0.0/5.0/en/0x02-Preface.md Solid source Documentation, read in large part.
- OWASP Cheat Sheets Series Team (n.d.c). SQL injection prevention cheat sheet. OWASP Cheat Sheet Series. https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet Medium trust Read in large part.
- OWASP Cheat Sheets Series Team (n.d.b). Cross-site request forgery prevention cheat sheet. OWASP Cheat Sheet Series. https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html Medium trust Read in large part.
- OWASP Foundation (n.d.). OWASP Application Security Verification Standard. OWASP Foundation. https://asvs.owasp.org/ Solid source Documentation, read in large part.
- OWASP Cheat Sheets Series Team (n.d.a). Cross site scripting prevention cheat sheet. OWASP Cheat Sheet Series. https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html Medium trust Documentation, read in large part.
- Qadir, S., Waheed, E., Khanum, A., & Jehan, S. (2025). Comparative evaluation of approaches & tools for effective security testing of Web applications. PeerJ Computer Science, 11, e2821. https://pubmed.ncbi.nlm.nih.gov/40567702/ Solid source Peer-reviewed, abstract only.
- Roth, S., Barron, T., Calzavara, S., Nikiforakis, N., & Stock, B. (2020). Complex Security Policy? A Longitudinal Analysis of Deployed Content Security Policies. Network and Distributed Systems Security (NDSS) Symposium 2020. https://www.ndss-symposium.org/wp-content/uploads/2020/02/23046-paper.pdf Solid source Peer-reviewed, read in large part.
- Scholte, T., Balzarotti, D., & Kirda, E. (2012). Have things changed now? An empirical study on input validation vulnerabilities in web applications. Computers & Security, 31(3), 344–356. https://seclab.nu/static/publications/cs2012input.pdf Solid source Peer-reviewed, read in large part.
- Sridhar, K., & Ng, M. (2021). Hacking for good: Leveraging HackerOne data to develop an economic model of Bug Bounties. Journal of Cybersecurity, 7(1), tyab007. https://sites.wp.odu.edu/brandonjohnson022/wp-content/uploads/sites/36656/2024/11/tyab007.pdf Solid source Peer-reviewed, read in large part.
- Stock, B., Johns, M., Steffens, M., & Backes, M. (2017). How the Web Tangled Itself: Uncovering the History of Client-Side Web (In)Security. 26th USENIX Security Symposium. https://www.usenix.org/system/files/conference/usenixsecurity17/sec17-stock.pdf Solid source Peer-reviewed, read in large part.
- Vanderlinden, V., & Franken, G. (2026). Security. The 2025 Web Almanac by HTTP Archive. https://almanac.httparchive.org/en/2025/security Solid source Read in large part.
- Weichselbaum, L., Spagnuolo, M., Lekies, S., & Janc, A. (2016). CSP Is Dead, Long Live CSP! On the Insecurity of Whitelists and the Future of Content Security Policy. Proceedings of the 23rd ACM Conference on Computer and Communications Security. https://storage.googleapis.com/gweb-research2023-media/pubtools/pdf/45542.pdf Medium trust Peer-reviewed, read in large part.
- Weinberger, J., Saxena, P., Akhawe, D., Finifter, M., Shin, R., & Song, D. (2011b). An Empirical Analysis of XSS Sanitization in Web Application Frameworks. EECS Department, University of California, Berkeley Technical Report UCB/EECS-2011-11. https://www2.eecs.berkeley.edu/Pubs/TechRpts/2011/Archive/EECS-2011-11.pdf Medium trust Read in large part.
- West, M., & Sartori, A. (2026). Content Security Policy Level 3. W3C Working Draft. https://www.w3.org/TR/2026/WD-CSP3-20261027/ Solid source Documentation, read in large part.
- WHATWG (2026a). Fetch. WHATWG Living Standard. https://fetch.spec.whatwg.org/#http-cors-protocol Solid source Documentation, read in large part.
- WHATWG (2026b). HTML. WHATWG Living Standard. https://html.spec.whatwg.org/multipage/browsers.html#origins Solid source Documentation, read in large part.