Panic Risk in AES Functions of Ring Package: RUSTSEC-2025-0009
Summary
RUSTSEC-2025-0009: Some AES functions may panic when overflow checking is enabled. Affects ring versions >= 0.0.0-0, < 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, providing secure implementations of various cryptographic algorithms, including AES (Advanced Encryption Standard). It is designed for high performance and security, making it suitable for applications that require encryption, such as TLS and SSH. However, certain functions within the Ring package may panic under specific conditions, particularly when overflow checking is enabled, which can lead to denial-of-service vulnerabilities.
Vulnerability Detail
The vulnerability arises from the ring::aead::quic::HeaderProtectionKey::new_mask() function, which may panic when overflow checking is enabled. An attacker can exploit this by sending specially-crafted packets in the QUIC protocol, potentially causing a panic in the application. This situation can occur unintentionally in approximately 1 out of every 2^32 packets sent or received. On 64-bit systems, operations involving ring::aead::{AES_128_GCM, AES_256_GCM} may also panic when processing around 68.7 billion bytes of data in a single chunk. While protocols like TLS and SSH are not affected due to their chunking of data, applications that attempt to encrypt or decrypt large amounts of data in one go are at risk.
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
If you cannot update the package immediately, consider disabling overflow checks in your development environment. You can do this by removing or modifying the RUSTFLAGS in your build configuration. For example, ensure that you do not set RUSTFLAGS="-C overflow-checks" or set overflow-checks = false in your Cargo.toml profile.
Conclusion
The vulnerability identified as RUSTSEC-2025-0009 in the Ring package poses a significant risk of application panics under certain conditions. It is crucial for developers to update to version 0.17.12 or later to mitigate this risk. Additionally, understanding the implications of overflow checks and utilizing tools like Vulert can help maintain the security of your applications.
See every vulnerability recorded for ring →
FAQ
The vulnerability can lead to application panics, resulting in denial-of-service conditions, especially when processing large data chunks or receiving malicious packets.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected without needing to sign up.
Overflow checks in Rust are safety checks that prevent arithmetic operations from exceeding the maximum value of a data type, which can lead to unexpected behavior or security vulnerabilities.
No, the vulnerability is present in versions prior to 0.17.12. Updating to this version or later will mitigate the issue.
As a temporary measure, consider disabling overflow checks in your development environment to avoid panics until you can update the package.
References
Related vulnerabilities
Recent vulnerabilities recorded for ring.