Denial of Service Vulnerability in Opus Package: CVE-2022-25345
Summary
ALPINE-CVE-2022-25345: All versions of package @discordjs/opus are vulnerable to Denial of Service (DoS) when trying to encode using an encoder with zero channels, or a non-initialized buffer. Affects opus versions < 0. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The Opus package is a widely used audio codec library that enables high-quality audio streaming and encoding. It is particularly popular in applications that require real-time audio processing, such as voice over IP (VoIP) and online gaming. The package is designed to handle various audio formats and provides efficient encoding and decoding capabilities. However, it has been identified to have a critical vulnerability that can lead to a Denial of Service (DoS) attack, impacting the stability and availability of applications relying on it.
Vulnerability Detail
All versions of the Opus package are vulnerable to a Denial of Service (DoS) attack when an encoder is used with zero channels or a non-initialized buffer. This vulnerability can lead to a hard crash of the application, making it unresponsive and potentially affecting the user experience. The vulnerability arises from improper handling of audio encoding parameters, which can be exploited by malicious actors to disrupt service.
How To Fix
To fix this vulnerability, it is essential to update the Opus package to a patched version. As of now, there are no fixed versions available for the affected Alpine ecosystems (v3.18 to v3.22). Users should regularly check for updates and apply them as soon as they are released.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, avoid using encoders with zero channels or uninitialized buffers. Ensure that all audio encoding operations are performed with properly initialized parameters to prevent triggering the vulnerability.
Conclusion
The Opus package is currently vulnerable to a Denial of Service attack, which can severely impact applications that rely on it for audio processing. Users are advised to monitor for updates and apply any patches as soon as they become available. In the meantime, implementing workarounds can help mitigate the risk.
See every vulnerability recorded for opus →
FAQ
CVE-2022-25345 is a vulnerability in the Opus package that can lead to a Denial of Service (DoS) when using an encoder with zero channels or a non-initialized buffer.
This vulnerability can cause your application to crash, leading to service interruptions and a poor user experience.
Currently, there are no patched versions available for the Opus package in the affected Alpine ecosystems.
Avoid using encoders with zero channels or uninitialized buffers as a temporary workaround until a patch is released.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software using just a manifest file like package-lock.json. You can also check your application for this vulnerability using the Vulert playground.
References
Related vulnerabilities
Recent vulnerabilities recorded for opus.