Skip to content

About

CVE-2026-113425 — nginx mail proxy use-after-free triggered by TCP RST during IMAP auth. Affects nginx 0.5.33–1.31.8. Docker PoC lab.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

CVE CVSS CWE Language Status Author


Metadata

Field Value
CVE ID CVE-2026-113425
Product nginx Mail Proxy (IMAP module)
Affected Version nginx 1.31.8
Vulnerability Type IMAP Mail Proxy UAF / Worker Crash / DoS
CVSS 3.1 Score 8.1 (High)
CWE CWE-416 — Use After Free
Patch 1.31.9

Description

The nginx mail proxy module frees the upstream connection struct when the backend sends a TCP RST, but the downstream IMAP session handler retains a dangling pointer to it. Concurrent IMAP sessions that provoke upstream RST during AUTH responses can dereference freed memory, causing a SIGSEGV in the nginx mail proxy worker.


Root Cause Analysis

CWE-416 (Use After Free) — The upstream RST handler in the mail proxy module deallocates the upstream connection object without notifying the downstream IMAP session handler, which continues to reference the freed struct through a cached pointer in the session context.


Attack Flow

flowchart LR
    A([Attacker]) -->|Concurrent IMAP AUTH + upstream RST| B[/nginx mail proxy module/]
    B -->|CWE-416: freed upstream struct| C[Downstream IMAP handler UAF]
    C -->|Worker SIGSEGV| D([Mail proxy DoS])
    E([Patch: 1.31.9]) -.->|Mitigation| B

    style A fill:#1a0810,color:#e94560
    style D fill:#3d0015,color:#fff
    style E fill:#0d2b1a,color:#4ade80
Loading

PoC Usage

docker compose up -d --build
python poc.py --variant rst --concurrency 8 --waves 10 -H imap://localhost:143

Arguments

Flag Description
-H / --host Target nginx IMAP proxy URL
--variant rst / close_notify / stall (default: rst)
--concurrency Simultaneous IMAP sessions (default: 8)
--waves Attack waves (default: 10)
-v / --verbose Verbose output

Detection

  • Monitor nginx mail proxy logs for worker crashes during AUTH phases
  • Alert on upstream IMAP backend sending excessive RST packets
  • Track nginx worker respawn frequency for the mail proxy process
  • Inspect IMAP proxy connection logs for correlated upstream RST + crash events

Remediation

  1. Update nginx to 1.31.9 or later
  2. Add upstream IMAP backend health checks to detect and reroute from unstable backends
  3. Set proxy_timeout values to limit hanging sessions
  4. Run nginx mail proxy workers in an isolated process group

Legal Disclaimer

This tool is developed exclusively for authorized penetration testing and security research. Use against systems without explicit permission is illegal. The user assumes all legal responsibility.


Author: cveForge | License: MIT | Organization: cveForge

process exited with code 0  •  researched by cveForge

About

CVE-2026-113425 — nginx mail proxy use-after-free triggered by TCP RST during IMAP auth. Affects nginx 0.5.33–1.31.8. Docker PoC lab.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages