# GHSA-f6jh-hvg2-9525: crystals-go vulnerable to KyberSlash (timing side-channel attack for Kyber)

> Timing side-channel in crystals-go allows attackers to recover secret keys by timing decapsulation of forged ciphertexts.

- **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:** 17 Jan 2024
- **Also known as:** GO-2024-2469

## What is GHSA-f6jh-hvg2-9525?

GHSA-f6jh-hvg2-9525 is a vulnerability in github.com/kudelskisecurity/crystals-go, published on 17 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 of Kyber on forged cipher texts, they could possibly learn (parts of) the secret key.

### Patches
Patched in https://github.com/kudelskisecurity/crystals-go/pull/21

### Note
This library was written as part of a MsC student project in the Cybersecurity Team at Kudelski Security. It is not actively maintained anymore. It is only intended for research and testing. We discourage its use in any production environment. Kudelski Security does not use this library as part of their commercial offers or product. This has now been clarified on the project's README.

### References
https://groups.google.com/a/list.nist.gov/g/pqc-forum/c/ldX0ThYJuBo
http://kyberslash.cr.yp.to/

## Which versions are affected by GHSA-f6jh-hvg2-9525?

3 open source packages ship an affected version, including github.com/kudelskisecurity/crystals-go.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/kudelskisecurity/crystals-go` | Go | All versions | 0.0.0-20240116172146-2a6ca2d4e64d |
| `github.com/kudelskisecurity/crystals-go` | Go | All versions | 0.0.0-20240116172146-2a6ca2d4e64d |
| `github.com/kudelskisecurity/crystals-go` | Go | All versions | 0.0.0-20240116172146-2a6ca2d4e64d |

## How do I fix GHSA-f6jh-hvg2-9525?

Upgrade github.com/kudelskisecurity/crystals-go to 0.0.0-20240116172146-2a6ca2d4e64d or later.

## Is GHSA-f6jh-hvg2-9525 being exploited?

There is no known exploitation of GHSA-f6jh-hvg2-9525 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-f6jh-hvg2-9525 and fix it if it is affected.

What it is: GHSA-f6jh-hvg2-9525 is a vulnerability in github.com/kudelskisecurity/crystals-go, published on 17 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-f6jh-hvg2-9525 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/kudelskisecurity/crystals-go (Go): affected all versions; fixed in 0.0.0-20240116172146-2a6ca2d4e64d
- github.com/kudelskisecurity/crystals-go (Go): affected all versions; fixed in 0.0.0-20240116172146-2a6ca2d4e64d
- github.com/kudelskisecurity/crystals-go (Go): affected all versions; fixed in 0.0.0-20240116172146-2a6ca2d4e64d

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-f6jh-hvg2-9525/ (Markdown: https://insights.sbomify.com/GHSA-f6jh-hvg2-9525/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-f6jh-hvg2-9525

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