Umbra Wiki weakness weakness/CWE-644
Back to wiki

CWE-644 — Improper Neutralization of HTTP Headers for Scripting Syntax

provenance: imported · CWE: CWE-644

CWE-644: Improper Neutralization of HTTP Headers for Scripting Syntax

MITRE CWE weakness

Kind Weakness
Abstraction Variant
Status Incomplete
Likelihood of exploit High

Description

The product does not neutralize or incorrectly neutralizes web scripting syntax in HTTP headers that can be used by web browser components that can process raw headers, such as Flash.

An attacker may be able to conduct cross-site scripting and other attacks against users who have these components enabled. If a product does not neutralize 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.

Common consequences

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

Mitigations

Architecture and Design — Perform output validation in order to filter/escape/encode unsafe data that is being passed from the server in an HTTP response header.

Architecture and Design — Disable script execution functionality in the clients' browser.

References

  • CWE page: https://cwe.mitre.org/data/definitions/644.html
  • CWE list: https://cwe.mitre.org/data/index.html