GHSA-37m5-m4q3-fc6x: Froxlor: BIND Zone File Injection via TXT Record Content
SummaryThe `DomainZones.add` API endpoint does not sanitize newline characters in TXT record content. An authenticated customer with DNS editing enabled can inject newlines into TXT record values, which break out of the record line in the generated BIND zone file. This enables injection of arbitrary BIND directives (`$INCLUDE`, `$GENERATE`) and arbitrary DNS records (A, MX, CNAME) into the zone file written to disk by the DNS rebuild cron.This is an incomplete fix for CVE-2026-30932 (GHSA-x6w6-2xwp-3jh6), which patched the same newline injection for LOC, RP, SSHFP, and TLSA record types but did not patch TXT records.Affected Code`lib/Froxlor/Api/Commands/DomainZones.php`, lines 306-308:`Dns::encloseTXTContent()` (`lib/Froxlor/Dns/Dns.php:571-592`) only adds or removes surrounding quote characters. It does not strip newlines, carriage returns, or any BIND zone metacharacters.Line 148 of `DomainZones.php` still contains:The content flows to the zone file via `DnsEntry::__toString()` (`lib/Froxlor/Dns/DnsEntry.php:83`), which concatenates `$this->content` directly into the zone line followed by `PHP_EOL`. Embedded newlines in the content produce additional lines in the zone file output.Comparison with CVE-2026-30932 fixThe v2.3.5 fix for CVE-2026-30932 added validation functions for these types:| Type | Validation Added | Still Vulnerable? |
|------|-----------------|-------------------|
| LOC | `Validate::validateDnsLoc()` (strict regex) | No |
| RP | `Validate::validateDnsRp()` (domain validation) | No |
| SSHFP | `Validate::validateDnsSshfp()` (3-part split) | No |
| TLSA | `Validate::validateDnsTlsa()` (4-part split) | No |
| **TXT** | **`Dns::encloseTXTContent()` (quotes only)** | **Yes** |PoCEnvironmentFroxlor 2.3.5, clean Docker install (Debian Bookworm, PHP 8.2, Apache 2.4)DNS enabled (`system.bind_enable=1`, `system.dnsenabled=1`)Customer with `dnsenabled=1`, domain with `isbinddomain=1`Customer has an API key (or uses the web UI DNS editor with Burp)Reproduction via APIReproduction via Web UI (Burp)Log in as a customer with DNS editing enabledNavigate to Resources > Domains > (domain) > DNS EditorAdd a new record: Type = TXT, Record = @, Content = anyIntercept the POST request in Burp SuiteChange the `dns_content` parameter to: `v=spf1 +all"%0a$INCLUDE /etc/passwd`
(`%0a` is URL-encoded newline)Forward the requestResultThe API returns the generated zone content. The TXT record line is split at the newline, and `$INCLUDE /etc/passwd` appears on its own line as a BIND directive:When the DNS rebuild cron runs, BIND processes the `$INCLUDE` directive and attempts to read `/etc/passwd`.Variant: Arbitrary DNS record injectionThe same technique injects arbitrary A/MX/CNAME records:Result:`evil.testdomain.lab` now resolves to attacker IP `6.6.6.6`.Automated PoC ScriptUsage: `python3 poc.py https://panel.example.com API_KEY API_SECRET domain.tld`Impact**Information Disclosure**: `$INCLUDE` directs BIND to read arbitrary world-readable files on the server. The included content is parsed as zone data and can be retrieved by the customer via `DomainZones.listing` or DNS queries to records created from parsed file lines.**DNS Record Injection**: Newline breakout allows injection of A, MX, CNAME, and other records into the zone file. A customer can point subdomains to attacker-controlled IPs, intercept email via MX injection, or perform subdomain takeover via CNAME injection.**DNS Service Disruption**: Malformed zone content causes BIND to reject the zone, creating a DNS outage for the affected domain. `$GENERATE` directives can create massive record sets for amplification.Suggested FixStrip newlines and BIND metacharacters from TXT content. Minimal fix:A more comprehensive fix would add a validation function (similar to `validateDnsLoc`, `validateDnsSshfp`, etc.) that rejects any content containing zone metacharacters (`$`, newlines), and remove the TODO at line 148.
CVSS v3.1: 7.6