p12-keystore is vulnerable to Uncontrolled Resource Consumption
45
CVE Score
Medium
Uncontrolled Resource Consumption
The entry point is KeyStore::from_pkcs12() in src/keystore.rs, which parses an attacker-supplied PKCS#12 (PFX) container; the default call path builds a private-key certificate chain by repeatedly searching parsed_certs for an issuer whose subject matches the current certificate's issuer, with only a self-signed termination check. A PKCS#12 file containing a cyclic certificate chain (A issued by B, B issued by A) causes this loop to run indefinitely while appending to the certs Vec, and separately verify_mac()/decrypt() in src/codec.rs apply MAC/PBKDF2 iteration counts and scrypt cost parameters read directly from the container DER with no upper bound, letting a crafted container force excessive CPU/memory work during password verification and decryption. The fix adds a certs.contains(&issuer.cert) cycle-break in the keystore chain loop and introduces MAX_MAC_ITERATIONS/MAX_KDF_ITERATIONS/MAX_SCRYPT_MEMORY_BYTES/MAX_SCRYPT_PARALLELISM checks in codec.rs that return Error::InvalidParameters when exceeded.
Upgrade the p12-keystore package to version 0.3.2 or later.
You are affected if you are using a version that falls within the vulnerable range and import PKCS#12 containers through the library's keystore parsing function.
0.1.0 - 0.3.1
Fixed in 0.3.2p12-keystore is vulnerable to Uncontrolled Resource Consumption in versions 0.1.0 - 0.3.1.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.