{"id":"CVE-2026-62271","aliases":["CVE-2026-62271","EEF-CVE-2026-62271","GHSA-wq7g-9pm7-5crv"],"related":[],"kind":"vulnerability","state":"published","title":"ex_aws_kms defaults RSA key-material wrapping to PKCS#1 v1.5 in get_parameters_for_import/3","summary":"Use of RSA Algorithm without OAEP vulnerability in ex-aws ex_aws_kms (ExAws.KMS module) causes callers who import external key material to wrap their secret KMS key material with the deprecated PKCS#1 v1.5 padding scheme by default.\n\nThis vulnerability is associated with program file lib/ex_aws/kms.ex and program routine ExAws.KMS.get_parameters_for_import/3.\n\nExAws.KMS.get_parameters_for_import/3 defaults its wrapping_algorithm argument to \"RSAES_PKCS1_V1_5\". AWS KMS returns this value as the WrappingAlgorithm for the import operation, and it dictates the RSA padding scheme the caller uses to wrap (RSA-encrypt) their secret key material before calling ImportKeyMaterial. AWS KMS also supports the stronger RSAES_OAEP_SHA_1 and RSAES_OAEP_SHA_256 schemes. By defaulting to RSAES_PKCS1_V1_5, the library steers callers who do not explicitly override the argument toward the weakest of the three. PKCS#1 v1.5 encryption padding is susceptible to Bleichenbacher adaptive chosen-ciphertext (padding oracle) attacks, which can recover the wrapped plaintext without the private key given an oracle that reveals whether a decrypted value was validly padded. Because the unwrap happens inside AWS KMS, which does not expose a padding oracle, the practical exploitability is low and this is a defense-in-depth weakness. Callers can avoid the weak default by explicitly passing \"RSAES_OAEP_SHA_256\" (or \"RSAES_OAEP_SHA_1\") as the wrapping algorithm.\n\nThis issue affects ex_aws_kms: from 2.1.0 before 2.7.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Use of RSA Algorithm without OAEP vulnerability in ex-aws ex_aws_kms (ExAws.KMS module) causes callers who import external key material to wrap their secret KMS key material with the deprecated PKCS#1 v1.5 padding scheme by default.\n\nThis vulnerability is associated with program file lib/ex_aws/kms.ex and program routine ExAws.KMS.get_parameters_for_import/3.\n\nExAws.KMS.get_parameters_for_import/3 defaults its wrapping_algorithm argument to \"RSAES_PKCS1_V1_5\". AWS KMS returns this value as the WrappingAlgorithm for the import operation, and it dictates the RSA padding scheme the caller uses to wrap (RSA-encrypt) their secret key material before calling ImportKeyMaterial. AWS KMS also supports the stronger RSAES_OAEP_SHA_1 and RSAES_OAEP_SHA_256 schemes. By defaulting to RSAES_PKCS1_V1_5, the library steers callers who do not explicitly override the argument toward the weakest of the three. PKCS#1 v1.5 encryption padding is susceptible to Bleichenbacher adaptive chosen-ciphertext (padding oracle) attacks, which can recover the wrapped plaintext without the private key given an oracle that reveals whether a decrypted value was validly padded. Because the unwrap happens inside AWS KMS, which does not expose a padding oracle, the practical exploitability is low and this is a defense-in-depth weakness. Callers can avoid the weak default by explicitly passing \"RSAES_OAEP_SHA_256\" (or \"RSAES_OAEP_SHA_1\") as the wrapping algorithm.\n\nThis issue affects ex_aws_kms: from 2.1.0 before 2.7.0.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nUse of RSA Algorithm without OAEP vulnerability in ex-aws ex_aws_kms (`ExAws.KMS` module) causes callers who import external key material to wrap their secret KMS key material with the deprecated `PKCS#1` v1.5 padding scheme by default.\n\nThis vulnerability is associated with program file `lib/ex_aws/kms.ex` and program routine `ExAws.KMS.get_parameters_for_import/3`.\n\n`ExAws.KMS.get_parameters_for_import/3` defaults its `wrapping_algorithm` argument to `\"RSAES_PKCS1_V1_5\"`. AWS KMS returns this value as the `WrappingAlgorithm` for the import operation, and it dictates the RSA padding scheme the caller uses to wrap (RSA-encrypt) their secret key material before calling `ImportKeyMaterial`. AWS KMS also supports the stronger `RSAES_OAEP_SHA_1` and `RSAES_OAEP_SHA_256` schemes. By defaulting to `RSAES_PKCS1_V1_5`, the library steers callers who do not explicitly override the argument toward the weakest of the three. `PKCS#1` v1.5 encryption padding is susceptible to Bleichenbacher adaptive chosen-ciphertext (padding oracle) attacks, which can recover the wrapped plaintext without the private key given an oracle that reveals whether a decrypted value was validly padded. Because the unwrap happens inside AWS KMS, which does not expose a padding oracle, the practical exploitability is low and this is a defense-in-depth weakness. Callers can avoid the weak default by explicitly passing `\"RSAES_OAEP_SHA_256\"` (or `\"RSAES_OAEP_SHA_1\"`) as the wrapping algorithm.\n\nThis issue affects ex_aws_kms: from 2.1.0 before 2.7.0.\n\n## Details\n\n**1. Weak default.** `ExAws.KMS.get_parameters_for_import/3` in `lib/ex_aws/kms.ex` defaults its `wrapping_algorithm` argument to `\"RSAES_PKCS1_V1_5\"`. AWS KMS also offers `RSAES_OAEP_SHA_1` and `RSAES_OAEP_SHA_256`, so callers who do not pass the argument get the weakest of the three.\n\n**2. Wrapping with that scheme.** KMS returns the requested value as the `WrappingAlgorithm` of the import operation, and it dictates the RSA padding the caller uses to encrypt their secret key material under the KMS-provided public key before calling `ImportKeyMaterial`.\n\n**3. Exposure.** PKCS#1 v1.5 encryption padding is vulnerable to Bleichenbacher adaptive chosen-ciphertext attacks: an adversary who holds the wrapped ciphertext and can query a padding oracle (anything that reveals whether a decrypted value was validly v1.5-padded) recovers the plaintext without the private key. OAEP is not susceptible. The unwrap happens inside AWS KMS, which does not expose such an oracle, so this is a defense-in-depth weakness.\n\n## Proof of concept\n\n1. Call `ExAws.KMS.get_parameters_for_import(\"alias/import-target\")` without a wrapping algorithm and read `op.data[\"WrappingAlgorithm\"]`: it is `\"RSAES_PKCS1_V1_5\"`.\n2. Wrap 32 bytes of secret key material with PKCS#1 v1.5 type-2 padding under an RSA public key, producing the ciphertext the attacker observes.\n3. Give the attacker the public key, the ciphertext and a boolean oracle that reports whether a decrypted value is validly v1.5-padded.\n4. Run the Bleichenbacher '98 attack: repeatedly multiply the ciphertext by `s^e mod n`, query the oracle, and narrow the interval containing the plaintext until it converges.\n5. The recovered plaintext equals the wrapped key material, obtained without the private key.\n\n## Impact\n\nThis is a cryptographic weak-default issue affecting anyone who uses `ExAws.KMS.get_parameters_for_import/3` to import external key material and relies on the default wrapping algorithm. Such callers wrap sensitive KMS key material with deprecated PKCS#1 v1.5 padding rather than OAEP. Real-world exploitation requires a padding oracle against the RSA decryption, and the KMS-side unwrap does not expose one, so the concrete risk is a defense-in-depth weakness rather than a directly reachable attack.\n\n## Workarounds\n\nExplicitly pass `\"RSAES_OAEP_SHA_256\"` (or `\"RSAES_OAEP_SHA_1\"`) as the `wrapping_algorithm` argument to `ExAws.KMS.get_parameters_for_import/3` instead of relying on the default, and wrap the key material with the corresponding OAEP padding scheme.","format":"markdown","source":"eef"}],"published":"2026-11-24T12:22:05.337Z","modified":"2026-12-01T17:17:40.270Z","severity":{"scorer":"EEF","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N","score":2.1,"rating":"LOW"},"severities":[{"scorer":"EEF","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N","score":2.1,"rating":"LOW"},{"scorer":"Erlang Ecosystem Foundation","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"}],"cwes":["CWE-780"],"affected":[{"ranges":[{"type":"semver","introduced":"2.1.0","fixed":"2.7.0","status":"affected"}],"vendor":"ex-aws","product":"ex_aws_kms","package":"ex_aws_kms","cpe":"cpe:2.3:a:ex-aws:ex_aws_kms:*:*:*:*:*:*:*:*","repo":"https://github.com/ex-aws/ex_aws_kms","source":"cvelist"},{"ranges":[{"type":"git","introduced":"b66631f206ec207ab7016c0c4d9f1ec898b56e85","fixed":"2d7f308da3cf75ab0385c0aebdc84ce65f6754f7","status":"affected"}],"vendor":"ex-aws","product":"ex_aws_kms","package":"ex-aws/ex_aws_kms","cpe":"cpe:2.3:a:ex-aws:ex_aws_kms:*:*:*:*:*:*:*:*","repo":"https://github.com/ex-aws/ex_aws_kms","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"2.1.0","status":"affected","fixed":"2.7.0"}],"ecosystem":"Hex","package":"ex_aws_kms","purl":"pkg:hex/ex_aws_kms","source":"eef"},{"ranges":[{"type":"git","introduced":"b66631f206ec207ab7016c0c4d9f1ec898b56e85","status":"affected","fixed":"2d7f308da3cf75ab0385c0aebdc84ce65f6754f7"}],"repo":"https://github.com/ex-aws/ex_aws_kms","source":"eef"}],"references":[{"url":"https://github.com/ex-aws/ex_aws_kms/security/advisories/GHSA-wq7g-9pm7-5crv","tags":["advisory","related","vendor-advisory"],"sources":["cvelist","eef","nvd"]},{"url":"https://cna.erlef.org/cves/CVE-2026-62271.html","tags":["related","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-62271","tags":["related"],"sources":["cvelist","nvd"]},{"url":"https://github.com/ex-aws/ex_aws_kms/commit/b66631f206ec207ab7016c0c4d9f1ec898b56e85","tags":["related","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://github.com/ex-aws/ex_aws_kms/commit/2d7f308da3cf75ab0385c0aebdc84ce65f6754f7","tags":["fix","patch"],"sources":["cvelist","eef","nvd"]},{"url":"https://hex.pm/packages/ex_aws_kms","tags":["package"],"sources":["eef"]}],"credits":["Peter Ullrich","Jonatan Männchen / EEF","Bernard Duggan"],"assigner":"EEF","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-12-01T16:32:31.873Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-62271","url":"https://www.cve.org/CVERecord?id=CVE-2026-62271","licence":"CVE Terms of Use","modified":"2026-12-01T16:51:44.362Z"},{"source":"eef","name":"Erlang Ecosystem Foundation","id":"EEF-CVE-2026-62271","url":"https://osv.dev/vulnerability/EEF-CVE-2026-62271","licence":"CC-BY-4.0","modified":"2026-11-26T17:23:07.506Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-62271","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62271","licence":"Public domain","modified":"2026-12-01T17:17:40.270Z"}],"updatedAt":"2026-12-01T17:32:12.840Z","epss":{"score":0.001,"percentile":0.00878,"date":"2026-12-01T12:00:22.000Z"}}