CVE Professor
/
All CVEs
CVE-2026-142097

CVE-2026-142097 — CWE-125

CRITICAL CVSS 9.1 NVD

Swoole before 6.1.14 and 6.2.x before 6.2.7 contains an out-of-bounds read in onAccept() of swoole_http_server_coro.cc that mishandles requests prefixed with CRLFCRLF. Remote unauthenticated attackers can make getContent() return up to 64 KB of heap memory, leaking other connections' Authorization and Cookie headers or crashing the server.

Swoole before 6.1.14 and 6.2.x before 6.2.7 contains an out-of-bounds read in onAccept() of swoole_http_server_coro.cc that mishandles requests prefixed with CRLFCRLF. Remote unauthenticated attackers can make getContent() return up to 64 KB of heap memory, leaking other connections' Authorization and Cookie headers or crashing the server.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality High C:H
Integrity None I:N
Availability High A:H
AI Security Analysis & Remediation

🎯 What is this vulnerability?

Technical Flaw:
This is a classic Out-of-Bounds Read (OOB Read) vulnerability, classified under CWE-125. The flaw resides in the onAccept() function within swoole_http_server_coro.cc, a core component of the Swoole extension for PHP.

Root Cause Analysis:
The Swoole HTTP server coroutine implementation fails to correctly validate the length and content of the initial HTTP request buffer when it encounters a specific sequence: CRLF CRLF (\r\n\r\n) at the very beginning of the payload.
1. Input Validation Failure: When onAccept() processes the incoming socket data, it likely assumes a standard HTTP request structure (Method + Space + URI). However, if the buffer starts with CRLF CRLF, the internal pointer arithmetic or string length calculation is mishandled.
2. Memory Corruption: This mishandling causes the internal getContent() method to return a pointer to a heap buffer that is not properly bounded. Instead of returning the actual (empty or malformed) request body, it returns a chunk of adjacent heap memory.
3. Information Disclosure: The returned data can be up to 64 KB of raw heap memory. In a multi-connection server environment (like Swoole), this heap memory often contains data from other concurrent connections. This includes sensitive headers such as Authorization: Bearer <token> and Cookie: session_id=... from other users.
4. Denial of Service: If the OOB read accesses unmapped memory pages, it triggers a segmentation fault, crashing the Swoole worker process and potentially the entire server.

CVSS Vector Breakdown:

  • AV:N (Network): Exploitable remotely via standard HTTP requests.

  • AC:L (Low Complexity): No race conditions or complex timing required; simply sending a malformed header sequence triggers it.

  • PR:N (No Privileges): Unauthenticated access is sufficient.

  • UI:N (No User Interaction): No victim action required.

  • S:U (Unchanged Scope): The impact is confined to the vulnerable application/server.

  • C:H (High Confidentiality): Leaks sensitive data (auth tokens, cookies) from other sessions.

  • I:N (None Integrity): No modification of data.

  • A:H (High Availability): Can crash the server.
  • ⚡ Attack Chain

    1. Discovery & Reconnaissance

  • Target Identification: The attacker scans for services running PHP with the Swoole extension. This can be identified by:
  • * Response headers: Server: swoole or specific Swoole-related headers. * Error pages: Swoole-specific error messages (e.g., "Swoole HTTP Server"). * Port scanning: Common PHP ports (80, 443, 8080, 9501).
  • Version Fingerprinting: The attacker attempts to determine the Swoole version. While Swoole doesn't always expose its version in headers, the attacker can assume any version < 6.1.14 or 6.2.x < 6.2.7 is vulnerable. If the version cannot be confirmed, the attack is still attempted due to the low complexity.
  • 2. Exploitation

    The attacker sends an HTTP request where the body or the initial part of the stream starts with CRLF CRLF. The exact mechanism depends on how Swoole buffers the initial read. Typically, this involves sending a minimal HTTP request with a malformed body or a specific header configuration that triggers the onAccept() parser to misinterpret the buffer start.

    Illustrative PoC (curl):
    Note: The exact byte sequence may vary slightly based on the Swoole version's internal buffering, but the core trigger is the CRLF CRLF prefix in the context of the onAccept() handler.

    # Illustrative PoC: Sending a request with a body starting with CRLF CRLF
    # The -d flag sends the data as the body. We prepend \r\n\r\n to the body.
    # In some implementations, the vulnerability might be triggered by a malformed header line, 
    # but the CVE specifies "requests prefixed with CRLFCRLF", implying the start of the payload.
    
    curl -v -X POST http://target-server:8080/ \
      -H "Content-Type: application/octet-stream" \
      --data-binary $'\r\n\r\nAAAA'

    Alternative Trigger (if the prefix is in the header section):
    If the "prefix" refers to the start of the raw TCP stream, the attacker might send:

    # Raw TCP payload
    printf "\r\n\r\nGET / HTTP/1.1\r\nHost: target\r\n\r\n" | nc target-server 8080

    Result:
    The server responds with a 200 OK (or similar) status, but the response body contains up to 64 KB of heap memory. The attacker parses this response to extract:

  • Authorization: Bearer eyJhbGciOi... (JWT tokens from other users)

  • Cookie: PHPSESSID=abc123; session_token=xyz789 (Session cookies)
  • 3. Post-Exploitation

  • Session Hijacking: The attacker uses the leaked Authorization headers or Cookie values to impersonate other users. This allows access to their accounts, data, and potentially administrative functions if an admin session is leaked.
  • Lateral Movement: If the leaked tokens are for internal services (e.g., microservices communicating via HTTP), the attacker can pivot to internal systems.
  • Denial of Service: If the OOB read causes a crash, the attacker can repeatedly send the payload to keep the server down, impacting availability.
  • 🌍 Real World Impact

    Confidentiality (High): This is the most severe impact. In multi-tenant SaaS applications, e-commerce platforms, or any web app using Swoole for high-concurrency HTTP handling, an attacker can steal authentication credentials of any* user currently connected to the server. This is a critical breach of trust and data privacy.

  • Integrity (None): The vulnerability does not allow modification of data.

  • Availability (High): The server can be crashed by triggering a segmentation fault. This can lead to downtime, loss of in-flight requests, and potential service disruption.
  • Practical Consequences:

  • Mass Account Takeover: Attackers can harvest thousands of user sessions in a short period.

  • Data Breach: Leaked tokens can be used to access sensitive user data (PII, financial info).

  • Service Disruption: Repeated exploitation can lead to a DoS condition.
  • 🛡️ Remediation & Mitigation

    1. Upgrade (Primary Fix)

  • Affected Versions: Swoole < 6.1.14 and Swoole 6.2.x < 6.2.7.
  • Action: Immediately upgrade Swoole to version 6.1.14 or 6.2.7 (or later).
  • * For PHP 8.1/8.2 users: Upgrade to Swoole 6.1.14+. * For PHP 8.3+ users: Upgrade to Swoole 6.2.7+. Note: Verify compatibility with your PHP version before upgrading.*

    2. Workarounds (If Immediate Upgrade is Not Possible)

  • WAF/ModSecurity Rule: Block requests that start with CRLF CRLF in the body or have malformed header structures.
  • ModSecurity Rule Example:*
    SecRule REQUEST_BODY "@pm \r\n\r\n" "id:100001,phase:2,deny,status:403,msg:'Blocked Swoole OOB Read Attempt'"

    Note: This may have false positives if legitimate applications send binary data starting with CRLF. Test thoroughly.*

  • Access Restriction: If the Swoole server is only intended for internal use, restrict access to trusted IP ranges using firewall rules (iptables/nftables).

  • Disable Swoole HTTP Server: If the application does not strictly require Swoole's HTTP server (e.g., it can use Nginx/Apache + PHP-FPM), disable the Swoole HTTP server and use a traditional web server. This eliminates the vulnerable code path.
  • 3. Detection

  • Web Server Logs: Look for HTTP requests with unusual body content or malformed headers.
  • Log Pattern:* POST / HTTP/1.1 with a body starting with \r\n\r\n. Example Log Entry:*
    192.168.1.100 - - [02/Dec/2026:10:00:00 +0000] "POST / HTTP/1.1" 200 65536 "-" "curl/7.68.0"

    Note: A response size of 65536 (64 KB) for a simple POST request is a strong indicator of the OOB read.

  • Network Traffic Analysis: Monitor for HTTP responses with unusually large bodies (up to 64 KB) for requests that should have small or no bodies.

  • Crash Logs: Check for segmentation faults in Swoole worker processes.

  • Log Pattern:* Segmentation fault (core dumped) in Swoole worker logs.

    ⚠️ Urgency

  • CVSS Score: 9.1 (CRITICAL)
  • CISA KEV: No (Not currently listed in the Known Exploited Vulnerabilities catalog, but this does not reduce urgency given the criticality).
  • Exploit Complexity: Low. The payload is simple and can be automated easily.
  • Patching Priority: IMMEDIATE.
* This vulnerability allows unauthenticated attackers to steal sensitive data (auth tokens, cookies) from other users. This is a severe security risk for any production environment. * Action: Upgrade Swoole to the fixed version within 24-48 hours. If immediate upgrade is not possible, implement WAF rules and restrict access to the Swoole server.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)
PoC & Exploit Intelligence (GitHub)
swoole/swoole-src Reference
Technical reference / advisory repository for CVE-2026-142097
Technical reference / advisory repository for CVE-2026-142097
Technical reference / advisory repository for CVE-2026-142097
Technical reference / advisory repository for CVE-2026-142097
Technical reference / advisory repository for CVE-2026-142097
Technical reference / advisory repository for CVE-2026-142097
CVSS Score
9.1 / 10 · CVSS CRITICAL
Weakness Types (CWE)
Related CVEs
7.1
CVE-2026-144604
PostGIS through 3.7.0 contains an out-of-bounds read vulnerability in RASTER_reclass that allows low-privilege
6.9
CVE-2026-145084
FreeRDP before 3.33.1 contains a global buffer overflow in location_send() in the client location dynamic chan
6.5
CVE-2026-129966
A single authenticated API request can terminate the Velociraptor server process. When a tool URL uses the smb
6.5
CVE-2026-129964
An authenticated Velociraptor client can crash the Velociraptor frontend by sending a malformed VQLResponse me
6.3
CVE-2026-144778
A security vulnerability has been detected in Simon OpenOBJ3D up to f5a522c409428de7bf68844cf8951522e3d09485.
5.9
CVE-2026-120376
An **out-of-bounds read** flaw has been found in the process_host_announce() function in source3/nmbd/nmbd_inc
5.3
CVE-2026-144605
PostGIS through 3.7.0 contains an out-of-bounds read vulnerability in rtpg_chartrim that allows low-privileged