Cloudanix VulnDB

GHSA-39g5-644c-qwcg

Medium · 5.3

container: pf Rule Injection via Domain Name Argument in `container system dns create --localhost` Command

CVSS

5.3

EPSS

—

Published

May 7, 2026

CISA due date

—

The record

The `container system dns create --localhost` command accepts a `domainName` argument and passes it unsanitized into the pf anchor file (`/etc/pf.anchors/com.apple.container`) as a comment in a rule line. A domain name containing a newline character breaks out of the comment context and injects an arbitrary pf rule into the anchor file. When `pfctl -f` subsequently loads the configuration, the attacker-controlled rule is loaded into the macOS kernel packet filter. A `isValidDomainName()` function exists in `Parser.swift:892` but is **never called** from `DNSCreate`. **The core harm caused by this vulnerability is the bypassing of sudo privileges. An administrator may have only granted a user or an automation tool such as CI/CD the ability to execute `container system dns create` with root privileges, expecting that the user or automation tool could only add redirects from other IPs to localhost in the firewall rules file via `--localhost`. However, an attacker can exploit this vulnerability to write arbitrary rules into the firewall rules file: the target address is no longer restricted to localhost, and the rules are no longer limited to redirects.**

Affected packages

Ecosystem Package Introduced Fixed

Related vulnerabilities