GitHub Advisoryadvisory · npm

GHSA-c4gr-q97g-ppwc In Astro-Shield, setting a correct `integrity` attribute to injected code allows to bypass the allow-lists

HIGH Published 2024-04-01 Modified 2024-09-12 Official page ↗
Aliases
CVE-2024-30250
Ecosystem
npm
Packages
@kindspells/astro-shield
Severity
High
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Weaknesses
CWE-345
Reviewed
2024-04-01

Affected packages

• npm @kindspells/astro-shield: >= 1.2.0, < 1.3.2 → fixed in 1.3.2

Description

Impact Versions from 1.2.0 to 1.3.1 of Astro-Shield allow to bypass the allow-lists for cross-origin resources by introducing valid `integrity` attributes to the injected code. This implies that the injected SRI hash would be added to the generated CSP header, which would lead the browser to believe that the injected resource is legit. To exploit this vulnerability, the attacker needs to first inject code into the rendered pages by exploiting other not-related potential vulnerabilities. Patches Version 1.3.2 provides a patch. Workarounds • To not use the middleware functionality of Astro-Shield. • To use the middleware functionality of Astro-Shield ONLY for content that cannot be controlled in any way by external users. References _Are there any links users can visit to find out more?_

Related

Alias · CVE (1)

  • CVE-2024-30250 Astro-Shield is an integration to enhance website security with SubResource Integrity hashes, Content-Security-Policy headers, and other… vulnerability

Weakness · CWE (1)

  • CWE-345 Insufficient Verification of Data Authenticity weakness

References