{"answers":{"affected":"6 open source packages ship an affected version, including github.com/slsa-framework/slsa-verifier and github.com/slsa-framework/slsa-verifier/v2.","exploited":"There is no known exploitation of GHSA-r2xv-vpr2-42m9 in the wild and no public exploit code.","fix":"Upgrade to a fixed version.","what":"GHSA-r2xv-vpr2-42m9 is a vulnerability in github.com/slsa-framework/slsa-verifier, published on 8 Nov 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for GHSA-r2xv-vpr2-42m9 and fix it if it is affected.\n\nWhat it is: GHSA-r2xv-vpr2-42m9 is a vulnerability in github.com/slsa-framework/slsa-verifier, published on 8 Nov 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of GHSA-r2xv-vpr2-42m9 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- github.com/slsa-framework/slsa-verifier (Go): affected all versions; no fix listed\n- github.com/slsa-framework/slsa-verifier (Go): affected all versions up to 1.4.1; no fix listed\n- github.com/slsa-framework/slsa-verifier (Go): affected all versions up to 1.4.1; no fix listed\n- github.com/slsa-framework/slsa-verifier/v2 (Go): affected all versions; fixed in 2.4.1-rc.0\n- github.com/slsa-framework/slsa-verifier/v2 (Go): affected all versions; fixed in 2.4.1-rc.0\n- github.com/slsa-framework/slsa-verifier/v2 (Go): affected all versions; fixed in 2.4.1-rc.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-r2xv-vpr2-42m9/ (Markdown: https://insights.sbomify.com/GHSA-r2xv-vpr2-42m9/index.md)","id":"GHSA-r2xv-vpr2-42m9","markdown":"https://insights.sbomify.com/GHSA-r2xv-vpr2-42m9/index.md","name":"GHSA-r2xv-vpr2-42m9","record":{"aliases":["GO-2023-2188"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["security_bypass"],"network_reachable":"yes","non_default_config":true,"product_category":"Go supply chain tool","requires_auth":"none","summary":"slsa-verifier fails to validate npm publish attestation signatures, allowing attackers to bypass integrity checks for tampered packages.","user_interaction":"required","vuln_class":"security_feature_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### Summary\n\n`slsa-verifier\u003c=2.4.0` does not correctly verify npm's [publish](https://github.com/npm/attestation/tree/main/specs/publish/v0.1) attestations signature.\n\n### Proof of concept\n\nSteps to reproduce:\n1. `curl -Sso attestations.json $(npm view @trishankatdatadog/supreme-goggles --json | jq -r '.dist.attestations.url')`\n2. `curl -Sso supreme-goggles.tgz \"$(npm view @trishankatdatadog/supreme-goggles --json | jq -r '.dist.tarball')\"`\n3. In `attestations.json`, take the value addressed by the `jq` selector `.attestations[0].bundle.dsseEnvelope.payload`, base64decode it, tamper with it, base64encode that, and replace the original value with that. Save the file as `attestations_tampered.json`.\n   Here is an example command to replace the package name with `@attacker/malicious`:\n   `jq -r \".attestations[0].bundle.dsseEnvelope.payload = \\\"$(jq -r '.attestations[0].bundle.dsseEnvelope.payload | @base64d' \u003c attestations.json | jq '.subject[0].name = \"pkg:npm/%40attacker/malicious\"' | base64 -w0)\\\"\" \u003c attestations.json \u003e attestations_tampered.json`\n5. `SLSA_VERIFIER_EXPERIMENTAL=1 slsa-verifier verify-npm-package supreme-goggles.tgz --attestations-path attestations_tampered.json --builder-id \"https://github.com/actions/runner/github-hosted\" --package-name \"@trishankatdatadog/supreme-goggles\" --package-version 1.0.5 --source-uri github.com/trishankatdatadog/supreme-goggles`\n6. The result is that `slsa-verifier` fails to detect this tampering of the publish attestation (unlike with the provenance attestation) and returns `PASSED`.\n\n### Impact\n\nAn attacker who controls what packages and attestations are shown to a user _can_ associate a package with an arbitrary name and version that do _not_ match what the user expects from the publish attestation. Furthermore, the package digest in the publish attestation need _not_ match its counterpart in the provenance attestation. However, the attacker _cannot_ associate the given package with an arbitrary source and builder that the user does not expect from the provenance attestation. Thus, the attacker could, for example, convince package managers to install authentic but older versions of packages that contain known, exploitable vulnerabilities.\n\nSeverity is considered low because 1) it does not invalidate the provenance and 2) support for npm is currently experimental.\n\n### Patches\n\nFixed by PR [#705](https://github.com/slsa-framework/slsa-verifier/pull/705) and released in versions `\u003e=2.4.1`.\n\n### Workarounds\n\nThere is no easy way for users to fix or remediate this vulnerability without upgrading, short of verifying npm's publish attestations themselves, _and_ cross-verifying it against GHA's provenance attestations.\n\n### References\n\n* [Original OpenSSF Slack thread](https://openssf.slack.com/archives/C03PDLFET5W/p1695330038983179)","ecosystems":["Go"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"slsa-verifier vulnerable to mproper validation of npm's publish attestations","id":"GHSA-r2xv-vpr2-42m9","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"Go","product":null,"products":[],"type":"security_feature_bypass","year":"2023"},"n_packages":6,"n_references":null,"packages":[{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":[],"package":"github.com/slsa-framework/slsa-verifier","purl":"pkg:golang/github.com/slsa-framework/slsa-verifier","source":"GO-2023-2188"},{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":["1.4.1"],"package":"github.com/slsa-framework/slsa-verifier","purl":null,"source":"GHSA-r2xv-vpr2-42m9"},{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":["1.4.1"],"package":"github.com/slsa-framework/slsa-verifier","purl":"pkg:golang/github.com/slsa-framework/slsa-verifier","source":"GHSA-r2xv-vpr2-42m9"},{"ecosystem":"Go","fixed":["2.4.1-rc.0"],"introduced":["0"],"last_affected":[],"package":"github.com/slsa-framework/slsa-verifier/v2","purl":null,"source":"GHSA-r2xv-vpr2-42m9"},{"ecosystem":"Go","fixed":["2.4.1-rc.0"],"introduced":["0"],"last_affected":[],"package":"github.com/slsa-framework/slsa-verifier/v2","purl":"pkg:golang/github.com/slsa-framework/slsa-verifier/v2","source":"GHSA-r2xv-vpr2-42m9"},{"ecosystem":"Go","fixed":["2.4.1-rc.0"],"introduced":["0"],"last_affected":[],"package":"github.com/slsa-framework/slsa-verifier/v2","purl":"pkg:golang/github.com/slsa-framework/slsa-verifier/v2","source":"GO-2023-2188"}],"products":null,"published":"2023-11-08","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"Go Vulnerability Database","prefix":"GO"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"slsa-verifier fails to validate npm publish attestation signatures, allowing attackers to bypass integrity checks for tampered packages.","url":"https://insights.sbomify.com/GHSA-r2xv-vpr2-42m9/"}