Copy Fail Detection Logic
This document explains the technical implementation of the CVE-2026-31431 (Copy Fail) detection mechanism in the Txlog Agent.
Overview
The CVE-2026-31431 vulnerability resides in the Linux kernel's AF_ALG socket implementation, specifically within the authencesn (Authenticated Encryption with Serial Number) algorithm. It allows an unprivileged user to write arbitrary data into the page cache of files they only have read access to.
Detection Strategy
The Txlog Agent implements a non-destructive live detection strategy. Unlike version-based checks, this actually verifies the behavior of the running kernel without modifying any system files.
Phase 1: Proof-of-Bug (The Write Test)
The goal of this phase is to determine if the kernel incorrectly handles the splice() system call when used with AF_ALG.
- Setup: The agent creates a temporary file in
/tmpcontaining a specific marker string. - Pipeline: It sets up an
AF_ALGsocket usingauthencesn. - Splice: It uses
splice()to move data from the file into the socket, and then attempts to usesplice()again to move data back into the file's page cache. - Verification: After the operation, the agent reads the file. If the content has changed (specifically, if the marker has been overwritten), it proves the kernel is vulnerable to page cache corruption.
Phase 2: Privilege Escalation Assessment
Even if a kernel is vulnerable, the practical risk depends on whether the attacker can target sensitive files.
- Target Identification: The agent searches for common
setuid-rootbinaries (e.g.,/usr/bin/sudo). - Open for Read: It attempts to open these binaries for reading (which is allowed for unprivileged users).
- Pipe Validation: It verifies if a
splice()pipeline can be successfully established between theAF_ALGsocket and the sensitive binary. - Safety Guarantee: The agent never calls
recv()in this phase. Without therecv()call, the kernel never actually performs the write operation to the sensitive file, ensuring the test is 100% safe for production environments.
Integration with Txlog Ecosystem
Background Execution
The detection logic is integrated into the core build flow. Every time the agent synchronizes transactions, it performs a quick check of the system's vulnerability status.
Data Reporting
The results are sent to the Txlog Server as part of the execution metadata:
copy_fail: Boolean indicating if Phase 1 failed (system is vulnerable).copy_fail_escalation: Boolean indicating if Phase 2 confirmed the escalation path.copy_fail_details: Technical details about which binaries were tested.
Low-Level Implementation Details
To ensure compatibility across different RHEL-based distributions, the agent uses raw syscalls via the golang.org/x/sys/unix package for:
SYS_ACCEPT: Standardaccept4flags are sometimes rejected byAF_ALGsockets.SYS_SETSOCKOPT: Used to bypass standard library limitations when settingALG_SET_KEYandALG_SET_AEAD_AUTHSIZE.SYS_SPLICE: Direct control over pipe splicing.
