# GHSA-p4v8-jgcv-9g75: safe_pqc_kyber leaks parts of secret keys

> Attackers can recover secret keys via timing attacks on decapsulation in the safe_pqc_kyber Rust library, compromising cryptographic security.

- **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:** 3 Jan 2024

## What is GHSA-p4v8-jgcv-9g75?

GHSA-p4v8-jgcv-9g75 is a vulnerability in safe_pqc_kyber, published on 3 Jan 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Impact
On some platforms, when an attacker can time decapsulation, and in particular when the attacker can forge cipher texts, they can learn (parts of) the secret key.

Does not apply to ephemeral usage, such as when used in the regular way in TLS.

### Patches
Patched in 0.6.2.

### References
- [kyberslash.cr.yp.to](https://kyberslash.cr.yp.to)

## Which versions are affected by GHSA-p4v8-jgcv-9g75?

2 open source packages ship an affected version, including safe_pqc_kyber.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `safe_pqc_kyber` | crates.io | All versions | 0.6.2 |
| `safe_pqc_kyber` | crates.io | All versions | 0.6.2 |

## How do I fix GHSA-p4v8-jgcv-9g75?

Upgrade safe_pqc_kyber to 0.6.2 or later.

## Is GHSA-p4v8-jgcv-9g75 being exploited?

There is no known exploitation of GHSA-p4v8-jgcv-9g75 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-p4v8-jgcv-9g75 and fix it if it is affected.

What it is: GHSA-p4v8-jgcv-9g75 is a vulnerability in safe_pqc_kyber, published on 3 Jan 2024. 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-p4v8-jgcv-9g75 in the wild and no public exploit code.

Affected packages and fixed versions:
- safe_pqc_kyber (crates.io): affected all versions; fixed in 0.6.2
- safe_pqc_kyber (crates.io): affected all versions; fixed in 0.6.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-p4v8-jgcv-9g75/ (Markdown: https://insights.sbomify.com/GHSA-p4v8-jgcv-9g75/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-p4v8-jgcv-9g75

---
From sbomify Insights: https://insights.sbomify.com/GHSA-p4v8-jgcv-9g75/
Summaries are generated and may contain mistakes; the official description above is the record.
