Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-31677

CVE-2026-31677: Linux Kernel Privilege Escalation Flaw

CVE-2026-31677 is a privilege escalation vulnerability in the Linux Kernel crypto subsystem that affects the af_alg RX buffer handling. This article covers technical details, affected versions, security impact, and mitigation.

Updated:

CVE-2026-31677 Overview

CVE-2026-31677 is a Linux kernel vulnerability in the af_alg cryptographic socket subsystem. The flaw exists in af_alg_get_rsgl(), which extracts data into receive (RX) scatterlists without bounding each extraction against the remaining receive buffer budget. A local, authenticated user can trigger improper receive-side accounting, causing the kernel to attach more data to a request than the receive buffer can accommodate. When skcipher cannot obtain enough RX space for at least one chunk while more data remains, the prior logic rounds the request length down to zero instead of rejecting the call.

Critical Impact

Local users can trigger a high-availability impact in the Linux kernel cryptographic API, leading to denial of service through faulty receive buffer accounting in af_alg.

Affected Products

  • Linux Kernel 7.0-rc1 through 7.0-rc7
  • Linux Kernel stable branches referenced in upstream fix commits
  • Distributions shipping kernels built with CONFIG_CRYPTO_USER_API enabled

Discovery Timeline

  • 2026-04-25 - CVE-2026-31677 published to NVD
  • 2026-05-06 - Last updated in NVD database

Technical Details for CVE-2026-31677

Vulnerability Analysis

The vulnerability resides in the AF_ALG socket family, which exposes the kernel cryptographic API to userspace via the socket() interface. The function af_alg_get_rsgl() is responsible for pinning user memory into an RX scatterlist (SGL) so the kernel crypto subsystem can write cipher output back to userspace buffers.

In the affected code path, af_alg_get_rsgl() invokes af_alg_readable() only as a gate before extracting data into the RX scatterlist. The function does not constrain each extraction to the remaining af_alg_rcvbuf(sk) budget. As a result, the amount of data attached to the request can exceed the receive-side accounting budget tracked for the socket.

For skcipher operations, when insufficient RX space is available to satisfy at least one chunk while more data remains to be processed, the original implementation silently rounds the request length down to zero rather than rejecting the recvmsg() call. This mismatch between attached data and tracked budget produces inconsistent kernel state and availability impact during cryptographic transformations.

Root Cause

The root cause is missing budget enforcement during scatterlist extraction. af_alg_get_rsgl() treats af_alg_readable() as a binary precondition rather than as a continuous accounting constraint applied to each extraction loop iteration.

Attack Vector

Exploitation requires local access and low privileges. An attacker opens an AF_ALG socket, binds it to a cipher such as skcipher, and issues crafted sendmsg() and recvmsg() sequences. By submitting request sizes that interact adversely with the receive buffer budget, the attacker drives the kernel into the unbudgeted extraction path, producing availability impact on the host.

The vulnerability is described in prose only because no public proof-of-concept exploit code is available. See the upstream patch commits at Kernel Git Commit 07c6f6f and Kernel Git Commit 9bf3e6c for technical details of the corrected accounting logic.

Detection Methods for CVE-2026-31677

Indicators of Compromise

  • Unexpected process creation of AF_ALG sockets by non-cryptographic workloads, observable via socket(AF_ALG, ...) system call telemetry
  • Kernel log entries indicating recvmsg rejections or anomalous skcipher request handling on affected kernels
  • Repeated short-read patterns from user processes interacting with /proc/crypto-backed transforms

Detection Strategies

  • Audit running kernel versions against the fixed commit hashes (07c6f6f, 4a264b2, 8eceab1, 9bf3e6c) using configuration management or vulnerability scanners
  • Enable Linux Audit (auditd) rules on the socket syscall with the AF_ALG family to baseline legitimate users of the kernel crypto API
  • Correlate spikes in soft-lockup, RCU stall, or OOM messages on systems exposing AF_ALG to unprivileged users

Monitoring Recommendations

  • Monitor kernel ring buffer (dmesg) for crypto subsystem warnings and af_alg-related stack traces
  • Track per-process system call rates targeting AF_ALG sockets; legitimate consumers are typically limited to cryptsetup, strongSwan, and similar utilities
  • Forward kernel telemetry to a centralized analytics platform to baseline normal AF_ALG usage and alert on deviations

How to Mitigate CVE-2026-31677

Immediate Actions Required

  • Update the Linux kernel to a version that includes the upstream fixes referenced in commits 07c6f6f, 4a264b2, 8eceab1, and 9bf3e6c
  • Inventory hosts running Linux Kernel 7.0 release candidates and prioritize them for patching
  • Restrict access to AF_ALG sockets on multi-tenant systems where untrusted local users are present

Patch Information

The fix modifies af_alg_get_rsgl() to limit each RX scatterlist extraction to the remaining af_alg_rcvbuf(sk) budget, ensuring receive-side accounting matches the amount of data attached to the request. When skcipher cannot obtain enough RX space for at least one chunk while more data remains, the patched code rejects the recvmsg call instead of rounding the request length down to zero. The corrected logic is available in Kernel Git Commit 07c6f6f, Kernel Git Commit 4a264b2, Kernel Git Commit 8eceab1, and Kernel Git Commit 9bf3e6c.

Workarounds

  • Disable the CONFIG_CRYPTO_USER_API_SKCIPHER and related AF_ALG kernel options if userspace crypto API access is not required
  • Block module loading of algif_skcipher using modprobe blacklists on systems that do not depend on AF_ALG
  • Apply seccomp filters or SELinux/AppArmor policies that deny socket(AF_ALG, ...) calls for untrusted processes
bash
# Configuration example
# Blacklist AF_ALG skcipher module to mitigate exposure
echo 'blacklist algif_skcipher' | sudo tee /etc/modprobe.d/blacklist-afalg.conf
echo 'install algif_skcipher /bin/true' | sudo tee -a /etc/modprobe.d/blacklist-afalg.conf

# Verify installed kernel version against fixed commits
uname -r
sudo dmesg | grep -i af_alg

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.