CVE-2024-29896
JSON

7.5high

Astro-Shield's Content-Security-Policy header generation in middleware could be compromised by malicious injections

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
0.59% (higher than 49% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-w387-5qqw-7g8m

Description

Astro-Shield is a library to compute the subresource integrity hashes for your JS scripts and CSS stylesheets. When automated CSP headers generation for SSR content is enabled and the web application serves content that can be partially controlled by external users, then it is possible that the CSP headers generation feature might be "allow-listing" malicious injected resources like inlined JS, or references to external malicious scripts. The fix is available in version 1.3.0.

Affected

Product or packageVersionsReported by
KindSpells astro-shield= 1.2.0, from 1.2.0 before 1.3.0, 1.2.0CVE List, NVD
@kindspells/astro-shield (npm)from 1.2.0 before 1.3.0GitHub Advisory Database

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

Classification

CWE-74

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

Astro-Shield is a library to compute the subresource integrity hashes for your JS scripts and CSS stylesheets. When automated CSP headers generation for SSR content is enabled and the web application serves content that can be partially controlled by external users, then it is possible that the CSP headers generation feature might be "allow-listing" malicious injected resources like inlined JS, or references to external malicious scripts. The fix is available in version 1.3.0.

GitHub Advisory Database
Impact

When the following conditions are met:

  • Automated CSP headers generation for SSR content is enabled
  • The web application serves content that can be partially controlled by external users

Then it is possible that the CSP headers generation feature might be "allow-listing" malicious injected resources like inlined JS, or references to external malicious scripts.

Patches

Available in version 1.3.0 .

Workarounds
  • Do not enable CSP headers generation.
  • Use it only for dynamically generated content that cannot be controlled by external users in any way.
References

Are there any links users can visit to find out more?

NVD (es)

Astro-Shield es una librería para calcular los hashes de integridad de los subrecursos para sus scripts JS y hojas de estilo CSS. Cuando la generación automatizada de encabezados CSP para contenido SSR está habilitada y la aplicación web ofrece contenido que puede ser controlado parcialmente por usuarios externos, entonces es posible que la función de generación de encabezados CSP pueda "listar permitidos" recursos maliciosos inyectados como JS en línea o referencias a scripts maliciosos externos. La solución está disponible en la versión 1.3.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-29896 changed 2024-08-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-w387-5qqw-7g8m changed 2026-09-10CC-BY-4.0
NVDCVE-2024-29896 changed 2026-06-17Public domain