[NPM:GHSA-C4GR-Q97G-PPWC] In Astro-Shield, setting a correct `integrity` attribute to injected code allows to bypass the allow-lists

Severity High
Affected Packages 1
Fixed Packages 1
CVEs 1

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?

Package Affected Version
pkg:npm/%40kindspells/astro-shield >= 1.2.0, < 1.3.2
Package Fixed Version
pkg:npm/%40kindspells/astro-shield = 1.3.2
ID
NPM:GHSA-C4GR-Q97G-PPWC
Severity
high
URL
https://github.com/advisories/GHSA-c4gr-q97g-ppwc
Published
2024-04-01T20:33:53
(3 weeks ago)
Modified
2024-04-01T20:33:53
(3 weeks ago)
Rights
NPM Security Team
Type Package URL Namespace Name / Product Version Distribution / Platform Arch Patch / Fix
Affected pkg:npm/%40kindspells/astro-shield @kindspells astro-shield >= 1.2.0 < 1.3.2
Fixed pkg:npm/%40kindspells/astro-shield @kindspells astro-shield = 1.3.2
# CVE Description CVSS EPSS EPSS Trend (30 days) Affected Products Weaknesses Security Advisories Exploits PoC Pubblication Date Modification Date
# CVE Description CVSS EPSS EPSS Trend (30 days) Affected Products Weaknesses Security Advisories PoC Pubblication Date Modification Date
Loading...