Back to Intelligence

CVE-2026-142096: Critical CVSS 9.1 Swoole Redis Server OOB Read — Detection and Remediation Guide

SA
Security Arsenal Team
December 2, 2026
11 min read

NVD has published CVE-2026-142096, a CVSS 9.1 (Critical) vulnerability in Swoole — the popular asynchronous, coroutine-based PECL extension for PHP that powers high-performance TCP servers, including a Redis-protocol-compatible server implementation. The flaw is an out-of-bounds read in php_swoole_redis_server_onReceive() caused by trusting RESP (REdis Serialization Protocol) bulk string lengths supplied by the client without validating them against the actual buffer size.

Let me be precise about scope, because the headline is misleading: this is not a vulnerability in the Redis database server itself. It affects the Swoole swoole_redis_server component — applications that use Swoole to emulate a Redis server and speak the RESP protocol. If your organization runs PHP services built on Swoole (hyperf, imi, easyswoole, custom TCP gateways) that expose a Redis-protocol listener, you are in the blast radius. The vulnerability is remotely exploitable over the network, requires no authentication and no user interaction, and allows two distinct impacts:

  1. Memory disclosure — an attacker announces an oversized bulk string length, causing the worker to read past the end of the received buffer and return adjacent heap memory to the attacker in the protocol response. Heap memory in a PHP worker can contain session data, credentials, keys, and request payloads from other connections.
  2. Denial of service — an attacker supplies a negative length value, triggering a crash of the worker process.

Given that the affected code path is reachable before any authentication (the flaw is in protocol parsing, not command handling), any Swoole Redis server listener exposed to a network segment an attacker can reach — including the open internet, if misconfigured — is exploitable. Treat this as an emergency patch item.

Affected Products and Versions

ProductAffected VersionsFixed Versions
Swoole (PECL extension for PHP)All releases before 6.1.146.1.14
Swoole 6.2.x branch6.2.0 through 6.2.66.2.7

Any PHP application that loads the vulnerable Swoole extension and instantiates a Redis-protocol server (e.g., Swoole\Redis\Server) is affected. Frameworks that build on Swoole — including Hyperf and similar coroutine frameworks — inherit the exposure if they enable the Redis server component. Applications that use Swoole purely for HTTP/WebSocket servers are not exposed through this specific code path, but upgrading is still recommended since the fix ships in the same extension binary.

Technical Analysis: How the Vulnerability Works

The Protocol Trust Problem

RESP, the wire protocol used by Redis, encodes bulk strings as:

Code
$<length>\r\n<payload>\r\n

The $ prefix declares the byte length of the payload that follows. In php_swoole_redis_server_onReceive(), Swoole's Redis server parses this declared length and uses it as the trusted size of data to read and echo/process — without validating that the declared length matches the bytes actually present in the receive buffer, and without guarding against negative or absurdly large values.

From a defender's perspective, the attack chain is trivial:

  1. Reconnaissance: Attacker identifies a Swoole Redis server listener (default or custom TCP port) via banner grabbing or protocol probing. The RESP handshake is unauthenticated at the parsing layer.
  2. Exploitation — memory disclosure: The attacker sends a crafted bulk string header declaring a length far larger than the payload actually transmitted (e.g., $1048576\r\n followed by a few bytes). The parser reads past the end of the receive buffer into adjacent worker heap memory and reflects that memory back in the response. Repeated requests with varying offsets allow heap scraping — harvesting secrets, pointers, or data from co-tenant connections handled by the same worker.
  3. Exploitation — denial of service: Alternatively, the attacker sends a negative length (e.g., $-999999\r\n), which drives the length arithmetic into invalid territory and crashes the worker. Repeated crashes across the worker pool constitute a reliable, low-bandwidth DoS.

Why the CVSS 9.1 Is Justified

  • Attack Vector: Network — exploitable over TCP with a handful of crafted bytes.
  • Attack Complexity: Low — no race conditions, no heap grooming required; the length field is trusted verbatim.
  • Privileges Required: None — the vulnerable code runs during protocol parsing, before any auth check.
  • User Interaction: None.
  • Impact: High Confidentiality (heap memory disclosure) and High Availability (worker crash), with no integrity impact — hence the 9.1 rather than 9.8.

Memory disclosure vulnerabilities in long-lived server workers are historically under-prioritized by defenders because they don't yield shells — but in a heap you find what the process handles: DB credentials, API tokens, TLS session material, PII in flight. Treat this with the same urgency as an RCE in terms of patch scheduling.

Exploitation Status

At the time of writing, NVD lists CVE-2026-142096 with public technical detail sufficient to reproduce the flaw (the vulnerable function and the length-trust behavior are documented). We assess functional exploit code is trivially derivable — the "exploit" is a malformed RESP header, craftable with nc or a three-line Python script. There is no confirmed CISA KEV listing as of publication, but the low exploitation bar and wide Swoole deployment footprint (particularly across APAC-origin PHP microservices and game/IoT backends) make opportunistic scanning likely. Assume scanners will add this to their RESP probes within days.

Detection & Response

What You Can Realistically Detect

A veteran SOC mindset applies here: an out-of-bounds read triggered by a malformed RESP length is not something endpoint EDR will see directly. The useful observables are:

  1. Network/protocol layer: malformed RESP bulk-string headers — declared lengths that exceed sane bounds or are negative — are detectable by Zeek/Suricata protocol analysis or any full-packet capture feeding your SIEM. This is the highest-fidelity signal.
  2. Process layer: Swoole worker crash loops (SIGSEGV) from negative-length requests — visible in syslog, dmesg, systemd journal, or supervisor restart logs.
  3. Behavioral layer: the vulnerable process (php with swoole.so loaded) listening on a Redis-protocol port and receiving a high rate of short-lived connections from a single source — the signature of heap-scraping iteration.

SIGMA Rules

YAML
---
title: Swoole PHP Worker Crash Loop — Possible CVE-2026-142096 DoS Exploitation
id: a1f4e2b8-3c6d-4e9a-b7d1-8f2c5a9e0d34
status: experimental
description: Detects repeated segmentation faults of PHP workers running the Swoole extension, consistent with negative RESP bulk-string length exploitation of CVE-2026-142096 crashing swoole_redis_server workers.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-142096
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.impact
  - attack.t1499
logsource:
  category: process_event
  product: linux
detection:
  selection_msg:
    Message|contains:
      - 'segfault'
      - 'SIGSEGV'
      - 'core dumped'
  selection_proc:
    ProcessName|contains:
      - 'php'
  condition: selection_msg and selection_proc
falsepositives:
  - Legitimate PHP application bugs causing worker crashes
  - Composer or CLI PHP processes crashing for unrelated reasons
level: high
---
title: Malformed RESP Bulk String Header — CVE-2026-142096 Heap Disclosure Attempt
id: c7d2a1f4-9b3e-4f8c-a2d6-5e1b8c0f7a29
status: experimental
description: Detects network IDS/protocol analyzer alerts for RESP bulk string headers declaring oversized or negative lengths against a Redis-protocol listener, indicative of CVE-2026-142096 memory disclosure or worker crash attempts against Swoole redis_server.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-142096
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.exploitation
  - attack.t1190
logsource:
  category: network
  product: zeek
detection:
  selection:
    resp_bulk_length_declared: '>=131072'
  selection_negative:
    resp_bulk_length_declared: '<0'
  condition: selection or selection_negative
falsepositives:
  - Legitimate large Redis bulk writes (e.g., backup restores, big payloads) — tune threshold to your baseline
level: high
---
title: High-Rate Short-Lived Connections to Redis-Protocol Port — Heap Scraping Behavior
id: e3b8d6a1-2f4c-4a9e-b1d7-6c0f3e8a5b12
status: experimental
description: Detects a single external source initiating a high volume of short-lived TCP connections to a Redis-protocol service port, consistent with iterative heap-memory scraping via CVE-2026-142096 against a Swoole redis_server worker.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-142096
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.exploitation
  - attack.t1190
logsource:
  category: firewall
product: linux
detection:
  selection:
    dst_port:
      - 6379
      - 6380
    connection_state: 'retransmission'
    duration: '<1s'
  condition: selection
falsepositives:
  - Health checks and load balancer probes — suppress known LB source IPs
level: medium

A note on the network rule: the RESP length-threshold rule assumes you have Zeek or equivalent protocol parsing feeding your SIEM. If you don't, prioritize the crash-loop rule and the KQL hunt below. Don't deploy a rule you can't feed — that's how rules die in a drawer.

KQL Hunt (Microsoft Sentinel / Defender)

Assuming syslog ingestion from your Linux Swoole hosts and CEF firewall logs into Sentinel:

KQL — Microsoft Sentinel / Defender
// Hunt 1: PHP worker segfaults on Swoole hosts — CVE-2026-142096 DoS indicator
Syslog
| where TimeGenerated > ago(24h)
| where ProcessName contains "php" or SyslogMessage contains "php"
| where SyslogMessage has_any ("segfault", "SIGSEGV", "core dumped")
| summarize CrashCount = count(), firstSeen = min(TimeGenerated), lastSeen = max(TimeGenerated) by Computer, ProcessName
| where CrashCount >= 3
| order by CrashCount desc;

// Hunt 2: Short-lived connection churn to Redis-protocol ports (heap-scraping behavior)
CommonSecurityLog
| where TimeGenerated > ago(6h)
| where DestinationPort in (6379, 6380)
| summarize ConnCount = count(), DistinctSources = dcount(SourceIP) by DestinationIP, DestinationPort
| where ConnCount > 500
| order by ConnCount desc;

// Hunt 3: Confirm Swoole extension presence via process command lines (inventory for exposure)
DeviceProcessEvents
| where TimeGenerated > ago(7d)
| where ProcessCommandLine has_any ("swoole", "redis_server")
| summarize by DeviceName, FileName, ProcessCommandLine

The third query is the one I'd run first in most environments: most teams don't know whether Swoole's redis_server component is instantiated anywhere. Find the exposure before you hunt the exploit.

Velociraptor VQL

For endpoint-level verification on Linux Swoole hosts — enumerate listening processes and identify whether a vulnerable Swoole build is accepting RESP traffic:

VQL — Velociraptor
-- Identify processes listening on Redis-protocol ports and capture their binary/version context
SELECT Pid, Name, { select Address, Port, State from netstat() where Pid = pslist.Pid } as Connections
FROM pslist()
WHERE Name =~ 'php'

-- Companion artifact: check loaded Swoole extension version via php modules
-- Run as a server-side hunt with execve-enabled client or pair with the bash remediation script below
SELECT Pid, Name, CommandLine, Exe
FROM pslist()
WHERE CommandLine =~ 'swoole'
   OR Exe =~ '/php'
VQL — Velociraptor
-- File artifact: locate swoole.so extension binaries to validate patched versions fleet-wide
SELECT FullPath, Size, Mtime
FROM glob(glob='/*/*/*/swoole.so')

(Adjust the glob for your PHP extension directory layout — e.g., /usr/lib/php/*/swoole.so or /usr/lib64/php/modules/swoole.so.)

Remediation

1. Patch — Immediately

Upgrade the Swoole extension to a fixed release:

  • 6.1.x branch → 6.1.14 or later
  • 6.2.x branch → 6.2.7 or later
Bash / Shell
#!/usr/bin/env bash
# CVE-2026-142096 — Swoole redis_server OOB read verification & remediation
set -euo pipefail

# --- Step 1: Report current Swoole version (if installed)
echo "[+] Checking installed Swoole version..."
php --ri swoole 2>/dev/null | grep -i "version" || echo "[!] Swoole extension not detected via php --ri"

# --- Step 2: Identify the compiled extension binary on disk
find /usr/lib /usr/lib64 /usr/local/lib -name 'swoole.so' 2>/dev/null || echo "[!] swoole.so not found on this host"

# --- Step 3: Flag vulnerable versions (before 6.1.14, or 6.2.0–6.2.6)
VER=$(php -r 'echo phpversion("swoole");' 2>/dev/null || echo "none")
echo "[+] Detected Swoole version: ${VER}"
if [[ "${VER}" != "none" ]]; then
  if [[ "${VER}" =~ ^6\.2\.([0-6])$ ]] || [[ ! "${VER}" =~ ^6\.1\.1[4-9]$ && "${VER}" < "6.1.14" ]]; then
    echo "[!!] VULNERABLE: ${VER} is affected by CVE-2026-142096. Upgrade required."
  else
    echo "[OK] Version ${VER} appears patched."
  fi
fi

# --- Step 4: Upgrade via PECL (preferred on most distros)
# pecl channel-update pecl.php.net
# pecl install swoole-6.2.7   # or swoole-6.1.14 for the 6.1 branch

# --- Step 5: Restart PHP-FPM / Swoole services so the patched .so loads
# systemctl restart php-fpm || systemctl restart your-swoole-app.service

Verify post-patch with php -r 'echo phpversion("swoole");' and confirm the extension binary timestamp updated.

2. If You Can't Patch Today — Compensating Controls

  • Disable the component: If nothing in your application uses Swoole\Redis\Server, remove/disable that instantiation. Most Swoole deployments use HTTP or WebSocket servers only — confirm before you panic.
  • Network isolation: Redis-protocol listeners should never be internet-facing. Enforce ACLs/security groups restricting the listener port to trusted application subnets. This single control takes the attack vector from "anyone" to "someone already inside your trust boundary."
  • Front-door protocol filtering: If an L7-aware WAF/LB fronts the service, drop any RESP bulk header with a declared length < 0 or above your application's legitimate maximum payload size.
  • Process supervision: Ensure workers restart under a supervisor with rate-limited restart (prevents crash-loop amplification), and alert on >3 crashes/hour per worker — that's your DoS tripwire.
  • Memory-safety hygiene: Where feasible, isolate Redis-server workers from workers handling other sensitive connections, limiting heap adjacency exposure if disclosure occurs pre-patch.

3. Validate After Patching

  • Send a malformed RESP bulk header (oversized length, truncated payload) against a staging instance of the patched build — a correct fix returns an error or closes the connection rather than reflecting heap bytes.
  • Run a heap-diff check: responses to truncated bulk strings must contain only protocol error text, never uninitialized bytes.

4. Strategic Findings

This CVE is a clean illustration of a recurring class of bug: protocol parsers trusting client-declared lengths. If you operate any custom TCP protocol servers — Swoole or otherwise — this is your cue to audit length-field validation across your stack. Heap-disclosure bugs are quiet; you won't know you've been scraped until the credentials walk out the door.

Related Resources

Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.