InfraRunBook
    Back to articles

    CVE-2026-136412: OpenResty stream-lua-nginx-module use-after-free via receiveuntil() - affected versions and fix

    CVE Advisories
    Published: Nov 24, 2026
    Updated: Nov 24, 2026

    CVE-2026-136412 is a use-after-free in OpenResty stream-lua-nginx-module before 0.0.20rc4. A garbage-collected receiveuntil() iterator can leave a stale pointer that crashes or corrupts the nginx worker. Upgrade to 0.0.20rc4 or later.

    CVE-2026-136412: OpenResty stream-lua-nginx-module use-after-free via receiveuntil() - affected versions and fix

    At a glance

    • CVE ID(s): CVE-2026-136412
    • Severity: CVSS v4.0 score 9.2 (CRITICAL), vector
      CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
      . CVSS v3.1 score 8.1 (HIGH), vector
      CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
      . Both scores are from VulnCheck.
    • Vendor / product: OpenResty / stream-lua-nginx-module
    • Affected versions: All versions before 0.0.20rc4
    • Fixed / patched versions: 0.0.20rc4 (the first version not listed as affected)
    • Exploited in the wild: No known exploitation (not listed in CISA KEV)
    • Attack vector: Network. No authentication needed. No user interaction. Attack complexity is rated high.
    • Published by: VulnCheck (CNA), published 2026-11-24
    • Official advisory: VulnCheck advisory

    What is this vulnerability?

    CVE-2026-136412 is a use-after-free (CWE-416) in the stream-lua-nginx-module. This is the OpenResty module that embeds Lua into the nginx stream (TCP) subsystem.

    The bug is in the cosocket

    receiveuntil()
    call. That call returns a pattern iterator, a Lua function you call to read data until a delimiter matches. The module keeps a pointer from the socket to that iterator's compiled pattern.

    The Lua garbage collector can free the iterator while the socket still references it. If the connection is then interrupted or closed, later reads or the socket close can use the stale pointer. That is access to freed memory. The result can be a crash or memory corruption in the nginx worker process.

    The fix commits change how the module tracks the pattern:

    • The socket's link to the pattern is detached after each read, because the iterator may be collected as soon as the read returns to Lua.
    • The link is also cleared when the read side of the socket is finalized.
    • The pattern is attached to the socket later in the iterator setup, after the earlier steps in that function.

    How does it affect you?

    The advisory describes the impact as a crash or corruption of the nginx worker. VulnCheck scores confidentiality, integrity and availability impact as high. The advisory text only states crash or corruption. It does not describe code execution or data disclosure.

    The realistic risk depends on your setup:

    • Attack complexity is rated high. The trigger depends on garbage-collection timing and on the remote peer interrupting or closing the cosocket connection at the right moment.
    • The most reliable outcome is a worker crash. nginx normally restarts crashed workers, but repeated crashes can drop active connections and degrade your TCP service.
    • Memory corruption in a long-lived worker is harder to reason about. Treat any unexplained worker crash on an affected host as suspicious.

    No exploitation in the wild is known. It is not in CISA KEV. Still, a CVSS v4.0 score of 9.2 means you should schedule the upgrade soon, not leave it for routine maintenance.

    Who is affected?

    You are affected if all of these are true:

    • You run nginx or OpenResty with stream-lua-nginx-module, version before 0.0.20rc4.
    • Your Lua code in the stream subsystem uses cosocket
      receiveuntil()
      . Examples are code under
      content_by_lua_block
      or
      preread_by_lua_block
      that reads from an upstream or other TCP socket.
    • The cosocket connection can be influenced by a remote peer, for example by being closed or interrupted.

    The advisory does not say that the HTTP module (ngx_http_lua_module) is affected. This CVE is about the stream module only. If you only use Lua in

    http
    blocks, this CVE does not apply to that code path, but check whether a stream block also exists.

    How to check if you are vulnerable

    First, find out whether the stream Lua module is in your build. Run this to list the build options and look for lua entries:

    nginx -V 2>&1 | tr ' ' '\n' | grep -i lua
    openresty -V 2>&1 | tr ' ' '\n' | grep -i lua

    Use whichever binary you run. If the module is built as a dynamic module, also check the

    load_module
    lines in your nginx configuration.

    Next, find out which module version you have. The advisory does not give a command for this. Check your OpenResty or package version and compare the bundled stream-lua-nginx-module version with 0.0.20rc4. Your vendor or package maintainer should be able to tell you. If you built from source, check the source tree you used.

    Then look for usage. Search your configuration and Lua files for

    receiveuntil
    :

    grep -rn receiveuntil /etc/nginx /usr/local/openresty

    Adjust the paths to where your configs and Lua files live. A hit inside stream-context Lua code on a vulnerable module version means you are exposed.

    How to fix and recover

    1. Upgrade stream-lua-nginx-module to 0.0.20rc4 or later. If you use OpenResty packages, install a build that bundles the fixed module. If your package does not yet include it, ask your vendor. Do not assume a distribution package has the fix.
    2. Rebuild and reload. If you compile nginx with the module, rebuild with the fixed source. A configuration reload does not replace the binary, so restart nginx with the new binary.
    3. Verify. Confirm the new binary is running and that the bundled module is 0.0.20rc4 or later. Re-run the build-option check above. Then test your stream services under normal traffic.
    4. Review for signs of impact. Check the nginx error log for worker crashes (signal messages such as segmentation faults) from before the upgrade. Repeated crashes on a stream listener are a sign someone may have been probing it.

    The advisory does not report data theft or code execution. If you saw unexplained crashes and your stream service handles sensitive data, consider rotating any credentials or keys that the Lua code handles. Restore a known-good configuration if you find unexpected changes.

    The upstream fixes are in two commits: 7581c68 and 9591e20. The fixed release is v0.0.20rc4. Applying the commits to an older source tree is possible, but moving to the release is safer.

    Workarounds and mitigations

    The advisory lists no official workarounds. Upgrading is the fix.

    If you cannot upgrade right away, these general steps may reduce exposure. They are not vendor-approved:

    • Restrict who can reach affected stream listeners with firewall rules or
      allow
      /
      deny
      controls, so only trusted peers connect.
    • Where it is practical, avoid
      receiveuntil()
      in stream Lua code until the module is patched.
    • Keep process supervision and alerting on, so worker crashes are noticed fast.

    What to monitor

    • nginx error logs for worker processes exiting on a signal, especially segmentation faults, and repeated worker respawns.
    • Sudden resets or drops on stream (TCP) services that use Lua.
    • Unusual patterns of connections that open and then close or abort early on those listeners.
    • Core dumps from nginx workers, if you collect them. Keep them for analysis.
    • The OpenResty release notes and your distribution's security feed for a packaged fix.

    References

    Frequently Asked Questions

    Which versions of stream-lua-nginx-module are affected by CVE-2026-136412?

    All versions before 0.0.20rc4 are listed as affected. Version 0.0.20rc4 contains the fix.

    Is CVE-2026-136412 being exploited in the wild?

    No known exploitation. It is not listed in CISA's Known Exploited Vulnerabilities catalog.

    What is the impact of CVE-2026-136412?

    A remote peer can cause access to freed memory, which can crash or corrupt the nginx worker process. The advisory does not describe code execution.

    Is there a workaround for CVE-2026-136412?

    The advisory lists no workarounds. Upgrade to 0.0.20rc4 or later. Until then, restrict access to affected stream listeners and avoid receiveuntil() where practical.

    Does this affect the HTTP Lua module?

    The advisory only names stream-lua-nginx-module, the stream (TCP) module. It does not say the HTTP module is affected.

    Related Articles

    CVE-2026-123903: VMware vCenter Server authentication bypass - affected versions and fix

    CVE-2026-123903 is a critical (CVSS 9.8) authentication bypass in the VMware Directory Service used by VMware vCenter Server. Broadcom lists fixed releases for vCenter 9.1, 9.0 and 8.0, VMware Cloud Foundation 5.x and the Telco Cloud products.

    CVE-2026-123910, CVE-2026-123911, CVE-2026-123912: VMware ESX critical I/O filter and XHCI flaws - affected versions and fix

    Broadcom disclosed three critical VMware ESX flaws: two in the I/O filter service (CVSS 9.8, network-reachable, no authentication) and one in the XHCI USB controller (CVSS 9.3). Fixed builds are available for ESX 9.1, 9.0 and 8.0, VCF 5.x and Telco Cloud Platform.

    CVE-2026-123172: SolarWinds Serv-U privilege escalation to root on Linux - affected versions and fix

    CVE-2026-123172 is a privilege escalation flaw in SolarWinds Serv-U 2026.3 and earlier. It can lead to root on Linux installs, and the risk is lower on Windows. SolarWinds fixed it in Serv-U 2026.4.

    CVE-2026-82321 and 7 more: SolarWinds Serv-U privilege escalation flaws - affected 2026.3 and below, fixed in 2026.4

    SolarWinds disclosed eight privilege escalation flaws in Serv-U 2026.3 and earlier. Each lets a domain administrator or higher gain more access. SolarWinds fixed all eight in Serv-U 2026.4. No exploitation is known.

    CVE-2026-134624: N-able MailAssure (SpamExperts) SSRF in relay LDAP sync check - affected versions and fix

    CVE-2026-134624 is a server-side request forgery flaw in N-able MailAssure (SpamExperts) before 20261121.1943. An authenticated API user can make the server probe internal hosts and ports and send crafted data to internal services. It is listed in CISA KEV.

    CVE-2026-116561, CVE-2026-95517, CVE-2026-118028: Apache Tomcat auth, cluster encryption and rewrite flaws - affected versions and fix

    Three CVSS 9.1 flaws affect Apache Tomcat 9.0, 10.1 and 11.0. They cover Jakarta Authentication error handling, EncryptInterceptor cluster encryption and RewriteValve redirect handling. Upgrade to 11.0.29, 10.1.62 or 9.0.124.