CVE-2026-62271 in ex_aws_kms
Summary
by MITRE • 11/24/2026
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.
This vulnerability is associated with program file lib/ex_aws/kms.ex and program routine ExAws.KMS.get_parameters_for_import/3.
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.
This issue affects ex_aws_kms: from 2.1.0 before 2.7.0.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 11/24/2026
The vulnerability identified in the ExAws.KMS module of the ex-aws library represents a significant cryptographic configuration weakness rooted in the use of deprecated padding schemes for RSA encryption operations. Specifically, within the lib/ex_aws/kms.ex program file and its get_parameters_for_import/3 routine, the default wrapping algorithm is set to RSAES_PKCS1_V1_5 when handling external key material imports into AWS KMS. This design choice forces callers who do not explicitly override this parameter to utilize PKCS#1 v1.5 padding for encrypting their secret key material before transmission. While AWS KMS supports stronger alternatives such as RSAES_OAEP_SHA_1 and RSAES_OAEP_SHA_256, the library's default behavior steers users toward the weakest available option by design rather than requiring them to opt into security best practices. This pattern aligns with CWE-327, which classifies the use of a broken or risky cryptographic algorithm as a vulnerability, and reflects CWE-918 regarding the application of insufficiently verified cryptographic primitives in critical operations.
The technical flaw lies in the inherent weaknesses of PKCS#1 v1.5 encryption padding compared to Optimal Asymmetric Encryption Padding OAEP. PKCS#1 v1.5 is susceptible to Bleichenbacher adaptive chosen-ciphertext attacks, commonly known as padding oracle attacks. In a theoretical scenario where an attacker can interact with a decryption service that reveals whether a decrypted value possessed valid padding structure, they could iteratively recover the plaintext without possessing the private key. This type of attack exploits the deterministic nature and structural predictability of PKCS#1 v1.5 padding, allowing for gradual reconstruction of sensitive data through careful analysis of error responses or timing differences during decryption attempts. The vulnerability is particularly concerning because it defaults to this weaker standard automatically, meaning that any new integration using ex_aws_kms versions from 2.1.0 up to but not including 2.7.0 will inherit this insecure configuration unless the developer manually intervenes.
From an operational impact perspective, the practical exploitability of this vulnerability is considered low due to defense-in-depth measures implemented by AWS KMS itself. The actual unwrapping and decryption of the key material occur server-side within the AWS infrastructure, which does not expose padding oracle information to external callers. Consequently, while the cryptographic method used for transport encryption is suboptimal and theoretically vulnerable, an attacker cannot easily leverage this weakness in a live environment because they lack access to the necessary side-channel feedback required to execute a Bleichenbacher attack effectively. However, relying on such implicit security guarantees is risky as it assumes that internal service implementations will never change or leak information through other means. The presence of this vulnerability indicates a lapse in secure-by-default design principles, where the burden of security is placed entirely on the consumer rather than being enforced by the library itself.
To mitigate this risk and align with industry standards such as NIST SP 800-56B which recommends OAEP for RSA encryption, developers must explicitly configure the wrapping algorithm to use a stronger padding scheme. By passing RSAES_OAEP_SHA_256 or RSAES_OAEP_SHA_1 as the wrapping_algorithm argument in calls to ExAws.KMS.get_parameters_for_import/3, callers can ensure that their secret key material is encrypted using modern cryptographic standards resistant to known padding oracle attacks. This manual override ensures compliance with current best practices for asymmetric encryption and reduces the attack surface associated with data-in-transit protection during key import operations. Furthermore, upgrading ex_aws_kms to version 2.7.0 or later may address this issue if the maintainers have updated the default behavior in subsequent releases, although verifying the specific fix details is recommended. Organizations should also review their integration points for any hardcoded reliance on older cryptographic defaults and implement automated security testing that flags non-compliant encryption configurations during development cycles to prevent similar issues from persisting in production environments.