CWEweakness

CWE-87 Improper Neutralization of Alternate XSS Syntax

Official page ↗
Abstraction
Variant
Structure
Simple
Status
Draft
Languages
Not Language-Specific
CWE version
5.0

Description

The product does not neutralize or incorrectly neutralizes user-controlled input for alternate script syntax.

Common consequences

• Confidentiality, Integrity, Availability: Read Application Data, Execute Unauthorized Code or Commands

Potential mitigations

• [Implementation] Resolve all input to absolute or canonical representations before processing. • [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-2002-0738: XSS using "&={script}".

Related

Attack pattern · CAPEC (1)

  • CAPEC-199 XSS Using Alternate Syntax attack pattern

Observed example · CVE (1)

  • CVE-2002-0738 MHonArc 2.5.2 and earlier does not properly filter Javascript from archived e-mail messages, which could allow remote attackers to execute… vulnerability

Child of · CWE (1)

  • CWE-79 Improper Neutralization of Input During Web Page Generation weakness

Referenced by CAPEC · weakness (1)

  • CAPEC-199 XSS Using Alternate Syntax attack pattern

Referenced by CVE · weakness (57)

  • CVE-2026-85293 InvoicePlane is a self-hosted open source application for managing invoices, clients, and payments. vulnerability
  • CVE-2026-79946 Dell SCG 5.0 Appliance versions prior to 5.36.00.16 and Dell SCG 5.0 Application versions prior to 5.36.00.00, contains an Improper… vulnerability
  • CVE-2026-54002 Kirby is an open-source content management system. vulnerability
  • CVE-2026-55661 Tina is a headless content management system. vulnerability
  • CVE-2026-55237 AutoGPT is a workflow automation platform for creating, deploying, and managing continuous artificial intelligence agents. vulnerability
  • CVE-2026-25688 Improper Neutralization of Alternate XSS Syntax vulnerability in Apache Answer. vulnerability
  • CVE-2026-46492 md-fileserver allows for local viewing of markdown files in a browser. vulnerability
  • CVE-2026-42458 Magento Long Term Support (LTS) is an unofficial, community-driven project provides an alternative to the Magento Community Edition… vulnerability
  • CVE-2026-45314 Open WebUI is a self-hosted artificial intelligence platform designed to operate entirely offline. vulnerability
  • CVE-2026-42235 n8n is an open source workflow automation platform. vulnerability
  • CVE-2026-40321 DNN (formerly DotNetNuke) is an open-source web content management platform (CMS) in the Microsoft ecosystem. vulnerability
  • CVE-2025-14732 The Elementor Website Builder – More Than Just a Page Builder plugin for WordPress is vulnerable to Stored Cross-Site Scripting via several… vulnerability
  • CVE-2026-22711 Improper neutralization of alternate XSS syntax vulnerability in The Wikimedia Foundation Mediawiki - Wikilove Extension allows Cross-Site… vulnerability
  • CVE-2026-35534 ChurchCRM is an open-source church management system. vulnerability
  • CVE-2026-33510 Homarr is an open-source dashboard. vulnerability
  • CVE-2026-34598 YesWiki is a wiki system written in PHP. vulnerability
  • CVE-2026-33506 Ory Polis, formerly known as BoxyHQ Jackson, bridges or proxies a SAML login flow to OAuth 2.0 or OpenID Connect. vulnerability
  • CVE-2025-52563 Chamilo is a learning management system. vulnerability
  • CVE-2026-27120 Leafkit is a templating language with Swift-inspired syntax. vulnerability
  • CVE-2025-65961 Contao is an Open Source CMS. vulnerability
  • CVE-2025-48076 Galette is a membership management web application for non profit organizations. vulnerability
  • CVE-2025-62414 Bagisto is an open source laravel eCommerce platform. vulnerability
  • CVE-2025-62415 Bagisto is an open source laravel eCommerce platform. vulnerability
  • CVE-2025-62418 Bagisto is an open source laravel eCommerce platform. vulnerability
  • CVE-2025-8561 The Ova Advent plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the plugin's shortcodes in all versions up to, and… vulnerability
  • CVE-2025-55291 Shaarli is a minimalist bookmark manager and link sharing service. vulnerability
  • CVE-2025-54369 Node-SAML is a SAML library not dependent on any frameworks that runs in Node. vulnerability
  • CVE-2025-48992 Group-Office is an enterprise customer relationship management and groupware tool. vulnerability
  • CVE-2025-49137 HAX CMS PHP allows users to manage their microsite universe with a PHP backend. vulnerability
  • CVE-2025-48494 Gokapi is a self-hosted file sharing server with automatic expiration and encryption support. vulnerability
Show all 57 ›

Referenced by OWASP · mapped cwe (1)