Skip to content

Security Test: Content-Type header

Description

Default Severity:

When a response is sent without a correctly set Content-Type header, browsers might guess the file type incorrectly. This misinterpretation can let attackers trick the browser into treating data as a different type than intended—sometimes even as executable code. The risk is that if harmful content is misclassified, it could lead to issues like cross-site scripting attacks or other forms of code injection. Developers often overlook setting or validating this header, relying on the browser to make the correct guess, which can create security gaps and unintended behavior if an attacker manipulates the content.

Configuration

Identifier: protocol/header_content_type

Examples

All configuration available:

checks:
  protocol/header_content_type:
    skip: false # default

Compliance and Standards

Standard Value
OWASP API Top 10 API7:2023
OWASP LLM Top 10 LLM02:2023
PCI DSS 6.5.10
GDPR Article-32
SOC2 CC1
PSD2 Article-95
ISO 27001 A.14.2
NIST SP800-53
FedRAMP AC-4
CWE 16
CVSS Vector AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
CVSS Score 4.3