← Lab /Security & privacy

Datadog agents enable rapid detection of CVE-2026-31431 page-cache corruption exploit

Their chained detection rules can reliably detect exploitation of CVE-2026-31431 in production environments.

Security & privacy Datadog Security Labs 28 May 2026 Defense Deployed evidence

Published as “From Exploit Code to Production Detection: Building a CVE-2026-31431 (Copy Fail) detection with Agents”

Why it matters

Operators can detect a high-impact unprivileged kernel exploit in near real time, reducing dwell time before mitigation.

Summary

The writeup explains the Copy Fail kernel exploit that lets an unprivileged user corrupt page-cache pages of any readable file via AF_ALG sockets and splice, achieving root code execution. Datadog built a three-stage state-machine detection using agent-side variables that tracks bind, setsockopt, and subsequent splice or open of privileged files. The detection was engineered, tested, and shipped within a single session using coding agents, and includes rate-limiting to curb event noise. Evidence is based on real-world exploit testing and deployment of the content pack on Datadog agents version 7.68+.

What they found 2

  1. The detection fires when a setuid binary is spliced after the full chain setup.

    “Stage 2a fires the detection when a setuid binary is spliced after the full chain setup.”

  2. A dual-variable cooldown is used to prevent dozens of events per exploit attempt.

    “Without rate limiting, a single exploitation attempt would generate dozens of agent events so the chained detection implements a dual-variable cooldown.”

Caveats 4

  • Hash-based monitoring may detect the corruption, but only if it reads the file while the corrupted page cache pages are still resident.
  • Stage 0 arms the chain when an unprivileged process binds an AF_ALG socket.
  • The detection chain relies on process.euid != 0, so privileged processes are not monitored.
  • The detection only covers files that are spliced or opened read-only and match the listed paths.

What’s new here 4

  • A three-stage chained detection rule that tracks AF_ALG socket creation, SOL_ALG setsockopt, and splicing of SUID or system files.
  • Use of coding agents to accelerate the entire detection engineering lifecycle from analysis to production in hours.
  • Coverage of both setuid binary corruption and PAM configuration tampering variants.
  • Built-in dual-variable cooldown to limit event volume during rapid exploit attempts.