Vulnerabilities in pkg:npm/@kindspells/astro-shield

PACKAGE
Advisory Identifier: GHSA-c4gr-q97g-ppwc
Advisory Summary

CVE-2024-30250 is a HIGH (CVSS 7.5) security vulnerability vulnerability (CWE-345: Insufficient Verification of Data Authenticity) affecting @kindspells/astro shield libraries in the npm ecosystem. The issue involves in astro-shield, setting a correct `integrity` attribute to injected code allows to bypass the allow-lists. Remediation is available by upgrading affected packages to version 1.3.2.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@kindspells/astro-shield

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@kindspells/astro-shield. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-c4gr-q97g-ppwc CVE-2024-30250 HIGH In Astro-Shield, setting a correct `integrity` attribute to injected code allows to bypass the allow-lists
GHSA-w387-5qqw-7g8m CVE-2024-29896 HIGH Content-Security-Policy header generation in middleware could be compromised by malicious injections

CVE-2024-30250 at a Glance

CVE Identifier CVE-2024-30250
GHSA Identifier GHSA-c4gr-q97g-ppwc
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-345: Insufficient Verification of Data Authenticity
Affected Product @kindspells/astro shield
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2024-30250

To remediate this vulnerability, upgrade all affected @kindspells/astro shield dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@kindspells/astro-shield fixed: 1.3.2
npm install @kindspells/astro-shield@1.3.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @kindspells/astro-shield

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2024-30250, inspect your project dependencies using npm:

npm ls @kindspells/astro-shield

Analyze the terminal output to locate any version of @kindspells/astro shield in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.2), your application is affected.

Note: The npm ls @kindspells/astro-shield command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-345: Insufficient Verification of Data Authenticity, where the product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data. In @kindspells/astro shield, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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](https://github.com/kindspells/astro-shield/releases/tag/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?_

CVE-2024-30250 Affected @kindspells/astro shield Versions

1 component(s)
Fixed Versions:
1.3.2
Product / Package Ecosystem Affected Versions Fixed Version
@kindspells/astro-shield
npm
≥ 1.2.0
< 1.3.2
1.3.2

References

Frequently Asked Questions

What is CVE-2024-30250?
CVE-2024-30250 is a security vulnerability in @kindspells/astro shield involving In Astro-Shield, setting a correct `integrity` attribute to injected code allows to bypass the allow-lists under CWE-345: Insufficient Verification of Data Authenticity.
Which @kindspells/astro shield versions are affected?
Affected versions include releases prior to 1.3.2 across affected packages: @kindspells/astro-shield.
What version fixes CVE-2024-30250?
Upgrading to 1.3.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @kindspells/astro-shield affected?
Yes, @kindspells/astro-shield is affected in releases prior to 1.3.2. Upgrade your dependency to 1.3.2 or later.
What is the CVSS score of CVE-2024-30250?
CVE-2024-30250 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2024-30250?
CVE-2024-30250 is classified under CWE-345: Insufficient Verification of Data Authenticity (The product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data.).
How can I check npm dependencies for CVE-2024-30250?
Run the dependency tree command: 'npm ls @kindspells/astro-shield'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-c4gr-q97g-ppwc",
  "modified" : "2024-09-12T13:52:45Z",
  "published" : "2024-04-01T20:33:53Z",
  "aliases" : [ "CVE-2024-30250" ],
  "summary" : "In Astro-Shield, setting a correct `integrity` attribute to injected code allows to bypass the allow-lists",
  "details" : "### Impact\n\nVersions 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.\n\nTo exploit this vulnerability, the attacker needs to first inject code into the rendered pages by exploiting other not-related potential vulnerabilities.\n\n### Patches\n\nVersion [1.3.2](https://github.com/kindspells/astro-shield/releases/tag/1.3.2) provides a patch.\n\n### Workarounds\n- To not use the middleware functionality of Astro-Shield.\n- To use the middleware functionality of Astro-Shield ONLY for content that cannot be controlled in any way by external users.\n\n### References\n_Are there any links users can visit to find out more?_\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@kindspells/astro-shield"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.0"
      }, {
        "fixed" : "1.3.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/kindspells/astro-shield/security/advisories/GHSA-c4gr-q97g-ppwc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-30250"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kindspells/astro-shield/commit/1221019306f501bf5fa9bcfb5a23a2321d34ba0a"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kindspells/astro-shield/commit/5ae8b8ef4f681d3a81431ee7e79d5dec545c6e1f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kindspells/astro-shield"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kindspells/astro-shield/releases/tag/1.3.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-345" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-01T20:33:53Z",
    "nvd_published_at" : "2024-04-04T15:15:39Z"
  }
}