crypto: rsassa-pkcs1 - reject undersized keys when signing

State
Published
Severity
Not Scored
Published
Nov 30, 2026
Updated
Nov 30, 2026
Reserved
Nov 30, 2026

Read the record on cve.org

Description

In the Linux kernel, the following vulnerability has been resolved:

crypto: rsassa-pkcs1 - reject undersized keys when signing

rsassa_pkcs1_sign() subtracts 11 from the unsigned key size before checking that the key is large enough for PKCS#1 v1.5 padding:

if (slen + hash_prefix->size > ctx->key_size - 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 rsassa_pkcs1_sign+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.

ProductVersions
Linux Linux3d5b1ecdea6fb94f8c61554fcb2ba776a2d3d0e6 to before 6b3a96beef8097450fefe645cfb2c6163ad52041 Affected3d5b1ecdea6fb94f8c61554fcb2ba776a2d3d0e6 to before ec2a9b7252fce1d140445d24ac4557ba34bea244 Affected3d5b1ecdea6fb94f8c61554fcb2ba776a2d3d0e6 to before 4cf50332b5384ea13f6f896d5cf84e05b5b6484a Affected
Linux Linux4.5 Affectedbefore 4.5 Not Affected6.18.65 through 6.18.* Not Affected7.3.6 through 7.3.* Not Affected7.4-rc1 and later Not Affected

Weaknesses

The record names no weakness.

References

Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.

© 2026 NVIDIA, the NVIDIA logo, and NVIDIA Inception are trademarks and/or registered trademarks of NVIDIA Corporation in the U.S. and other countries.