Skip to content

Add AF_ALG socket creation detection for CVE-2026-31431 kernel privilege escalation#5969

Open
gkazimiarovich wants to merge 8 commits into
SigmaHQ:masterfrom
gkazimiarovich:CVE-2026-31431-af-alg-socket-creation
Open

Add AF_ALG socket creation detection for CVE-2026-31431 kernel privilege escalation#5969
gkazimiarovich wants to merge 8 commits into
SigmaHQ:masterfrom
gkazimiarovich:CVE-2026-31431-af-alg-socket-creation

Conversation

@gkazimiarovich
Copy link
Copy Markdown
Contributor

@gkazimiarovich gkazimiarovich commented Apr 30, 2026

Summary of the Pull Request

Adds a new Sigma rule to detect creation of AF_ALG (Address Family 38) sockets via the Linux socket() syscall as captured by auditd. AF_ALG is the Linux kernel crypto API userspace interface, exploited in CVE-2026-31431 for local privilege escalation via via a buffer overflow in the AF_ALG AEAD splice path that corrupts the page cache of SUID binaries.

This socket type has near-zero legitimate usage in production environments. Testing across ~500M CreateSocket events showed zero AF_ALG baseline activity. The rule was validated against a live exploit execution on Ubuntu 24.04 (kernel 6.17) with auditd syscall monitoring enabled.

Requires auditd rule: auditctl -a always,exit -F arch=b64 -S socket -k af_alg_detect

Changelog

new: Linux AF_ALG Socket Creation - Kernel Crypto API Exploit Indicator

Example Log Event

type=SYSCALL msg=audit(1777535219.002:917): arch=c000003e syscall=41 success=yes exit=4 a0=26 a1=80005 a2=0 a3=79b79360f868 items=0 ppid=7987 pid=8275 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=pts0 ses=41 comm="python3" exe="/usr/bin/python3.12" subj=unconfined key="socket_creation"

Key fields:

  • syscall=41socket()
  • a0=26 → 0x26 = 38 decimal = AF_ALG
  • a1=80005 → SOCK_SEQPACKET | SOCK_CLOEXEC (AEAD cipher mode)
  • comm="python3" → exploit delivered via interpreter
  • uid=1000 → non-root user initiating the exploit

Fixed Issues

N/A - New rule submission.

SigmaHQ Rule Creation Conventions

  • If your PR adds new rules, please consider following and applying these conventions

@github-actions github-actions Bot added Rules Review Needed The PR requires review Linux Pull request add/update linux related rules labels Apr 30, 2026
@gkazimiarovich gkazimiarovich force-pushed the CVE-2026-31431-af-alg-socket-creation branch 3 times, most recently from 9e2dfce to fcf82f8 Compare April 30, 2026 08:21
@gkazimiarovich gkazimiarovich force-pushed the CVE-2026-31431-af-alg-socket-creation branch from fcf82f8 to 91ec652 Compare April 30, 2026 08:39
Comment thread rules/linux/auditd/syscall/lnx_auditd_af_alg_socket_creation.yml Outdated
Comment thread rules/linux/auditd/syscall/lnx_auditd_af_alg_socket_creation.yml Outdated
nasbench and others added 2 commits April 30, 2026 13:01
Co-authored-by: phantinuss <79651203+phantinuss@users.noreply.github.com>
Co-authored-by: phantinuss <79651203+phantinuss@users.noreply.github.com>
@swachchhanda000 swachchhanda000 added this to the Sigma-May-Release milestone May 6, 2026
@swachchhanda000 swachchhanda000 added Ready to Merge and removed Review Needed The PR requires review labels May 6, 2026
Comment thread rules/linux/auditd/syscall/lnx_auditd_af_alg_socket_creation.yml
Comment thread rules/linux/auditd/syscall/lnx_auditd_af_alg_socket_creation.yml Outdated
Comment thread rules/linux/auditd/syscall/lnx_auditd_af_alg_socket_creation.yml Outdated
Comment thread rules/linux/auditd/syscall/lnx_auditd_af_alg_socket_creation.yml
Copy link
Copy Markdown
Collaborator

@swachchhanda000 swachchhanda000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this behaviour is very specific and reliable indicator of this particular CVE, then it should be an Emerging Threats(ET) rule.

Co-authored-by: frack113 <62423083+frack113@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Linux Pull request add/update linux related rules Ready to Merge Rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants