Weakness · High
CWE-644: Improper Neutralization of HTTP Headers for Scripting Syntax
What it is
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.
- Severity (our rating)
- High
- Likelihood of exploit
- High
- Introduced during
- Implementation
- Exploited in the wild
- No CVE in CISA's catalog
In more detail
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.
What an attacker can do
- Execute Unauthorized Code or Commands (Integrity, Confidentiality, Availability)
- Read Application Data (Confidentiality)
How to prevent it
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.
- Disable script execution functionality in the clients' browser.
H2 Security
Found it in your code?
We review where it appears, fix it with your team, and check it was not already used against you.
Talk to our teamT Academy
Stop writing it in the first place
Learn to build software and systems without weaknesses like this one, with practice on real hosts in your browser, every objective checked on the machine.
Start freeSource: MITRE Common Weakness Enumeration, CWE version 4.19.1. CWE is a trademark of The MITRE Corporation.