Null byte truncation in PHP DNS functions allows unexpected lookups
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- —
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub.
Summary
PHP (php-src) DNS functions, including dns_get_record(), do not check for null bytes in their input. A string containing a null byte is truncated at that point, so the function queries a different hostname than the caller passed. An attacker who controls the input can therefore make the server look up an unexpected name, which can lead to server-side request forgery. The impact is low.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
### Summary As GHSA-3cr5-j632-f35r, same null termination is occuring ### Details dns_get_record() and other DNS functions don't have any null contain check, leads potential SSRF or unexpected behavior. ### PoC ```php <?php var_dump(dns_get_record("php.net\0aa")); ``` Result: DNS records of `php.net` Expect: Fails to call ### Security impact (Even though it's too low but,) Probability of SSRF
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | php-src | < 8.1.34 | 8.1.34 | Patch available | GHSA-www2-q4fc-65wf |
| — | php-src | < 8.2.30 | 8.2.30 | Patch available | GHSA-www2-q4fc-65wf |
| — | php-src | < 8.3.29 | 8.3.29 | Patch available | GHSA-www2-q4fc-65wf |
| — | php-src | < 8.4.16 | 8.4.16 | Patch available | GHSA-www2-q4fc-65wf |
| — | php-src | < 8.5.1 | 8.5.1 | Patch available | GHSA-www2-q4fc-65wf |
- php-src Vendor— Affected < 8.1.34 Fixed in 8.1.34 Patch available GHSA-www2-q4fc-65wf
- php-src Vendor— Affected < 8.2.30 Fixed in 8.2.30 Patch available GHSA-www2-q4fc-65wf
- php-src Vendor— Affected < 8.3.29 Fixed in 8.3.29 Patch available GHSA-www2-q4fc-65wf
- php-src Vendor— Affected < 8.4.16 Fixed in 8.4.16 Patch available GHSA-www2-q4fc-65wf
- php-src Vendor— Affected < 8.5.1 Fixed in 8.5.1 Patch available GHSA-www2-q4fc-65wf
Remediation
Upgrade php-src to version 8.1.34, 8.2.30, 8.3.29, 8.4.16 or 8.5.1, the first fixed version in each branch. The sources list no vendor advisory identifier for this fix.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-www2-q4fc-65wf php-src Fixed in 8.1.34 Advisory →
- Fix · GHSA-www2-q4fc-65wf php-src Fixed in 8.2.30 Advisory →
- Fix · GHSA-www2-q4fc-65wf php-src Fixed in 8.3.29 Advisory →
- Fix · GHSA-www2-q4fc-65wf php-src Fixed in 8.4.16 Advisory →
- Fix · GHSA-www2-q4fc-65wf php-src Fixed in 8.5.1 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-www2-q4fc-65wf
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences