CVE-2026-139706: Linux kernel RSASSA-PKCS1 signing underflows on a key shorter than 11 bytes and writes far past the output buffer

ByLinuxtastic

December 2, 2026 #CVE, #Linux Kernel

The kernel’s crypto API can produce PKCS#1 v1.5 RSA signatures for in-kernel users and, through the keyring’s asymmetric keys, for user space. The kernel CNA record says rsassa_pkcs1_sign() “subtracts 11 from the unsigned key size before checking that the key is large enough for PKCS#1 v1.5 padding”, so “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”, and KASAN reports a slab out-of-bounds write “of size 4294967294” at the end of an allocated one-byte region. The fix rejects keys shorter than the minimum encoded message size. The CNA scores it 7.0, local with high complexity; Red Hat 7.8 Important. Upgrade to 6.18.65, 7.3.6 or later; on older stable series, where no backport is listed yet, the one-line fix applies cleanly, and the trigger needs a local user able to load an RSA key and ask the kernel to sign with it.

CVE-2026-139706 at a glance.

ComponentLinux kernel, crypto API RSASSA-PKCS1 template (crypto/rsassa-pkcs1.c): rsassa_pkcs1_sign()
Affected versionsfrom 3d5b1ecdea6f (“crypto: rsa – RSA padding algorithm”): 4.5 up to 6.18 before 6.18.65, 7.3 before 7.3.6 and 7.4 before 7.4-rc1. The record lists backports to 6.18 and 7.3 only; 5.10, 5.15, 6.1, 6.6 and 6.12 are inside the affected range with no fix listed on 2 December 2026 (Debian marks its 6.1 and 6.12 kernels vulnerable)
Fixed inmainline 7.4-rc1 (commit 4cf50332, Jérémy Jean, authored 26 August 2026, taken by Herbert Xu; crypto/rsassa-pkcs1.c +1/−1) and stable 6.18.65, 7.3.6. The change replaces the early guard if (!ctx->key_size) with if (ctx->key_size < 11), returning −EINVAL before any padding arithmetic. Fixes 3d5b1ecdea6f; reviewed by Sudhakar Kuppusamy
SeverityKernel CNA CVSS 3.1 7.0 (AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H); NVD shows the CNA metric only; Red Hat Important, 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H, draft, CWE-787 out-of-bounds write), bug 2586872 “Denial of Service via integer underflow in rsassa_pkcs1_sign”; Ubuntu Medium, no score
Exploited in the wildNot on the CISA KEV catalogue (2026.11.30). EPSS 0.00211 (12th percentile) on 1 December 2026
Who is exposedA host where a local user can present the kernel with an RSA private key of their choosing and request a signature: the keyring’s keyctl pkey_sign on an asymmetric key the user added is the obvious path, and in-kernel callers that sign with user-supplied key material are the other. A write of that size past a one-byte slab object is a crash at minimum; Red Hat rates it Important for the memory-corruption potential
PublishedCVE record 30 November 2026 (kernel CNA); this page built 2 December 2026, last updated 2 December 2026

What it is

PKCS#1 v1.5 signing wraps a hash in a fixed envelope: a leading 0x00 0x01, at least eight bytes of 0xFF padding, a 0x00 separator and then the DigestInfo, which is why eleven bytes is the smallest overhead and the modulus must be at least that much bigger than the data. rsassa_pkcs1_sign() expressed that as a check that the data plus prefix fit in key_size - 11, but key_size is unsigned and the subtraction ran first.

Give it a modulus of one byte, which the RSA key parser accepts, and key_size - 11 wraps to a little under four billion. The fit check passes, and the function proceeds to pad: a memset of 0xFF across what it believes is the padding region, into an output buffer sized for a one-byte key. KASAN’s report, a write of 4,294,967,294 bytes starting zero bytes past a one-byte region, is the arithmetic made visible; in practice the machine faults long before the write completes. The CNA’s high complexity reflects what it takes to reach the call with a chosen key, Red Hat’s low complexity reflects that keyctl gives any user a route to it.

Jérémy Jean’s fix, authored on 26 August 2026 and taken by Herbert Xu for 7.4-rc1, changes one comparison: the guard that rejected only a zero key size now rejects anything below eleven bytes, before the subtraction. Sudhakar Kuppusamy reviewed it. The two listed backports are to 6.18 and 7.3; the older long-term series sit inside the record’s affected range with no fix listed yet, which this page will update when one appears.

Who is affected on Linux

Each row is what the distribution’s own security tracker said on 2 December 2026; the link in the row is the tracker page, which will be newer than this one. The code is built into every kernel that has RSA support, which is every distribution kernel (module signing and IMA depend on it), so there is no “module not loaded” exemption here; what varies is whether local users can reach the signing path.

DistributionStatusFixed package
AlpineNot consulted for this page: the Alpine tracker refused the automated reader on 2 December 2026—
Debianbookworm (6.1.176-1, security 6.1.192-3) vulnerable; trixie (6.12.117-1, security 6.12.118-1) vulnerable; fixed in forky and sid (7.3.6-1); no DSAunstable 7.3.6-1
UbuntuMedium, no Ubuntu CVSS; linux needs evaluation in every supported release (26.10, 26.04 LTS, 24.04 LTS, 22.04 LTS, 20.04 LTS and the ESM releases); no USN on 2 December 2026nothing released on 2 December 2026
RHEL, Rocky, Alma, CentOS StreamImportant, 7.8 (bug 2586872, CWE-787); kernel affected in RHEL 10 and the OpenShift 5 RHCOS 10 image; RHEL 6, 7, 8 and 9 (kernel and kernel-rt) and the other RHCOS images listed not affected (Red Hat’s assessment of the older rsa-pkcs1pad code); no errata on 2 December 2026—
openSUSE/SLENot consulted: suse.com refused the automated reader on 2 December 2026 (client error)—
Fedora, Arch; self-built kernelsNot consulted; upstream stable versions apply6.18.65 / 7.3.6 or later; older series: the one-line patch

How to check

Every unfixed kernel has the code, so the questions are about reach: is the kernel version in range, can unprivileged users add asymmetric keys and sign with them, and is the AF_ALG socket interface (which also exposes the crypto API) available to them.

# 1. the running kernel: fixed in 6.18.65, 7.3.6 or later (older series: no backport listed on 2 December 2026)
uname -r

# 2. is the template present (it is, on any kernel with RSA)
grep -E '^name\s+: (pkcs1|rsassa|pkcs1pad)' /proc/crypto | sort -u

# 3. can an ordinary user reach it: keyctl present, asymmetric keys allowed, AF_ALG available
which keyctl; grep -c asymmetric /proc/key-users 2>/dev/null
grep -E 'algif|af_alg' /proc/modules; zgrep -E 'CONFIG_CRYPTO_USER_API(_AKCIPHER)?=' /proc/config.gz 2>/dev/null

Every kernel older than the fixed releases carries the arithmetic, so the first command only tells you whether the fix is in. If keyctl is installed and users may add keys to their own keyrings, which is the default, a local user can load a tiny RSA key and call pkey_sign on it; that is the path both Red Hat’s and the CNA’s vectors describe. The AF_ALG check matters only on kernels that still expose akcipher operations to user space, which recent kernels do not.

How to fix it

Update the kernel and reboot. On the 6.18 and 7.3 series the stable releases carry the fix; on older long-term series the change is a single comparison and can be applied to a self-built kernel while the distributions decide. There is no configuration switch that disables signing without breaking module verification and IMA, so there is no clean mitigation.

# Debian forky / sid (7.3.6-1 carries the fix); trixie and bookworm: watch the tracker row above
apt update && apt install linux-image-amd64 && systemctl reboot
# RHEL / Rocky / Alma: no errata yet on 2 December 2026; when the advisory lands
dnf update kernel && systemctl reboot
# Ubuntu: no USN yet; once the linux package is released
apt update && apt install linux-generic && systemctl reboot
# Self-built or older stable kernels: the fix is one line in crypto/rsassa-pkcs1.c
# (older series keep the same guard in their RSA padding code; check before applying):
#   -	if (!ctx->key_size)
#   +	if (ctx->key_size < 11)
#   https://github.com/torvalds/linux/commit/4cf50332b5384ea13f6f896d5cf84e05b5b6484a.patch
cd /usr/src/linux && patch -p1 < 4cf50332.patch && make -j"$(nproc)" && make modules_install install

Removing keyctl from a host is not a mitigation worth the trouble: the system call is still there and any program can make it. What not to do: do not disable CONFIG_CRYPTO_USER_API or unload algif modules on the strength of this record alone; the keyring path does not go through AF_ALG, and the patch is small enough to carry until the distribution kernels have it.

Sources

  • CVE-2026-139706 at CVE.org — the kernel CNA record: the “subtracts 11 from the unsigned key size before checking” sentence, the one-byte-key example, the KASAN write of size 4294967294, the 4.5 lower bound and the git ranges (30 November 2026)
  • Fix commit 4cf50332 (mainline, 7.4-rc1; Jérémy Jean, 26 August 2026; crypto/rsassa-pkcs1.c +1/−1; Fixes 3d5b1ecdea6f, Reviewed-by Sudhakar Kuppusamy, Signed-off-by Herbert Xu) and the two stable backports in the record (read on GitHub on 2 December 2026; git.kernel.org refuses automated readers)
  • NVD entry — Received on 30 November 2026; shows the CNA’s metric as its only score, no NVD score or CWE on 2 December 2026
  • Distribution trackers: Debian (bookworm and trixie vulnerable, forky and sid fixed in 7.3.6-1) · Ubuntu (Medium, needs evaluation in every release, no USN) · Red Hat (Important 7.8, bug 2586872, CWE-787, RHEL 10 affected) · SUSE and Alpine (both refused the automated reader on 2 December 2026)
  • CISA KEV catalogue 2026.11.30, not listed · EPSS 0.00211 (percentile 0.121) on 1 December 2026

Related reading

This advisory page was assembled from the primary sources listed above on 2 December 2026 and is updated when they change. The facts are theirs; the checks and the ordering are ours. If a row in the distribution table is out of date, the tracker link in that row is the current word.