CVE-2024-30250: In Astro-Shield, setting a correct `integrity` attribute to injected code allows to bypass the allow-lists
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.25811%
CWE
Published
4/1/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.2 | 1.3.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability arises from improper validation of SRI hashes for injected resources. The updateDynamicPageSriHashes function is directly responsible for processing dynamic content and adding hashes to the CSP header. Pre-patch, it allowed non-allow-listed resources with valid integrity attributes to be included in the CSP, bypassing allow-lists. The scanAllowLists function's lack of optional chaining (patched to use ?? []) suggests it might fail to process allow-lists correctly, but this is a secondary factor. The primary vulnerability lies in the dynamic processing logic trusting unvalidated integrity hashes.