CWEweakness
CWE-83 Improper Neutralization of Script in Attributes in a Web Page
- Abstraction
- Variant
- Structure
- Simple
- Status
- Draft
- Languages
- Not Language-Specific
- CWE version
- 5.0
Description
The product does not neutralize or incorrectly neutralizes "javascript:" or other URIs from dangerous attributes within tags, such as onmouseover, onload, onerror, or style.
Common consequences
• Confidentiality, Integrity, Availability: Read Application Data, Execute Unauthorized Code or Commands
Potential mitigations
• [Implementation] Carefully check each input parameter against a rigorous positive specification (allowlist) defining the specific characters and format allowed. All input should be neutralized, not just parameters that the user is supposed to specify, but all data in the request, including tag attributes, hidden fields, cookies, headers, the URL itself, and so forth. A common mistake that leads to continuing XSS vulnerabilities is to validate only fields that are expected to be redisplayed by the site. We often encounter data from the request that is reflected by the application server or the application that the development team did not anticipate. Also, a field that is not currently reflected may be used by a future developer. Therefore, validating ALL parts of the HTTP request is recommended.
• [Implementation] Use and specify an output encoding that can be handled by the downstream component that is reading the output. Common encodings include ISO-8859-1, UTF-7, and UTF-8. When an encoding is not specified, a downstream component may choose a different encoding, either by assuming a default encoding or automatically inferring which encoding is being used, which can be erroneous. When the encodings are inconsistent, the downstream component might treat some character or byte sequences as special, even if they are not special in the original encoding. Attackers might then be able to exploit this discrepancy and conduct injection attacks; they even might be able to bypass protection mechanisms that assume the original encoding is also being used by the downstream component.
The problem of inconsistent output encodings often arises in web pages. If an encoding is not specified in an HTTP header, web browsers often guess about which encoding is being used. This can open up the browser to subtle XSS attacks.
• [Implementation] With Struts, write all data from form beans with the bean's filter attribute set to true.
• [Implementation] To help mitigate XSS attacks against the user's session cookie, set the session cookie to be HttpOnly. In browsers that support the HttpOnly feature (such as more recent versions of Internet Explorer and Firefox), this attribute can prevent the user's session cookie from being accessible to malicious client-side scripts that use document.cookie. This is not a complete solution, since HttpOnly is not supported by all browsers. More importantly, XmlHttpRequest and other powerful browser technologies provide read access to HTTP headers, including the Set-Cookie header in which the HttpOnly flag is set.
Detection methods
• Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Observed examples
• CVE-2001-0520: Bypass filtering of SCRIPT tags using onload in BODY, href in A, BUTTON, INPUT, and others.
• CVE-2002-1493: guestbook XSS in STYLE or IMG SRC attributes.
• CVE-2002-1965: Javascript in onerror attribute of IMG tag.
• CVE-2002-1495: XSS in web-based email product via onmouseover event.
• CVE-2002-1681: XSS via script in <P> tag.
• CVE-2004-1935: Onload, onmouseover, and other events in an e-mail attachment.
• CVE-2005-0945: Onmouseover and onload events in img, link, and mail tags.
• CVE-2003-1136: Javascript in onmouseover attribute in e-mail address or URL.
Related
Attack pattern · CAPEC (3)
Observed example · CVE (8)
- CVE-2005-0945 Cross-site scripting (XSS) vulnerability in ACS Blog 1.1.1 allows remote attackers to inject arbitrary web script or HTML via onmouseover… vulnerability
- CVE-2004-1935 Cross-site scripting (XSS) vulnerability in SCT Campus Pipeline allows remote attackers to inject arbitrary web script or HTML via onload,… vulnerability
- CVE-2003-1136 Cross-site scripting (XSS) vulnerability in Chi Kien Uong Guestbook 1.51 allows remote attackers to inject arbitrary web script or HTML via… vulnerability
- CVE-2002-1493 Cross-site scripting (XSS) vulnerability in Lycos HTMLGear guestbook allows remote attackers to inject arbitrary script via (1) STYLE… vulnerability
- CVE-2002-1495 Cross-site scripting (XSS) vulnerability in JAWmail 1.0-rc1 allows remote attackers to insert arbitrary script or HTML via (1) attached… vulnerability
- CVE-2002-1681 Cross-site scripting (XSS) vulnerability in Slashcode CVS releases June 17 through July 1 2002 allows remote attackers to execute arbitrary… vulnerability
- CVE-2002-1965 Cross-site scripting (XSS) vulnerability in Errors.gsl in Imatix Xitami 2.5b4 and 2.5b5 allows remote attackers to inject arbitrary web… vulnerability
- CVE-2001-0520 Aladdin eSafe Gateway versions 3.0 and earlier allows a remote attacker to circumvent filtering of SCRIPT tags by embedding the scripts… vulnerability
Child of · CWE (1)
- CWE-79 Improper Neutralization of Input During Web Page Generation weakness
Referenced by CAPEC · weakness (3)
Referenced by CVE · weakness (35)
- CVE-2026-112356 GFI KerioConnect (Kerio Connect) before 10.0.9 Patch 2 contains a cross-site scripting vulnerability in the Webmail component that allows a… vulnerability
- CVE-2026-112353 GFI KerioConnect (Kerio Connect) before 10.0.8 Patch 2 contains a stored cross-site scripting vulnerability in the Webmail component that… vulnerability
- CVE-2026-61791 OCO-Server is a self-hosted endpoint management application for computer inventory, software deployment, and mobile device management. vulnerability
- CVE-2026-58391 OPNsense is a FreeBSD based firewall and routing platform. vulnerability
- CVE-2026-108260 Tina is a headless content management system. vulnerability
- CVE-2026-91127 File Viewer is a browser-native viewer for Office, PDF, CAD, archive, and other files in private and internal web applications. vulnerability
- CVE-2026-45118 MyBB is free and open source forum software. vulnerability
- CVE-2026-45733 Trilium Notes is a cross-platform, hierarchical note taking application focused on building large personal knowledge bases. vulnerability
- CVE-2026-15920 An issue was discovered in Django 5.2 before 5.2.17 and 6.0 before 6.0.8. vulnerability
- CVE-2026-62324 Jodit Editor is a WYSIWYG editor with a built-in file browser & image editor. vulnerability
- CVE-2026-59727 Astro is a web framework for content-driven websites. vulnerability
- CVE-2026-49276 Kirby is an open-source content management system. vulnerability
- CVE-2026-58263 Jodit Editor is a WYSIWYG editor with a built-in file browser & image editor. vulnerability
- CVE-2026-48591 Improper Neutralization of Script in Attributes in a Web Page vulnerability in pragdave earmark allows stored cross-site scripting via… vulnerability
- CVE-2026-53841 OpenClaw before 2026.5.12 contains a cross-site scripting vulnerability in exported session HTML that preserves unsafe javascript: and… vulnerability
- CVE-2026-45669 Nuxt is an open-source web development framework for Vue.js. vulnerability
- CVE-2026-53722 Nuxt is an open-source web development framework for Vue.js. vulnerability
- CVE-2026-8245 Concrete CMS 9.5.0 and below is vulnerable to Reflected XSS in Legacy Pagination via HTML attribute injection. vulnerability
- CVE-2026-22849 Saleor is an e-commerce platform. vulnerability
- CVE-2026-23516 CVAT is an open source interactive video and image annotation tool for computer vision. vulnerability
- CVE-2025-67163 A stored cross-site scripting (XSS) vulnerability in Simple Machines Forum v2.1.6 allows attackers to execute arbitrary web scripts or HTML… vulnerability
- CVE-2025-11682 Stored cross-site scripting (XSS) vulnerability in the LMT Dashboard of the Perx Customer Engagement & Loyalty Platform allows an… vulnerability
- CVE-2025-4615 An improper input neutralization vulnerability in the management web interface of the Palo Alto Networks PAN-OS® software enables an… vulnerability
- CVE-2025-58746 The Volkov Labs Business Links panel for Grafana provides an interface to navigate using external links, internal dashboards, time pickers,… vulnerability
- CVE-2025-0137 An improper input neutralization vulnerability in the management web interface of the Palo Alto Networks PAN-OS® software enables a… vulnerability
- CVE-2025-0125 An improper input neutralization vulnerability in the management web interface of the Palo Alto Networks PAN-OS® software enables a… vulnerability
- CVE-2024-9103 Improper Neutralization of Script in Attributes in a Web Page vulnerability in Forcepoint Email Security (Blocked Messages module) allows… vulnerability
- CVE-2025-27145 copyparty, a portable file server, has a DOM-based cross-site scripting vulnerability in versions prior to 1.16.15. vulnerability
- CVE-2024-52595 lxml_html_clean is a project for HTML cleaning functionalities copied from `lxml.html.clean`. vulnerability
- CVE-2024-26283 An attacker could have executed unauthorized scripts on top origin sites using a JavaScript URI when opening an external URL with a custom… vulnerability
Referenced by CWE · child of (1)
- CWE-82 Improper Neutralization of Script in Attributes of IMG Tags in a Web Page weakness