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 v2ray-rust

Dependencies

(54 total, 19 outdated, 3 possibly insecure)

CrateRequiredLatestStatus
 actix-rt^2.82.11.0up to date
 actix-server^2.2.02.6.0up to date
 actix-service^2.02.0.3up to date
 aead^0.50.5.2up to date
 aes^0.8.30.8.4up to date
 aes-gcm ⚠️^0.100.10.3maybe insecure
 anyhow^1.01.0.100up to date
 async-trait^0.10.1.89up to date
 base64^0.21.20.22.1out of date
 bitvec^11.0.1up to date
 bloomfilter^1.0.93.0.1out of date
 boring^4.2.04.19.0up to date
 boring-sys^4.2.04.19.0up to date
 byte_string^1.01.0.0up to date
 bytes^11.11.0up to date
 chacha20poly1305^0.100.10.1up to date
 cidr-utils^0.5.100.6.2out of date
 clap^44.5.54up to date
 crc32fast^1.3.21.5.0up to date
 env_logger^0.100.11.8out of date
 foreign-types-shared^0.3.10.3.1up to date
 futures-util^0.30.3.31up to date
 generic-array^0.14.71.3.5out of date
 hkdf^0.120.12.4up to date
 hmac^0.120.12.1up to date
 log^0.40.4.29up to date
 md-5^0.10.50.10.6up to date
 prost^0.110.14.1out of date
 protobuf ⚠️^3.0.13.7.2maybe insecure
 rand^0.80.9.2out of date
 regex^1.7.31.12.2up to date
 serde^1.01.0.228up to date
 sha-1^0.10.10.10.1up to date
 sha2^0.10.60.10.9up to date
 socket2^0.4.70.6.1out of date
 spin^0.9.60.10.0out of date
 tokio^1.261.49.0up to date
 tokio-boring^4.2.04.19.0up to date
 tokio-tungstenite^0.200.28.0out of date
 tokio-util^0.70.7.18up to date
 toml^0.50.9.10+spec-1.1.0out of date
 tonic^0.90.14.2out of date
 uuid^1.31.19.0up to date
 brotli^3.3.48.0.2out of date
 gentian^0.1.80.1.8up to date
 h2 ⚠️^0.3.200.4.13out of date
 http^0.21.4.0out of date
 hyper^0.14.271.8.1out of date
 libc^0.20.2.179up to date
 once_cell^11.21.3up to date
 tower^0.4.130.5.2out of date
 schannel^0.1.210.1.28up to date
 openssl-probe^0.1.50.2.0out of date
 security-framework^2.9.13.5.1out of date

Build dependencies

(2 total, 1 outdated)

CrateRequiredLatestStatus
 protobuf-codegen^3.2.03.7.2up to date
 tonic-build^0.100.14.2out 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);

h2: Degradation of service in h2 servers with CONTINUATION Flood

RUSTSEC-2024-0332

An attacker can send a flood of CONTINUATION frames, causing h2 to process them indefinitely. This results in an increase in CPU usage.

Tokio task budget helps prevent this from a complete denial-of-service, as the server can still respond to legitimate requests, albeit with increased latency.

More details at "https://seanmonstar.com/blog/hyper-http2-continuation-flood/.

Patches available for 0.4.x and 0.3.x versions.

protobuf: Crash due to uncontrolled recursion in protobuf crate

RUSTSEC-2024-0437

Affected version of this crate did not properly parse unknown fields when parsing a user-supplied input.

This allows an attacker to cause a stack overflow when parsing the mssage on untrusted data.