CVE-2026-139706: crypto: rsassa-pkcs1 - reject undersized keys when signing
In the Linux kernel, the following vulnerability has been resolved:
crypto: rsassa-pkcs1 - reject undersized keys when signing
rsassapkcs1sign() subtracts 11 from the unsigned key size before checking that the key is large enough for PKCS#1 v1.5 padding:
if (slen + hashprefix->size > ctx->keysize - 11) return -EOVERFLOW;
If the RSA modulus is shorter than 11 bytes, the subtraction wraps. With a one-byte key and hash=none, the padding memset() writes past the output buffer.
KASAN reports:
BUG: KASAN: slab-out-of-bounds in rsassapkcs1sign+0x1ad/0x3b0 Write of size 4294967294 at addr ... The buggy address is located 0 bytes to the right of allocated 1-byte region [...]
Reject keys shorter than the minimum encoded message size.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Before PKCS#1 v1.5 signing, reject requests when `slen + hash_prefix->size > ctx->key_size - 11` and return `-EOVERFLOW`.
Event History
Frequently Asked Questions
What conditions are required to trigger the out-of-bounds write?
An RSA signing operation must use rsassa_pkcs1_sign() with an RSA modulus shorter than 11 bytes. The described proof of trigger uses a one-byte key with hash=none, causing the PKCS#1 v1.5 padding write to exceed the one-byte output buffer.
How can I determine whether a system is exposed?
Systems are exposed if their Linux kernel contains the vulnerable rsassa_pkcs1_sign() logic and can be made to sign using an RSA key whose modulus is shorter than the minimum PKCS#1 v1.5 encoded-message size. The issue is fixed by rejecting such undersized keys before the padding-length calculation.
What is the impact of successful exploitation?
Successful triggering causes a slab out-of-bounds write in the kernel during RSA PKCS#1 v1.5 signing. The reported example attempts a very large write beyond a one-byte allocated region.