-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 NEFARIOUSPLAN-CANONICAL-V1 {"body_md":"## The TODO Predates Two CVEs\n\nThe comment was added on May 11, 2016 by Froxlor's maintainer Michael Kaufmann in commit [`d1106dd9`](https://github.com/froxlor/froxlor/commit/d1106dd9844370670689c05b94e5b6c7f58f8225), inside `dns_editor.php`. It read:\n\n```php\n// TODO regex validate record and content for invalid characters\n```\n\nOne week later (commit [`b14ab6b1`](https://github.com/froxlor/froxlor/commit/b14ab6b1c1dcb4b3ca2995a498600d81527a04f6), May 18, 2016) Kaufmann acted on the record half by adding a domain-validation call below the comment, and split the content half into a standalone TODO:\n\n```php\n// TODO regex validate content for invalid characters\n```\n\nThat line has been the codebase's testimony about a known sanitization gap since that day. It moved with the surrounding logic into `lib/classes/api/commands/class.DomainZones.php` on March 19, 2018 (commit [`190c95ba`](https://github.com/froxlor/froxlor/commit/190c95bacae679b68265214166c5256045ac6c7e), \"created DomainZones ApiCommand\") when the API surface was first carved out of `dns_editor.php`, and again into `lib/Froxlor/Api/Commands/DomainZones.php` in December 2018 (commit [`4c27efa4`](https://github.com/froxlor/froxlor/commit/4c27efa4ae494a3a707b0973c48b6c28b7678fbc), \"put Api-Commands into namespaces\") when the codebase was reorganized under PSR-style namespaces. Both moves preserved the comment verbatim. Through two file renames and a major architectural reorganization, the TODO stood three lines above the per-record-type dispatch chain, unedited and unacted on.\n\n## The First Patch Wrote Four Per-Spec Validators\n\nCVE-2026-30932 was reported against the same dispatch chain. At 2.3.4 (pre-patch), five branches of `DomainZones::add()` had been written as placeholders:\n\n```php\n} elseif ($type == 'LOC' && !empty($content)) {\n $content = $content;\n} elseif ($type == 'MX') {\n // ...\n} elseif ($type == 'RP' && !empty($content)) {\n $content = $content;\n} elseif ($type == 'SSHFP' && !empty($content)) {\n $content = $content;\n} elseif ($type == 'TLSA' && !empty($content)) {\n $content = $content;\n} elseif ($type == 'TXT' && !empty($content)) {\n $content = Dns::encloseTXTContent($content);\n}\n```\n\nFour `$content = $content;` lines is the typographic signature of a developer who knew where the per-type handler was supposed to go and never wrote it. The TXT branch was structurally different: it called `Dns::encloseTXTContent($content)`, a helper that wraps the value in quote characters when the DNS backend is BIND and strips them when the backend is PowerDNS, and does nothing else.\n\nKaufmann's February 24, 2026 patch ([`b34829262`](https://github.com/froxlor/froxlor/commit/b34829262dc32818b37f6a1eabb426d0b277a86b)) replaced each of the four tautologies with a per-spec validator:\n\n```diff\n } elseif ($type == 'LOC' && !empty($content)) {\n- $content = $content;\n+ if (!Validate::validateDnsLoc($content)) {\n+ $errors[] = lng('error.dns_loc_invalid');\n+ }\n } elseif ($type == 'RP' && !empty($content)) {\n- $content = $content;\n+ if (!Validate::validateDnsRp($content)) {\n+ $errors[] = lng('error.dns_rp_invalid');\n+ }\n } elseif ($type == 'SSHFP' && !empty($content)) {\n- $content = $content;\n+ if (!Validate::validateDnsSshfp($content)) {\n+ $errors[] = lng('error.dns_sshfp_invalid');\n+ }\n } elseif ($type == 'TLSA' && !empty($content)) {\n- $content = $content;\n+ if (!Validate::validateDnsTlsa($content)) {\n+ $errors[] = lng('error.dns_tlsa_invalid');\n+ }\n```\n\nThe accompanying `Validate::validateDnsLoc()` is a multi-clause regex that demands latitude degrees, minutes, seconds, hemisphere, then longitude degrees, minutes, seconds, hemisphere, then altitude, then optional precision fields, all in RFC 1876 syntax. `validateDnsRp` splits the content on whitespace and asserts that the two halves are valid domain names. `validateDnsSshfp` checks algorithm, fingerprint-type, and hex-digest structure. `validateDnsTlsa` checks usage, selector, matching-type, and certificate-association field shape.\n\nThe four functions reject newlines. The rejection is not the point of the function. The functions enforce per-record-type syntactic grammars; a newline fails the grammar for the same reason that the string `potato` fails it. The author was thinking about format conformance, not about characters that escape the BIND zone file.\n\n## The Patch Was Committed Sixty-Five Lines Below The Comment\n\nThe TODO comment is at line 148 of `DomainZones.php`. The first hunk of commit `b34829262` lands at line 211 and edits the LOC branch starting at line 213. The TODO is sixty-five lines above the patch, in the same file the patch was open in, written by the same author who wrote the comment. The author wrote four new validators below the cursor and did not write the regex the comment named above it.\n\nThe TXT branch sits at line 306, eight lines below the last hunk of the February patch. The patch did not edit it. `Dns::encloseTXTContent` remained the entire validation surface for the only record type whose RFC-defined content is \"one or more character-strings\" with no further constraint.\n\n## The Sink Was Always Line-Oriented\n\nEvery TXT record's `$content` flows into the BIND zone file through `DnsEntry::__toString()`:\n\n```php\npublic function __toString()\n{\n $_content = $this->content;\n // TXT multiline split for content >= 255 bytes, elided\n return $this->record . \"\\t\" . $this->ttl . \"\\t\" . $this->class\n . \"\\t\" . $this->type . \"\\t\"\n . (($this->priority >= 0 && ($this->type == 'MX' || $this->type == 'SRV'))\n ? $this->priority . \"\\t\" : \"\")\n . $_content . PHP_EOL;\n}\n```\n\nThe concatenation interpolates `$_content` between tabs and ends the line with `PHP_EOL`. The result is `fwrite`'d raw into the customer's zone file by the BIND cron's `walkDomainList()`:\n\n```php\n$zoneContent = (string)Dns::createDomainZone(...);\n$domain['zonefile'] = 'domains/' . $domain['domain'] . '.zone';\n$zonefile_name = FileDir::makeCorrectFile(\n Settings::Get('system.bindconf_directory') . '/' . $domain['zonefile']\n);\n$zonefile_handler = fopen($zonefile_name, 'w');\nfwrite($zonefile_handler, $zoneContent . $subzones);\nfclose($zonefile_handler);\n```\n\nA newline in `$_content` is not a special character in `__toString`. It is a regular byte concatenated between tabs. The byte terminates the TXT record's line in the zone file; the bytes after the byte begin a new line in the zone file; BIND parses those bytes as zone directives the same way it parses every other line.\n\nThe injection primitive is one authenticated HTTP POST against `api.php`, command `DomainZones.add`, with `type=TXT` and a `content` field containing a literal `\\n` followed by the attacker's chosen zone-file content. The DNS rebuild cron writes the zone, reloads BIND, and serves it.\n\nThe attacker's chosen content can be:\n\n- `$INCLUDE /var/lib/bind/private.key` to coerce BIND to parse the named file as zone content. The parser logs every line that is not zone-shaped, and the log lines disclose the file's contents to whatever destination the host writes BIND logs to (syslog, the panel's error report, journald).\n- `$GENERATE 1-65535 host$ A 198.51.100.1` to produce 65,535 A records at sequential subdomains of the customer's domain, all resolving to the attacker's chosen IP.\n- A bare `evil A 198.51.100.1` followed by `admin A 198.51.100.1` on the next line, inserting records the panel did not authorize into the customer's own zone, invisible to the panel UI.\n\nThe caller is an authenticated Froxlor customer with the `dns_editor` capability enabled by their reseller. Froxlor is a shared-hosting control panel; that customer is a paying tenant of a small hosting reseller. The reseller is the victim. Their BIND instance is serving zone content the panel never approved, written by a tenant whose isolation guarantee the reseller bought when they installed Froxlor.\n\n## The April Patch Did What The TODO Asked For\n\nThe 2.3.7 patch landed on April 21, 2026 ([`3dceec46`](https://github.com/froxlor/froxlor/commit/3dceec4650e071b86e068b8cdfd1de74cc73d368)). The relevant hunk in `DomainZones.php` is:\n\n```diff\n- // TODO regex validate content for invalid characters\n-\n if ($ttl <= 0) {\n $ttl = 18000;\n }\n@@ -156,6 +154,11 @@\n $errors[] = lng('error.dns_content_empty');\n }\n \n+ // remove invalid control characters (allow tab + printable ASCII)\n+ $content = preg_replace('/[^\\x09\\x20-\\x7E]/', '', $content);\n+ // collapse excessive whitespace\n+ $content = preg_replace('/\\s+/', ' ', $content);\n+\n if ($type != 'CNAME') {\n```\n\nThe 2016 TODO comment is deleted in the same diff that finally honors it. The deletion is the codebase signing off on the comment after nine years, eleven months, and ten days.\n\nThe two `preg_replace` calls sit before the per-type dispatch. The first strips every byte that is not tab or printable ASCII; the second collapses runs of whitespace to a single space. Both run on every branch of the dispatch, for every record type, before any per-type handler sees `$content`. This is the architectural change the TODO had been asking for. The first patch was the moment the maintainer had to look at the comment to know which lines to edit. The first patch did not write it.\n\n## Two CVEs From One Dispatch Chain\n\nCVE-2026-30932 and CVE-2026-41234 are the same bug with the dispatch's switch leg as the only difference. The first patch closed four legs by writing per-spec syntax validators on each one. The remaining leg was TXT, the one record type whose RFC 1035 definition is free-form text with no further constraint. A per-spec validation architecture has nothing to catch in TXT, because TXT has no spec to catch against. The architecture's blind spot is exactly the type the TODO had been describing the only fix for since 2016: a regex on `$content`, before the dispatch, applied to every type.\n\nThis is the [Todo That Shipped](/patterns/todo-that-shipped) pattern in the variant where a patch is committed next to the comment and walks past it. The catalog's existing exhibits document the longer-clock cases where a TODO survives a refactor (free5GC's [five-year `// TODO: Authorize the AF`](/posts/free5gc-cve-2026-44315-oauth-outbound-todo-inbound), Cockpit's [sixty-one-month interpreter-choice comment](/posts/cockpit-cve-2026-4802-the-todo-named-the-fix), Drupal's [array-values comment that outlived the refactor that broke it](/posts/drupal-cve-2026-9082-the-comment-said-values)). The Froxlor case is the shorter-clock variant where the patch in front of the comment was the moment to act, and the act was scoped to the four legs the architecture could fit instead of the one regex the comment had named.\n\nIt is also a [Design Debt Driver](/patterns/design-debt-driver). The per-type dispatch in `DomainZones::add()` makes every cross-cutting concern, sanitization, escaping, length bounds, into something each branch has to remember individually. Two CVEs in two months is the maintenance discipline this architecture is producing. The April patch added one pre-dispatch sanitizer for the newline class; it left the per-type dispatch in place. The next cross-cutting concern that lands on this file will be filed against whichever branch the maintainer's hand does not reach to.\n\nPoC and prior CVE: [GHSA-37m5-m4q3-fc6x](https://github.com/advisories/GHSA-37m5-m4q3-fc6x), [GHSA-x6w6-2xwp-3jh6](https://github.com/advisories/GHSA-x6w6-2xwp-3jh6).","closing_line":"The patch for CVE-2026-30932 was committed next to the comment naming CVE-2026-41234. The comment is older than both CVEs by a decade.","hook_md":"Froxlor's `DomainZones.php` carries a comment that reads `// TODO regex validate content for invalid characters`. The comment landed on May 11, 2016. CVE-2026-30932 was patched on February 24, 2026 in a hunk sixty-five lines below it; the patch added per-record-type validators for LOC, RP, SSHFP, and TLSA, and did not write the regex the comment named. CVE-2026-41234 was filed two months later because the TXT branch, eight lines below where the previous patch landed, never got the regex either.","post_id":616,"slug":"froxlor-cve-2026-41234-todo-survived-the-first-patch","title":"CVE-2026-41234: The Patch For The Previous Froxlor CVE Sat Four Lines Below The Comment Naming This One","type":"initial","unreadable_sentence":"The patch for CVE-2026-30932 was committed next to the comment naming CVE-2026-41234."} -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQRf0htP5+SjynlxywneZjl4jgkQJgUCatJ4sgAKCRDeZjl4jgkQ JmAIAQClr9GYREmX2NjDaLrDUs1qGRNg7lcg7ynxVHB8Gp3YHgEAuIGM/QHEYWwp 3Ywaqe1nphr99rHjzO+E3CoEhybC8g0= =FRSA -----END PGP SIGNATURE-----