# GHSA-978j-88f3-p5j3: Threshold value is ignored (all shares are n=3)

> A Rust library flaw forces a fixed threshold of three shares, ignoring configuration and weakening the security of secret sharing implementations.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Not stated
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 21 Jan 2020
- **Also known as:** RUSTSEC-2020-0160

## What is GHSA-978j-88f3-p5j3?

GHSA-978j-88f3-p5j3 is a vulnerability in shamir, published on 21 Jan 2020. 

### Official description

Affected versions of this crate did not properly calculate secret shares requirements.

This reduces the security of the algorithm by restricting the crate to always
using a threshold value of three, rather than a configurable limit.

The flaw was corrected by correctly configuring the threshold.

## Which versions are affected by GHSA-978j-88f3-p5j3?

3 open source packages ship an affected version, including shamir.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `shamir` | crates.io | All versions | 2.0.0 |
| `shamir` | crates.io | All versions | 2.0.0 |
| `shamir` | crates.io | From 0.0.0-0 | 2.0.0 |

## How do I fix GHSA-978j-88f3-p5j3?

Upgrade shamir to 2.0.0 or later.

## Is GHSA-978j-88f3-p5j3 being exploited?

There is no known exploitation of GHSA-978j-88f3-p5j3 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-978j-88f3-p5j3 and fix it if it is affected.

What it is: GHSA-978j-88f3-p5j3 is a vulnerability in shamir, published on 21 Jan 2020. 
Exploitation: There is no known exploitation of GHSA-978j-88f3-p5j3 in the wild and no public exploit code.

Affected packages and fixed versions:
- shamir (crates.io): affected all versions; fixed in 2.0.0
- shamir (crates.io): affected all versions; fixed in 2.0.0
- shamir (crates.io): affected from 0.0.0-0; fixed in 2.0.0

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-978j-88f3-p5j3/ (Markdown: https://insights.sbomify.com/GHSA-978j-88f3-p5j3/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-978j-88f3-p5j3

---
From sbomify Insights: https://insights.sbomify.com/GHSA-978j-88f3-p5j3/
Summaries are generated and may contain mistakes; the official description above is the record.
