Improper Sanitization of HTTP Headers for Scripting Syntax |
Weakness ID: 644 (Weakness Variant) | Status: Incomplete |
Description Summary
Extended Description
If an application fails to filter or escape user controlled data being placed in the header of an HTTP response coming from the server, the header may contain a script that will get executed in the client's browser context, potentially resulting in a cross site scripting vulnerability or possibly an HTTP response splitting attack. It is important to carefully control data that is being placed both in HTTP response header and in the HTTP response body to ensure that no scripting syntax is present, taking various encodings into account.
Example 1
In the following Java example, user-controlled data is added to the HTTP headers and returned to the client. Given that the data is not subject to sanitization, a malicious user may be able to inject dangerous scripting tags that will lead to script execution in the client browser.
Reference | Description |
---|---|
CVE-2006-3918 | Web server does not sanitize the Expect header from an HTTP request when it is reflected back in an error message, allowing a Flash SWF file to perform XSS attacks. |
Perform output validation in order to filter/escape/encode unsafe data that is being passed from the server in an HTTP response header. |
Disable script execution functionality in the clients' browser. |
Nature | Type | ID | Name | View(s) this relationship pertains to![]() |
---|---|---|---|---|
ChildOf | ![]() | 116 | Improper Encoding or Escaping of Output | Development Concepts (primary)699 Research Concepts (primary)1000 |
ChildOf | ![]() | 442 | Web Problems | Development Concepts699 |
ChildOf | ![]() | 725 | OWASP Top Ten 2004 Category A4 - Cross-Site Scripting (XSS) Flaws | Weaknesses in OWASP Top Ten (2004) (primary)711 |
Submissions | ||||
---|---|---|---|---|
Submission Date | Submitter | Organization | Source | |
2008-01-30 | Evgeny Lebanidze | Cigital | External Submission | |
Modifications | ||||
Modification Date | Modifier | Organization | Source | |
2008-07-01 | Sean Eidemiller | Cigital | External | |
added/updated demonstrative examples | ||||
2008-09-08 | CWE Content Team | MITRE | Internal | |
updated Common Consequences, Relationships, Observed Example | ||||
2008-10-14 | CWE Content Team | MITRE | Internal | |
updated Description, Name, Observed Examples, Relationships | ||||
2009-03-10 | CWE Content Team | MITRE | Internal | |
updated Relationships | ||||
2009-05-27 | CWE Content Team | MITRE | Internal | |
updated Description, Name | ||||
2009-10-29 | CWE Content Team | MITRE | Internal | |
updated Common Consequences | ||||
Previous Entry Names | ||||
Change Date | Previous Entry Name | |||
2008-10-14 | Insufficient Filtering of HTTP Headers for Scripting Syntax | |||
2009-05-27 | Insufficient Sanitization of HTTP Headers for Scripting Syntax | |||