# GHSA-ff5x-w9wg-h275: Holder can generate proof of ownership for credentials it does not control in vp-toolkit

> Attackers can forge ownership proofs for credentials they do not control, bypassing verification checks in the vp-toolkit library.

- **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-ff5x-w9wg-h275?

GHSA-ff5x-w9wg-h275 is an authentication bypass 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 [`verifyVerifiablePresentation()`](https://github.com/rabobank-blockchain/vp-toolkit/blob/master/src/service/signers/verifiable-presentation-signer.ts#L97) method check the cryptographic integrity of the Verifiable Presentation, but it does not check if the [`credentialSubject.id`](https://github.com/rabobank-blockchain/vp-toolkit-models/blob/develop/src/model/verifiable-credential.ts#L150) DID matches the signer of the VP proof.

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

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

### Workarounds
- Compute the address out of the `verifiablePresentation.proof.n.verificationMethod` using `getAddressFromPubKey()` from `crypt-util@0.1.5` and match it with the `credentialSubject.id` address from the credential.

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

### 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/14)
* [Contact me](https://github.com/rabomarnix)

## Which versions are affected by GHSA-ff5x-w9wg-h275?

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-ff5x-w9wg-h275?

Upgrade vp-toolkit to 0.2.2 or later.

## Is GHSA-ff5x-w9wg-h275 being exploited?

There is no known exploitation of GHSA-ff5x-w9wg-h275 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-ff5x-w9wg-h275 and fix it if it is affected.

What it is: GHSA-ff5x-w9wg-h275 is an authentication bypass 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-ff5x-w9wg-h275 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-ff5x-w9wg-h275/ (Markdown: https://insights.sbomify.com/GHSA-ff5x-w9wg-h275/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-ff5x-w9wg-h275

---
From sbomify Insights: https://insights.sbomify.com/GHSA-ff5x-w9wg-h275/
Summaries are generated and may contain mistakes; the official description above is the record.
