CVE-2026-125283: NGINX worker overflows a buffer when try_files and alias share a map’s regex captures

ByLinuxtastic

December 1, 2026 #CVE, #NGINX

A worker process in NGINX dies when a request hits a location that combines three ordinary directives in an unlucky way: try_files, alias, and a map variable whose value came from a regular-expression capture. F5’s record says that “certain combinations of regular expression captures in map and try_files can cause a segmentation fault in an NGINX worker process”; nginx.org calls the same entry a “buffer overflow when using alias with try_files”, and the record’s weakness is CWE-191, an integer underflow, which is how an offset into the aliased path goes wrong. The attacker is an unauthenticated web client; the effect is a dead worker, which the master replaces, and dropped connections for as long as the requests keep coming. Every release since 0.9.6 carries the code. F5 scores it 6.9 on CVSS 4.0 and 5.3 on 3.1; Red Hat and SUSE rate it Moderate. Upgrade to 1.31.9 or 1.30.7, or the distribution package that backports the fix, and restart; until then, use named captures in map and try_files and do not reuse a capture variable across regexes, which is F5’s workaround.

CVE-2026-125283 at a glance.

ComponentNGINX, the HTTP core: try_files and alias in a location, with a map that uses regex captures (the record’s affected module is “the map directive with regex matching”); the data plane only, no control-plane exposure per F5. On Ubuntu’s 14.04 and 16.04 builds the code is in ngx_http_core_module.c, since try_files only moved to its own module in 1.13.4
Affected versionsNGINX Open Source 0.9.6 up to 1.31.8, including 1.30.0 to 1.30.6 and every distribution build; NGINX Plus 37.0.0 up to 37.0.8.1, 37.1.0 up to 37.3.0.1, and the R33 line as F5 lists it
Fixed inNGINX Open Source 1.31.9 (18 November 2026) and 1.30.7; NGINX Plus 37.3.0.1 and 37.0.8.1; the CHANGES entry says “a buffer overflow might occur in a worker process when using the try_files and alias directives in certain configurations”, credited to Marc Luchian and Liviu-Alexandru Bud; Ubuntu names upstream commits b99b6b5 and d1ffe6f, Debian the release-1.30.7 fix. Distribution backports: Debian 1.22.1-9+deb12u11 and 1.26.3-3+deb13u11, Ubuntu 1.30.4-7ubuntu1.3 / 1.28.3-2ubuntu1.14 / 1.24.0-2ubuntu7.21 / 1.18.0-6ubuntu14.24, Red Hat Hardened Images 1.30.7-1.hum1
SeverityF5 CVSS 4.0 6.9 Medium (AV:N/AC:L/AT:N/PR:N/UI:N/VA:L) and CVSS 3.1 5.3 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L), CWE-191 (integer underflow); NVD Analyzed on 19 November with F5’s metrics. Red Hat Moderate, 5.3, CWE-476; Ubuntu Medium; SUSE moderate, 5.3 and 6.9. Alpine’s tracker refused our reader
Exploited in the wildNot on CISA’s Known Exploited Vulnerabilities list as of 1 December 2026 (catalogue 2026.11.27). EPSS 0.0044 (39th percentile) on 19 November 2026; CISA’s SSVC record marks it automatable
Who is exposedany HTTP server whose configuration has a location with both alias and try_files where a map with regex captures feeds either of them, a pattern found in multi-site and multi-tenant setups that compute a document root per host or per path. The attacker needs only to send requests that reach that location. Servers without alias, without try_files, or whose maps use literal keys are not on the path; Red Hat’s rating note calls it a non-default configuration with a worker-only outcome
PublishedCVE record 18 November 2026 (F5); this page built 1 December 2026, last updated 1 December 2026

What it is

alias replaces the matched part of a location’s URI with another path, and try_files checks a list of candidate files, built from variables, before falling through to a last resort. Both compute file paths from the request, and both can take their pieces from a map whose keys are regular expressions and whose values reuse the captures ($1, $2 or named ones). NGINX keeps one set of numbered captures per request, and a regex evaluated later overwrites the captures a regex evaluated earlier set. The record says certain combinations of captures “in map and try_files” fault the worker, and gives the weakness as an integer underflow: a length computed for the aliased path from one set of captures is applied to a path built from another, the subtraction goes negative, and the copy that follows runs off its buffer, which is nginx.org’s “buffer overflow” and NVD’s “segmentation fault”. The record does not spell out that chain and F5’s K000163933 rendered only a script shell for our reader, so the precise arithmetic is not reproduced here; the workaround F5 gives, below, is what says the captures are the trigger.

The affected range is as wide as it gets for NGINX: 0.9.6, from 2011, through every stable and mainline release until the November fix, and every distribution package. Ubuntu’s note points out that on its oldest supported builds the code lives in ngx_http_core_module.c because try_files only became its own module in 1.13.4, and it shipped fixes back to 14.04 under Pro. The outcome is bounded: one worker dies per triggering request, the master process starts another, and connections that worker held are dropped. On a busy server that is a denial of service a client can sustain with a loop.

F5’s workaround is specific: “Avoid unnamed regex captures; use named captures instead. Do not reuse the same capture variable in other regex matches or for other purposes.” Named captures ((?<name>…)) are per-regex, so a later match cannot clobber the ones an earlier map set. This is one of the NGINX advisories of 18 November 2026, written up one CVE per page on this site; the siblings linked below share the 1.31.9 and 1.30.7 releases and the same distribution updates.

Who is affected on Linux

Each row is what the distribution’s own security tracker said on 1 December 2026; the link in the row is the tracker page, which will be newer than this one.

DistributionStatusFixed package
AlpineTracker page refused our reader on 1 December 2026—
DebianFixed in bookworm’s security update (DLA-4918-1) and trixie’s (DSA-6642-1); the plain bookworm (1.22.1-9+deb12u9) and trixie (1.26.3-3+deb13u10) rows vulnerable; forky and sid are marked fixed at 1.30.6-4 and 1.30.6-6, which predate the upstream 1.30.7 fix the tracker’s own note cites, so this page does not count them as fixedbookworm 1.22.1-9+deb12u11; trixie 1.26.3-3+deb13u11
UbuntuMedium; fixed on 22.04 to 26.10 (USN-9182-1 of 20 November) and on 14.04 to 20.04 for Ubuntu Pro26.10 1.30.4-7ubuntu1.3; 26.04 1.28.3-2ubuntu1.14; 24.04 1.24.0-2ubuntu7.21; 22.04 1.18.0-6ubuntu14.24; 20.04 1.18.0-0ubuntu1.7+esm6; 18.04 1.14.0-0ubuntu1.11+esm7; 16.04 1.10.3-0ubuntu0.16.04.5+esm12; 14.04 1.4.6-1ubuntu3.9+esm11
RHEL, Rocky, Alma, CentOS StreamModerate, 5.3, CWE-476 (bug 2576463); nginx fix deferred on RHEL 8 (nginx:1.24), 9 (base, nginx:1.24, nginx:1.26) and 10; the Hardened Images nginx-main build fixed (RHSA-2026:100838, 21 November); no mitigation offeredHardened Images nginx-main-1.30.7-1.hum1; nothing for RHEL on 1 December 2026
openSUSE/SLEmoderate, 5.3 / 6.9, Pending (bug 1290876); released for openSUSE Tumbleweed; SLE 15 SP4 to SP7 packages in QA (1.21.5-150400.3.28.1, 150600.10.30.1), SLES 16.x in progress, Leap 16.0 and 16.1 affectedTumbleweed 1.31.9-1.1 (openSUSE-Tumbleweed-2026-12599); nothing released for SLE or Leap on 1 December 2026
nginx.org packages, Docker images, NGINX Plus, source buildsThe upstream releases apply1.31.9 (mainline) / 1.30.7 (stable); NGINX Plus 37.3.0.1 or 37.0.8.1

How to check

Three questions, in order: which build is running and is it below the fix, which locations combine alias with try_files, and do the maps that feed them use numbered captures. The third is the trigger F5 names, and it is the one you can change today.

# 1. the running build and how it was configured (fixed: 1.31.9 / 1.30.7, or the distribution backport in the table)
nginx -v 2>&1
nginx -V 2>&1 | tr ' ' '\n' | grep -E '^--with-(stream|http_v2|http_v3|http_ssl)' | sort
pgrep -a nginx | head -3; readlink /proc/$(pgrep -o -x nginx)/exe

# 2. locations that have both alias and try_files (print each location block that contains both)
nginx -T 2>/dev/null | awk '/^\s*location /{blk=$0; a=0; t=0} /^\s*alias /{a=1} /^\s*try_files /{t=1} a&&t&&!p[blk]++{print blk}'

# 3. maps with regex keys and numbered captures, and try_files lines that use $1-style captures
nginx -T 2>/dev/null | awk '/^\s*map /,/\}/' | grep -nE '^\s*~|\$[0-9]'
nginx -T 2>/dev/null | grep -nE '^\s*(try_files|alias) .*\$[0-9]'

# has a worker been dying already?
journalctl -u nginx --since -7d 2>/dev/null | grep -ciE 'worker process .* exited on signal 11|segfault'
grep -c 'exited on signal 11' /var/log/nginx/error.log 2>/dev/null

A build at or above the fixed version for its line, or a distribution package at the backported version, is done after a restart. A configuration with no location that has both alias and try_files is not on the path. One that has such a location, fed by a map with numbered captures, is the case this page is about; and a count of workers already exiting on signal 11 in the last week says whether somebody, or some crawler, has found it before you.

How to fix it

Upgrade and restart; Debian, Ubuntu, Tumbleweed and Red Hat’s Hardened Images all shipped before 1 December 2026, while RHEL’s own packages were deferred and SUSE’s SLE packages were in QA. A configuration reload does not pick up a new binary.

# Debian (DLA-4918-1 / DSA-6642-1) / Ubuntu (USN-9182-1)
apt update && apt install --only-upgrade nginx && systemctl restart nginx
# openSUSE Tumbleweed (SLE: when the QA packages are released)
zypper patch && systemctl restart nginx
# nginx.org packages: 1.31.9 mainline or 1.30.7 stable
dnf upgrade nginx && systemctl restart nginx
nginx -v 2>&1; readlink /proc/$(pgrep -o -x nginx)/exe

Where the package has to wait, apply F5’s workaround in the configuration: give every regex capture in the affected maps and try_files lines a name, and never reuse a capture variable in another regex or for another purpose. That is a mechanical edit and it survives the upgrade. What not to do: do not remove try_files from a location to “mitigate” without replacing its fall-through behaviour, since that is usually what keeps a directory listing or a 404 from becoming a different file; and do not read the 5.3 as meaning the worker crash is harmless on a server where one worker carries the long-lived connections.

# mitigation: named captures instead of numbered ones, in map and in try_files
#   before:  map $host $site { ~^(.+)\.example\.com$ $1; }   try_files /sites/$site/$uri …;
#   after:   map $host $site { ~^(?<sub>.+)\.example\.com$ $sub; }   try_files /sites/$site/$uri …;
nginx -t && nginx -s reload
nginx -T 2>/dev/null | grep -nE '^\s*(try_files|alias) .*\$[0-9]' || echo 'no numbered captures left in try_files/alias'

Sources

  • CVE-2026-125283 at CVE.org — the F5 record (18 November 2026): the description, the named-captures workaround, the affected ranges, CVSS 4.0 6.9 and 3.1 5.3, CWE-191
  • nginx.org security advisories — “Buffer overflow when using alias with try_files”, vulnerable 0.9.6–1.31.8, not vulnerable 1.31.9+ and 1.30.7+ · nginx CHANGES — the 1.31.9 entry of 18 November 2026 with the credit · F5 K000163933, which rendered only a script shell for our reader
  • NVD entry — Analyzed, F5’s two vectors, CWE-191 and the CPE ranges
  • Distribution trackers: Debian (DLA-4918-1, DSA-6642-1) · Ubuntu (USN-9182-1, fixes back to 14.04, the core-module note) · Red Hat (Moderate, fix deferred on RHEL, Hardened Images RHSA-2026:100838) · SUSE (moderate, Tumbleweed released, SLE in QA)
  • CISA KEV catalogue 2026.11.27, not listed · EPSS score for this CVE, 19 November 2026

Related reading

This advisory page was assembled from the primary sources listed above on 1 December 2026 and is updated when they change. The facts are theirs; the checks and the ordering are ours. If a row in the distribution table is out of date, the tracker link in that row is the current word.