# GHSA-p94w-42g3-f7h4: Holder can (re)create authentic credentials after receiving a credential in vp-toolkit

> A verifier can be tricked into accepting forged credentials because the library fails to validate that the credential issuer matches the cryptographic signer.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Mar 2020

## What is GHSA-p94w-42g3-f7h4?

GHSA-p94w-42g3-f7h4 is a vulnerability in vp-toolkit, published on 6 Mar 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Impact
The [`verifyVerifiableCredential()`](https://github.com/rabobank-blockchain/vp-toolkit/blob/master/src/service/signers/verifiable-credential-signer.ts#L57) method check the cryptographic integrity of the Verifiable Credential, but it does not check if the [`credential.issuer`](https://github.com/rabobank-blockchain/vp-toolkit-models/blob/develop/src/model/verifiable-credential.ts#L129) DID matches the signer of the credential.

The **verifier** is impacted by this vulnerability.

### Patches
Patch will be available in version 0.2.2.

### Workarounds
In case you trust certain issuers for certain credentials as a verifier, trust the issuer&#39;s public key from the `credential.proof.verificationMethod` field.

### References
[Github issue](https://github.com/rabobank-blockchain/vp-toolkit/issues/13)

### For more information
If you have any questions or comments about this advisory:
* Discuss in the existing [issue](https://github.com/rabobank-blockchain/vp-toolkit/issues/13)
* [Contact me](https://github.com/rabomarnix)

## Which versions are affected by GHSA-p94w-42g3-f7h4?

2 open source packages ship an affected version, including vp-toolkit.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `vp-toolkit` | npm | All versions | 0.2.2 |
| `vp-toolkit` | npm | All versions | 0.2.2 |

## How do I fix GHSA-p94w-42g3-f7h4?

Upgrade vp-toolkit to 0.2.2 or later.

## Is GHSA-p94w-42g3-f7h4 being exploited?

There is no known exploitation of GHSA-p94w-42g3-f7h4 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-p94w-42g3-f7h4 and fix it if it is affected.

What it is: GHSA-p94w-42g3-f7h4 is a vulnerability in vp-toolkit, published on 6 Mar 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-p94w-42g3-f7h4 in the wild and no public exploit code.

Affected packages and fixed versions:
- vp-toolkit (npm): affected all versions; fixed in 0.2.2
- vp-toolkit (npm): affected all versions; fixed in 0.2.2

Task:
1. 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.
2. 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.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-p94w-42g3-f7h4/ (Markdown: https://insights.sbomify.com/GHSA-p94w-42g3-f7h4/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-p94w-42g3-f7h4

---
From sbomify Insights: https://insights.sbomify.com/GHSA-p94w-42g3-f7h4/
Summaries are generated and may contain mistakes; the official description above is the record.
