Description
secure_headers manages application of security headers with many safe defaults. Prior to 7.3.0, secure_headers builds the Content-Security-Policy value by stitching directives with ; separators, and build_sandbox_list_directive, build_media_type_list_directive, and build_report_to_directive interpolate caller-supplied strings without scrubbing ;, \r, or \n. When untrusted input reaches SecureHeaders.override_content_security_policy_directives or append APIs for :sandbox, :plugin_types, or :report_to, an attacker can inject a CSP directive such as script-src 'unsafe-inline' * before the legitimate script-src, enabling XSS reachability through these sinks or CSP report exfiltration. This issue is fixed in version 7.3.0.
Published: 2026-07-17
Score: 4.7 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

secure_headers builds the CSP header by concatenating directive strings. Prior to 7.3.0, the functions that generate sandbox, plugin_types, and report_to directives interpolate caller‑supplied input without sanitizing characters such as ';', carriage returns or newlines. Because of this, an attacker can inject an entire new CSP rule, for example a script-src 'unsafe-inline' *, positioned before the legitimate rule. This injected rule effectively bypasses the intended policy, allowing cross‑site scripting or exfiltration through CSP report URLs. The vulnerability is fixed in secure_headers 7.3.0.

Affected Systems

The product affected is the secure_headers Ruby gem distributed by GitHub. All versions before 7.3.0 are vulnerable. Version 7.3.0 and later contain the fix that sanitizes directive strings.

Risk and Exploitability

The CVSS score of 4.7 indicates moderate severity. The EPSS score is below 1%, implying a low likelihood of exploitation. The vulnerability is not listed in CISA’s KEV catalog. Exploitation requires the threat actor to provide crafted input to SecureHeaders.override_content_security_policy_directives or to the append methods for the sandbox, plugin_types, or report_to directives. Based on the description, it is inferred that the attack vector would involve remote delivery of malicious data to the application code that calls these APIs, though the vulnerability can only be leveraged when such data propagates to the gem. Once exploited, the attacker can execute arbitrary scripts within the context of the protected application or exfiltrate data via CSP report mechanisms.

Generated by OpenCVE AI on July 30, 2026 at 23:30 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the secure_headers gem to version 7.3.0 or newer.
  • Validate or sanitize any data passed to SecureHeaders.override_content_security_policy_directives or the append APIs, removing characters such as ';', '\r', and '\n'.
  • Review the application configuration to ensure that only trusted values are supplied to CSP directive APIs, or hard‑code CSP rules where dynamic input is unnecessary.

Generated by OpenCVE AI on July 30, 2026 at 23:30 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-rqq5-2gf9-4w4q Secure Headers: CSP directive injection via sandbox, plugin_types, and report_to when given untrusted input
History

Thu, 23 Jul 2026 21:45:00 +0000

Type Values Removed Values Added
First Time appeared Github
Github secure Headers
Vendors & Products Github
Github secure Headers

Mon, 20 Jul 2026 18:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Fri, 17 Jul 2026 20:45:00 +0000

Type Values Removed Values Added
Description secure_headers manages application of security headers with many safe defaults. Prior to 7.3.0, secure_headers builds the Content-Security-Policy value by stitching directives with ; separators, and build_sandbox_list_directive, build_media_type_list_directive, and build_report_to_directive interpolate caller-supplied strings without scrubbing ;, \r, or \n. When untrusted input reaches SecureHeaders.override_content_security_policy_directives or append APIs for :sandbox, :plugin_types, or :report_to, an attacker can inject a CSP directive such as script-src 'unsafe-inline' * before the legitimate script-src, enabling XSS reachability through these sinks or CSP report exfiltration. This issue is fixed in version 7.3.0.
Title secure_headers: CSP directive injection via sandbox, plugin_types, and report_to when given untrusted input
Weaknesses CWE-113
CWE-79
References
Metrics cvssV3_1

{'score': 4.7, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N'}


Subscriptions

Github Secure Headers
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-20T17:45:49.353Z

Reserved: 2026-06-11T21:46:52.380Z

Link: CVE-2026-54163

cve-icon Vulnrichment

Updated: 2026-07-20T17:45:25.337Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-30T23:45:05Z

Weaknesses
  • CWE-113

    Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting')

  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')