CVE-2024-29896 in Astro-Shieldinfo

Summary

by MITRE • 03/28/2024

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.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 03/28/2024

The vulnerability identified as CVE-2024-29896 affects Astro-Shield, a library designed to compute subresource integrity hashes for javascript and css resources. This library operates within server-side rendering environments where content is dynamically generated and served to users. The core issue emerges when automated content security policy header generation is enabled for server-side rendered content, creating a critical security gap in the application's defense mechanisms. When web applications serve content that can be partially controlled by external users, the library's automatic CSP header generation feature becomes susceptible to manipulation.

The technical flaw stems from the library's improper handling of user-controllable input during CSP header generation. Specifically, the system fails to adequately validate or sanitize content that originates from external sources, allowing malicious actors to inject resources that bypass the intended security controls. This vulnerability manifests when the library's automatic CSP generation process inadvertently "allow-lists" malicious injected resources including inlined javascript code or references to external malicious scripts. The flaw represents a classic case of insecure input handling where user-provided content is not properly filtered before being incorporated into security policies.

The operational impact of this vulnerability is significant as it allows attackers to bypass content security policy protections that are meant to prevent unauthorized script execution and resource loading. An attacker could inject malicious javascript code or reference external malicious scripts that would be permitted by the compromised CSP headers. This creates a potential vector for cross-site scripting attacks, code injection, and other malicious activities that would otherwise be blocked by proper CSP enforcement. The vulnerability essentially undermines the security assurances provided by the subresource integrity mechanisms and content security policies that the library is designed to enforce.

This vulnerability aligns with CWE-20, which addresses improper input validation, and relates to ATT&CK technique T1211 for lateral movement through malicious code injection. The issue also connects to CWE-116 regarding improper encoding or escaping of output and CWE-352 for cross-site request forgery. The attack surface expands when considering that this vulnerability affects server-side rendered applications where user input is processed and then used to generate security headers. The fix implemented in version 1.3.0 addresses the root cause by improving input validation and sanitization processes during CSP header generation, ensuring that only properly validated resources are included in the security policies.

Organizations using Astro-Shield should immediately upgrade to version 1.3.0 or later to mitigate this vulnerability. Additionally, security teams should review their existing CSP policies to ensure proper validation of all content sources and implement additional monitoring for suspicious resource loading patterns. The fix demonstrates the importance of proper input sanitization in security-critical libraries and highlights the need for comprehensive testing of automated security features against malicious input scenarios.

Responsible

GitHub, Inc.

Reservation

03/21/2024

Disclosure

03/28/2024

Moderation

accepted

CPE

ready

EPSS

0.00591

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!