-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 NEFARIOUSPLAN-CANONICAL-V1 {"body_md":"In AOS-CX, inbound nginx terminates TLS on TCP/443 and proxies the management REST API to a Go backend, `hpe-restd`, on `127.0.0.1:5577`. The Go backend talks to OVSDB, the configuration database that holds every switch setting, every interface, every local account. nginx is the auth gate. A handful of `location` blocks are public-by-design: `login`, `certificate_login`, and the pre-auth banner. Everything else requires a session cookie. The login block, in `/etc/nginx/locations.d/login.conf`, was matched by this regex:\n\n```nginx\nlocation ~ ^/rest/(|v.*/)login {\n proxy_pass http://hpe-restd:5577;\n}\n```\n\nThe intent is \"empty version, or `v/`, then `login`.\" The implementation is what the regex engine reads. PCRE's `.` matches any character except newline; URIs do not contain newlines. `v.*/` greedily consumes arbitrary path content as long as some `/` survives before `login`. The trailing `login` is also unanchored on the right, so any token starting with `login` matches. The fix is six characters of regex grammar:\n\n```diff\n- location ~ ^/rest/(|v.*/)login\n+ location ~ ^/rest/(|v[0-9\\.]+/)login\n```\n\n`[0-9\\.]+` is a character class containing digits and the literal dot. Slashes are no longer matchable inside the version capture. The same edit lands on every public-by-design `location` block: `login.conf`, `certificate_login.conf`, and `banner.conf`. Three files, the same wrong line in each, the same fix in each.\n\n## The smuggle is what falls out\n\nThe legitimate login request has one segment after the version:\n\n```http\nPOST /rest/v10.10/login\n```\n\nThe regex matches: version capture `v10.10/`, then the literal `login`. nginx classifies the request as public, skips auth, and proxies to `hpe-restd`. Normal flow.\n\nThe smuggle expands the version capture:\n\n```http\nPOST /rest/v1/config/copy/running-config/loginpoc\n```\n\nThe regex still matches. The version capture greedily absorbs `v1/config/copy/running-config/`. The trailing `loginpoc` is the literal `login` followed by `poc`. nginx classifies *this* request as the login endpoint as well. Authentication is skipped.\n\nWhat nginx forwards to the backend is the **raw** `$request_uri`. The `proxy_pass.conf` in the same directory carries a developer comment acknowledging this. `hpe-restd` is a Go service using `gorilla/mux`. `gorilla/mux` does not look at the URI as a flat string. It parses segments and matches against route templates. The template `POST /rest/v1/config/copy/running-config/{name}` matches and extracts `{name} = \"loginpoc\"`. The handler asks OVSDB to snapshot the running configuration into a checkpoint named `loginpoc`. OVSDB does it, because the handler does not re-check auth. Auth was nginx's job, and nginx said yes.\n\nA second request reads the checkpoint back as JSON:\n\n```bash\ncurl -k https://switch.example.net/rest/v1/fullconfigs/loginpoc\n```\n\nThe version capture is now `v1/fullconfigs/`. The trailing `loginpoc` is still a `login*` token. The regex still says login. The backend resolves the route, reads OVSDB, and returns the full running configuration. The `User` table is in that JSON. The admin user is in the `User` table. The admin user's `password` field is the hashed credential.\n\n```python\nfor user, data in users.items():\n pw = data.get(\"password\", \"\")\n print(f\"[+] {user}: {pw[:60]}...\")\n```\n\nThat is the entire chain. Two requests, no authentication, the admin hash on stdout.\n\n## The auth gate and the router read the same URI\n\nThe CVE-2026-23813 description names the bug \"improper authentication, pre-auth bypass via nginx regex.\" The phrase is accurate and underspecifies the shape. The shape is this. nginx and `hpe-restd` both read the same bytes off the wire. nginx decides whether the request gets authenticated. `hpe-restd` decides what the request does. Both decisions are functions of the URI. The decisions are made by different code, and the different code uses different grammars to parse the URI.\n\nnginx's grammar is a PCRE regex written by hand. Its domain is the URI as an opaque string. `.` and `.*` are the operators the regex offers. The author chose `.*` for the version capture, which is \"any character except newline, zero or more times, greedy.\" That choice told the regex engine that segment boundaries do not exist for the purposes of this match.\n\n`hpe-restd`'s grammar is `gorilla/mux`'s route template parser. Its domain is the URI as a `/`-separated sequence of segments. `{name}` captures one segment, not several. The route template `/rest/v1/config/copy/running-config/{name}` matches only when the URI has exactly six segments arranged that way.\n\nBoth grammars are valid. Each is correct for its own purpose. The auth decision sits on top of the regex grammar, and the regex grammar is the one that lost the segment boundaries. The router kept them. That asymmetry is the bug.\n\nThis is the [Predicate Stringifies The Object](https://nefariousplan.com/patterns/predicate-stringifies-the-object) shape, in nginx PCRE instead of PHP or Java. The catalog has prior exhibits in each.\n\nChurchCRM's `AuthMiddleware` ran `str_contains($request->getUri(), 'api/public')` against PSR-7's URI-to-string serializer. The attacker put `api/public` in the query string. The gate's substring check fired on the full URL because `__toString()` returned scheme, authority, path, *and* query. PaperCut's `SecurityRequestFilter` ran an allowlist match against `HttpServletRequest::getRequestURI()`, which returns the URI with Servlet path parameters attached. The attacker wrote the allow-string into a path parameter. Tomcat's router stripped the parameter before routing. The gate never saw the strip happen.\n\nAOS-CX is the regex variant. The gate's predicate intends to test the action segment of the URI, which is the trailing `/`-separated component of the path. The implementation runs a regex against the URI as a flat string. The regex's `.*` does not constrain segment boundaries because the regex grammar does not know what a segment is. The router does. The bypass writes the gate's allow-string (`login`) into a segment position the gate did not know it was reading. That position is the trailing action segment of the path. The gate's regex matches it. The router parses it differently. The auth decision is wrong.\n\nThe structurally correct nginx idiom for a finite set of login URIs is `location =`, which performs exact-string matching:\n\n```nginx\nlocation = /rest/v10.10/login { ... }\nlocation = /rest/v10.13/login { ... }\nlocation = /rest/v10.16/login { ... }\nlocation = /rest/v10.17/login { ... }\n```\n\nFour lines, no metacharacters, no smuggle surface. The author who reached for `location ~` was solving for version-segment variance and adopted the rawest available form of \"predicate against URI.\" The form's freedom is its failure mode.\n\n## What the unauthenticated reach actually buys\n\nThe PoC's `exploit.py` demonstrates one chain: checkpoint create, full-config read, hash extracted. That is the conservative demonstration. The unauthenticated reach is wider.\n\nEvery route template behind `/rest/v1/...` that the backend dispatches by URI segment is callable through the smuggle, provided the trailing segment starts with `login`. The checkpoint endpoint accepts a `{name}` parameter; the smuggle picks `loginpoc` because that token satisfies both the nginx regex (it starts with `login`) and the backend's checkpoint-name validator. The `/system/users/{name}` endpoint, the `/system/aaa_server_groups/{name}` endpoint, the `/system/syslog_remotes/{host}` endpoint, every endpoint whose route template ends in a caller-named noun, is reachable the same way. The trailing token has to start with `login`; nothing else about the smuggle is constrained.\n\nAOS-CX is a switch operating system. The OVSDB configuration the smuggle exposes includes the L3 forwarding table, the ACLs that gate management traffic, the syslog destinations the admin would receive an alert through, and the credential store for every local account. A read primitive prints the admin hash. A write primitive, reached the same way, rewrites the management ACL, the syslog destination, or the local user table. The PoC author chose to demonstrate the read on 10.10.x because backend endpoint paths drifted across firmware branches. The smuggle itself is universal across every unpatched build.\n\n## The patch and the metacharacter\n\nThe patched regex is `^/rest/(|v[0-9\\.]+/)login`. The version capture is restricted to digits and dots. A URI whose version segment contains a slash no longer matches the public login `location` and falls through to the authenticated default. The same character class lands on `certificate_login.conf` and `banner.conf`. Three files, one diff each, all the same six characters.\n\nThe patch does not change the proxy_pass behavior. The raw `$request_uri` is still forwarded. The auth gate and the router still parse the URI by different grammars. The patch narrows the regex's domain enough that the disagreement between the two grammars no longer admits a bypass for the publicly-allowed actions. It does not close the disagreement. Anywhere else in the AOS-CX nginx config that an auth-relevant `location ~` regex was authored without thinking about which path elements `.` would and would not consume, the same shape is sitting unpatched. CVE-2026-23813 covers the three blocks the maintainer found.\n\nAffected branches and the build that closes each one:\n\n| Branch | Vulnerable through | Fixed in |\n|---------|--------------------|------------|\n| 10.17.x | 10.17.0001 | 10.17.1001 |\n| 10.16.x | 10.16.1020 | 10.16.1030 |\n| 10.13.x | 10.13.1160 | 10.13.1161 |\n| 10.10.x | 10.10.1170 | 10.10.1180 |\n\nPoC repo: [offseckit/CVE-2026-23813](https://github.com/offseckit/CVE-2026-23813). The artifact is post-patch independent analysis by 4252nez. The original vulnerability was reported via the HPE Bugcrowd program by moonv.","closing_line":"The auth gate is a regex. The router is a parser. The dot lost what the parser kept.","hook_md":"The AOS-CX REST management API runs behind nginx, and nginx decides whether to require authentication by matching the URI against a `location ~` regex. The login `location`'s regex carried the version capture `v.*/`. PCRE's `.` matches any character including `/`. The auth gate's regex accepts `config/copy/running-config/` as a version field, and forwards the request to the backend unauthenticated. The backend's router does not see a login request. It sees a checkpoint create.","post_id":451,"slug":"aos-cx-cve-2026-23813-the-dot-matched-slash","title":"CVE-2026-23813: AOS-CX's nginx Auth Gate Used `v.*/` for the Version Field. The Dot Matched Slash.","type":"initial","unreadable_sentence":"The auth gate's regex accepts `config/copy/running-config/` as a version field."} -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQRf0htP5+SjynlxywneZjl4jgkQJgUCanDVnQAKCRDeZjl4jgkQ Jv/PAP0XbHsOv2gtLG0dxhhzpjCzO/vOU6kiCH2MW8GsWZtzAwEAho1RnsnLOXrp VxCt1f7dnCbq07NTmGQrOyHuSIghTgI= =pPda -----END PGP SIGNATURE-----