CVE-2022-25345 is a high-severity (CVSS 7.5) CWE-908 vulnerability in @discordjs/opus. 1 public exploit or proof-of-concept reference is indexed, so weaponization risk is real. A fix is available for @discordjs/opus — see the affected versions and patch details below.
Uncontrolled Resource Consumption in @discordjs/opus
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
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.
@discordjs/opusnpmDescription
Improperly handled errors in @discordjs/opus cause hard crashes instead of returning the error to user land. All versions of package @discordjs/opus (<= 0.7.0) are vulnerable to Denial of Service (DoS) when trying to encode using an encoder with zero channels, or a non-initialized buffer. This leads to a hard crash due to improperly returning the errors from the invalid inputs.
As of version 0.8.0, the errors are correctly returned to the user and are no longer throwing hard crashes that cannot be recovered.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @discordjs/opus | all versions | 0.8.0npm install @discordjs/opus@0.8.0 |
Affected Products
opusdiscordjsResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @discordjs/opus, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update @discordjs/opus to 0.8.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2022-25345 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Frequently Asked Questions
Is CVE-2022-25345 in your dependencies?
Find it across npm, including transitive dependencies.