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 dtls

Dependencies

(29 total, 12 outdated, 2 possibly insecure)

CrateRequiredLatestStatus
 aes^0.80.9.1out of date
 aes-gcm ⚠️^0.100.10.3maybe insecure
 async-trait^0.10.1.89up to date
 bytecheck^0.80.8.2up to date
 byteorder^11.5.0up to date
 cbc^0.10.2.1out of date
 ccm^0.50.5.0up to date
 chacha20poly1305^0.10.10.10.1up to date
 der-parser^9.010.0.0out of date
 hmac^0.120.13.0out of date
 log^0.40.4.30up to date
 p256^0.130.13.2up to date
 p384^0.130.13.1up to date
 pem^33.0.6up to date
 portable-atomic^1.61.13.1up to date
 rand^0.90.10.1out of date
 rand_core^0.60.10.1out of date
 rcgen^0.130.14.8out of date
 ring^0.17.140.17.14up to date
 rkyv ⚠️^0.80.8.16maybe insecure
 rustls^0.23.270.23.40up to date
 sec1^0.70.8.1out of date
 sha1^0.100.11.0out of date
 sha2^0.100.11.0out of date
 thiserror^12.0.18out of date
 tokio^1.32.01.52.3up to date
 webrtc-util^0.17.10.17.1up to date
 x25519-dalek^22.0.1up to date
 x509-parser^0.160.18.1out of 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);

rkyv: Potential Undefined Behaviors in `Arc<T>`/`Rc<T>` impls of `from_value` on OOM

RUSTSEC-2026-0001

The SharedPointer::alloc implementation for sync::Arc<T> and rc::Rc<T> in rkyv/src/impls/alloc/rc/atomic.rs (and rc.rs) does not check if the allocator returns a null pointer on OOM (Out of Memory).

This null pointer can flow through to SharedPointer::from_value, which calls Box::from_raw(ptr) with the null pointer. This triggers undefined behavior when utilizing safe deserialization APIs (such as rkyv::from_bytes or rkyv::deserialize_using) if an OOM condition occurs during the allocation of the shared pointer.

The issue is reachable through safe code and violates Rust's safety guarantees.