Panic Vulnerability in AES Functions of Ring Package: Overflow Check Issue
Summary
GHSA-4p46-pwfr-66x6: Some AES functions may panic when overflow checking is enabled in ring. Affects ring versions < 0.17.12. Fixed in 0.17.12. 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 Ring package is a widely used cryptographic library in Rust, known for its performance and security features. It provides implementations of various cryptographic algorithms, including AES for encryption and decryption. However, certain functions within the library may panic under specific conditions, particularly when overflow checking is enabled, which can lead to potential security risks.
Vulnerability Detail
The vulnerability arises from the ring::aead::quic::HeaderProtectionKey::new_mask() function, which may panic when overflow checking is enabled. In the QUIC protocol, an attacker can exploit this vulnerability by sending specially-crafted packets, potentially causing a panic in the application. This panic can occur unintentionally in approximately 1 out of every 2^32 packets sent or received. Additionally, on 64-bit targets, operations using ring::aead::{AES_128_GCM, AES_256_GCM} may panic when encrypting or decrypting around 68,719,476,700 bytes (about 64 gigabytes) of data in a single chunk. While protocols like TLS and SSH are not affected due to their chunking of data, applications that handle large data in one chunk are at risk. Overflow checking is typically enabled in debug mode, but can be turned on in release mode using specific flags.
How To Fix
Minimum fixed version
0.17.12
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, avoid enabling overflow checks in release mode by not using the RUSTFLAGS="-C overflow-checks" setting or by setting overflow-checks = false in your Cargo.toml profile. This will prevent the panic from occurring, but it is advisable to update to the patched version as soon as possible.
Conclusion
In summary, the Ring package has a vulnerability related to panic in AES functions when overflow checking is enabled. It is crucial to update to version 0.17.12 or later to mitigate this risk. Users should also consider using Vulert to monitor for vulnerabilities in their applications.
See every vulnerability recorded for ring →
FAQ
The vulnerability is a potential panic in the Ring package's AES functions when overflow checking is enabled, which can be exploited through specially-crafted packets.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.
If exploited, this vulnerability can lead to application crashes, which may disrupt services and expose sensitive data.
No, this vulnerability is present in versions prior to 0.17.12. Updating to 0.17.12 or later resolves the issue.
If immediate updating is not possible, consider disabling overflow checks in your release builds as a temporary workaround.
References
Related vulnerabilities
Recent vulnerabilities recorded for ring.