CWE-87: Improper Neutralization of Alternate XSS Syntax

Export to Word

Description

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

Extended Description

N/A


ThreatScore

Threat Mapped score: 0.0

Industry: Finiancial

Threat priority: Unclassified


Observed Examples (CVEs)

Related Attack Patterns (CAPEC)


Attack TTPs

N/A

Modes of Introduction

Phase Note
Implementation N/A

Common Consequences

Potential Mitigations

Applicable Platforms


Demonstrative Examples

Intro: In the following example, an XSS neutralization method intends to replace script tags in user-supplied input with a safe equivalent:

Body: The code only works when the "script" tag is in all lower-case, forming an incomplete denylist (CWE-184). Equivalent tags such as "SCRIPT" or "ScRiPt" will not be neutralized by this method, allowing an XSS attack.

public String preventXSS(String input, String mask) { return input.replaceAll("script", mask); }

Notes

← Back to CWE list