CVE-2024-29896:
Content-Security-Policy header generation in middleware could be compromised by malicious injections
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.31816%
CWE
Published
3/29/2024
Updated
9/12/2024
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
@kindspells/astro-shield | npm | = 1.2.0 | 1.3.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from how external resources were handled in SSR content processing. The function updateDynamicPageSriHashes()
in src/core.mjs
previously: 1. Automatically fetched and generated SRI hashes for ANY external resource URL found in content 2. Lacked validation against an allow-list for cross-origin resources 3. Directly modified CSP headers based on these uncontrolled hashes. The commit diff shows critical changes where external resource processing was modified to require explicit allow-listing, and removed automatic fetching of arbitrary URLs. This function was the primary entry point for processing user-influenced content into security headers, making it the core vulnerable component.