This project contains known security vulnerabilities. Find detailed information at the bottom.

Crate dsh

Dependencies

(35 total, 4 outdated, 1 insecure, 2 possibly insecure)

CrateRequiredLatestStatus
 aes-gcm ⚠️^0.100.10.3maybe insecure
 arboard^3.63.6.1up to date
 async-trait^0.10.1.89up to date
 base64^0.220.22.1up to date
 chrono ⚠️^0.40.4.44maybe insecure
 clap^4.54.6.1up to date
 clap_complete^4.54.6.3up to date
 ctrlc^3.53.5.2up to date
 env_logger^0.110.11.10up to date
 futures^0.30.3.32up to date
 getch-rs^0.2.00.2.0up to date
 homedir^0.30.3.6up to date
 itertools^0.140.14.0up to date
 keyring^3.64.0.0out of date
 lazy_static^1.51.5.0up to date
 log^0.40.4.29up to date
 open^5.35.3.4up to date
 openidconnect^4.04.0.1up to date
 regex^1.11.11.12.3up to date
 rpassword^7.47.5.2up to date
 rsa ⚠️^0.90.9.10insecure
 serde^11.0.228up to date
 serde_json^11.0.149up to date
 serde_yaml^0.9.330.9.34+deprecatedup to date
 sha2^0.100.11.0out of date
 tabled^0.200.20.0up to date
 termimad^0.340.34.1up to date
 terminal_size^0.40.4.4up to date
 tokio^1.491.52.2up to date
 toml^0.91.1.2+spec-1.1.0out of date
 pkcs1^0.70.7.5up to date
 pkcs8^0.100.11.0out of date
 x509-cert^0.20.2.5up to date
 pem-rfc7468^1.0.01.0.0up to date
 dsh_api^0.9.00.9.0up to date

Security Vulnerabilities

chrono: Potential segfault in `localtime_r` invocations

RUSTSEC-2020-0159

Impact

Unix-like operating systems may segfault due to dereferencing a dangling pointer in specific circumstances. This requires an environment variable to be set in a different thread than the affected functions. This may occur without the user's knowledge, notably in a third-party library.

Workarounds

No workarounds are known.

References

rsa: Marvin Attack: potential key recovery through timing sidechannels

RUSTSEC-2023-0071

Impact

Due to a non-constant-time implementation, information about the private key is leaked through timing information which is observable over the network. An attacker may be able to use that information to recover the key.

Patches

No patch is yet available, however work is underway to migrate to a fully constant-time implementation.

Workarounds

The only currently available workaround is to avoid using the rsa crate in settings where attackers are able to observe timing information, e.g. local use on a non-compromised computer is fine.

References

This vulnerability was discovered as part of the "Marvin Attack", which revealed several implementations of RSA including OpenSSL had not properly mitigated timing sidechannel attacks.

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);