Junglewise Threat Intelligence

Apple container pf rule injection in container system dns create

Severity: low · CVSS 1.9 · Published 2026-05-07

Technologies: Apple Container. Vendors: Apple, Swift.

Executive brief

A vulnerability in the Apple 'container' tool allows a local user with restricted administrative privileges to bypass security controls and inject arbitrary firewall rules into the macOS kernel. This tool is typically used to manage networking for containers, and an exploit could allow an attacker to redirect network traffic to malicious servers or block legitimate connections, potentially leading to data interception or service outages. The issue occurs because the tool fails to properly check domain names for hidden commands before writing them to the system's firewall configuration.

Technical details

A command injection vulnerability exists in Apple's 'container' utility (<= 0.12.2) within the 'container system dns create --localhost' command. The 'domainName' argument is passed unsanitized into the Packet Filter (pf) anchor file (/etc/pf.anchors/com.apple.container) as a comment. By including a newline character (\n) in the domain name, a local attacker can break out of the comment context and inject arbitrary pf directives (such as pass, block, or nat) with fully controlled source and destination IPs. This effectively bypasses sudo delegation where an administrator may have granted a user limited root access to manage DNS redirects. The vulnerability is caused by the DNSCreate component failing to call the existing isValidDomainName() validation function. A fix is available in version 0.12.3.

Affected products

  • Apple container <= 0.12.2

Timeline

  • 2026-04-30: disclosed: Initial disclosure to vendor
  • 2026-05-07: advisory: GitHub Advisory published
  • 2026-07-16: other: Advisory updated

References

Related threats