The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
There are many variants of cross-site scripting, characterized by a variety of terms or involving different attack topologies. However, they all indicate the same fundamental weakness: improper neutralization of dangerous input between the adversary and a victim.
Threat Mapped score: 0.0
Industry: Finiancial
Threat priority: Unclassified
CVE: CVE-2021-25926
Python Library Manager did not sufficiently neutralize a user-supplied search term, allowing reflected XSS.
CVE: CVE-2021-25963
Python-based e-commerce platform did not escape returned content on error pages, allowing for reflected Cross-Site Scripting attacks.
CVE: CVE-2021-1879 — KEV
Universal XSS in mobile operating system, as exploited in the wild per CISA KEV.
CVE: CVE-2020-3580 — KEV
Chain: improper input validation (CWE-20) in firewall product leads to XSS (CWE-79), as exploited in the wild per CISA KEV.
CVE: CVE-2014-8958
Admin GUI allows XSS through cookie.
CVE: CVE-2017-9764
Web stats program allows XSS through crafted HTTP header.
CVE: CVE-2014-5198
Web log analysis product allows XSS through crafted HTTP Referer header.
CVE: CVE-2008-5080
Chain: protection mechanism failure allows XSS
CVE: CVE-2006-4308
Chain: incomplete denylist (CWE-184) only checks "javascript:" tag, allowing XSS (CWE-79) using other tags
CVE: CVE-2007-5727
Chain: incomplete denylist (CWE-184) only removes SCRIPT tags, enabling XSS (CWE-79)
CVE: CVE-2008-5770
Reflected XSS using the PATH_INFO in a URL
CVE: CVE-2008-4730
Reflected XSS not properly handled when generating an error message
CVE: CVE-2008-5734
Reflected XSS sent through email message.
CVE: CVE-2008-0971
Stored XSS in a security product.
CVE: CVE-2008-5249
Stored XSS using a wiki page.
CVE: CVE-2006-3568
Stored XSS in a guestbook application.
CVE: CVE-2006-3211
Stored XSS in a guestbook application using a javascript: URI in a bbcode img tag.
CVE: CVE-2006-3295
Chain: library file is not protected against a direct request (CWE-425), leading to reflected XSS (CWE-79).
N/A
Phase | Note |
---|---|
Implementation | REALIZATION: This weakness is caused during implementation of an architectural security tactic. |
Intro: The following code displays a welcome message on a web page based on the HTTP GET username parameter (covers a Reflected XSS (Type 1) scenario).
Body: Because the parameter can be arbitrary, the url of the page could be modified so $username contains scripting syntax, such as
$username = $_GET['username']; echo '<div class="header"> Welcome, ' . $username . '</div>';
Intro: The following code displays a Reflected XSS (Type 1) scenario.
Body: The following JSP code segment reads an employee ID, eid, from an HTTP request and displays it to the user.
<% String eid = request.getParameter("eid"); %> ... Employee ID: <%= eid %>
Intro: The following code displays a Stored XSS (Type 2) scenario.
Body: The following JSP code segment queries a database for an employee with a given ID and prints the corresponding employee's name.
<%Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("select * from emp where id="+eid); if (rs != null) { rs.next(); String name = rs.getString("name"); }%> Employee Name: <%= name %>
Intro: The following code consists of two separate pages in a web application, one devoted to creating user accounts and another devoted to listing active users currently logged in. It also displays a Stored XSS (Type 2) scenario.
Body: CreateUser.php
$username = mysql_real_escape_string($username); $fullName = mysql_real_escape_string($fullName); $query = sprintf('Insert Into users (username,password) Values ("%s","%s","%s")', $username, crypt($password),$fullName) ; mysql_query($query); /.../
Intro: The following code is a simplistic message board that saves messages in HTML format and appends them to a file. When a new user arrives in the room, it makes an announcement:
Body: An attacker may be able to perform an HTML injection (Type 2 XSS) attack by setting a cookie to a value like:
$name = $_COOKIE["myname"]; $announceStr = "$name just logged in."; //save HTML-formatted message to file; implementation details are irrelevant for this example. saveMessage($announceStr);