This project might be open to known security vulnerabilities, which can be prevented by tightening the version range of affected dependencies. Find detailed information at the bottom.

Crate dimpl

Dependencies

(27 total, 7 outdated, 2 possibly insecure)

CrateRequiredLatestStatus
 aes-gcm ⚠️^0.100.10.3maybe insecure
 arrayvec^0.7.60.7.6up to date
 aws-lc-rs^1.161.16.2up to date
 chacha20^0.90.10.0out of date
 chacha20poly1305^0.100.10.1up to date
 der^0.70.8.0out of date
 ecdsa^0.160.16.9up to date
 generic-array^0.141.3.5out of date
 hkdf^0.120.12.4up to date
 hmac^0.120.12.1up to date
 log^0.4.290.4.29up to date
 nom^88.0.0up to date
 once_cell^1.21.31.21.4up to date
 p256^0.130.13.2up to date
 p384^0.130.13.1up to date
 pkcs8^0.100.10.2up to date
 rand^0.90.10.0out of date
 rand_core^0.60.10.0out of date
 rcgen^0.14.70.14.7up to date
 sec1^0.70.8.0out of date
 sha2^0.100.11.0out of date
 signature^2.22.2.0up to date
 spki^0.70.7.3up to date
 subtle^2.62.6.1up to date
 time ⚠️^0.30.3.47maybe insecure
 x25519-dalek^22.0.1up to date
 x509-cert^0.20.2.5up to date

Dev dependencies

(6 total, 1 possibly insecure)

CrateRequiredLatestStatus
 bytes ⚠️^11.11.1maybe insecure
 env_logger^0.11.90.11.10up to date
 libc^0.20.2.183up to date
 openssl^0.10.750.10.76up to date
 wolfssl^4.1.04.1.0up to date
 x509-parser^0.180.18.1up to date

Security Vulnerabilities

aes-gcm: Plaintext exposed in decrypt_in_place_detached even on tag verification failure

RUSTSEC-2023-0096

Summary

In the AES GCM implementation of decrypt_in_place_detached, the decrypted ciphertext (i.e. the correct plaintext) is exposed even if tag verification fails.

Impact

If a program using the aes-gcm crate's decrypt_in_place* APIs accesses the buffer after decryption failure, it will contain a decryption of an unauthenticated input. Depending on the specific nature of the program this may enable Chosen Ciphertext Attacks (CCAs) which can cause a catastrophic breakage of the cipher including full plaintext recovery.

Details

As seen in the implementation of decrypt_in_place_detached for AES GCM, if the tag verification fails, an error is returned. Because the decryption of the ciphertext is done in place, the plaintext contents are now exposed via buffer.

This should ideally not be the case - as noted in page 17 of NIST's publication Recommendation for Block Cipher Modes of Operation: Galois/Counter Mode (GCM) and GMAC:

In Step 8, the result of Step 7 is compared with the authentication tag that was received as an input: if they are identical, then the plaintext is returned; otherwise,FAIL is returned.

This is seems correctly addressed in the AES GCM SIV implementation, where the decrypted buffer is encrypted again before the error is returned - this fix is straightforward to implement in AES GCM. To ensure that these types of cases are covered during testing, it would be valuable to add test cases like 23, 24 etc from project wycheproof to ensure that when a bad tag is used, there is an error on decryption and that the plaintext value is not exposed.

PoC

To reproduce this issue, I'm using test case 23 from project wycheproof.

    let key = GenericArray::from_slice(&hex!("000102030405060708090a0b0c0d0e0f"));
    let nonce = GenericArray::from_slice(&hex!("505152535455565758595a5b"));
    let tag = GenericArray::from_slice(&hex!("d9847dbc326a06e988c77ad3863e6083")); // bad tag
    let mut ct = hex!("eb156d081ed6b6b55f4612f021d87b39");
    let msg = hex!("202122232425262728292a2b2c2d2e2f");
    let aad = hex!("");
    let cipher = Aes128Gcm::new(&key);
    let _plaintext = cipher.decrypt_in_place_detached(&nonce, &aad, &mut ct, &tag);
    assert_eq!(ct, msg);

bytes: Integer overflow in `BytesMut::reserve`

RUSTSEC-2026-0007

In the unique reclaim path of BytesMut::reserve, the condition

if v_capacity >= new_cap + offset

uses an unchecked addition. When new_cap + offset overflows usize in release builds, this condition may incorrectly pass, causing self.cap to be set to a value that exceeds the actual allocated capacity. Subsequent APIs such as spare_capacity_mut() then trust this corrupted cap value and may create out-of-bounds slices, leading to UB.

This behavior is observable in release builds (integer overflow wraps), whereas debug builds panic due to overflow checks.

PoC

use bytes::*;

fn main() {
    let mut a = BytesMut::from(&b"hello world"[..]);
    let mut b = a.split_off(5);

    // Ensure b becomes the unique owner of the backing storage
    drop(a);

    // Trigger overflow in new_cap + offset inside reserve
    b.reserve(usize::MAX - 6);

    // This call relies on the corrupted cap and may cause UB & HBO
    b.put_u8(b'h');
}

Workarounds

Users of BytesMut::reserve are only affected if integer overflow checks are configured to wrap. When integer overflow is configured to panic, this issue does not apply.

time: Denial of Service via Stack Exhaustion

RUSTSEC-2026-0009

Impact

When user-provided input is provided to any type that parses with the RFC 2822 format, a denial of service attack via stack exhaustion is possible. The attack relies on formally deprecated and rarely-used features that are part of the RFC 2822 format used in a malicious manner. Ordinary, non-malicious input will never encounter this scenario.

Patches

A limit to the depth of recursion was added in v0.3.47. From this version, an error will be returned rather than exhausting the stack.

Workarounds

Limiting the length of user input is the simplest way to avoid stack exhaustion, as the amount of the stack consumed would be at most a factor of the length of the input.