[Security Review] Daily Security Review — 2026-03-06 #1167
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-03-13T13:52:45.626Z.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
📊 Executive Summary
A comprehensive, evidence-based security review of the gh-aw-firewall repository was conducted on 2026-03-06. The review analysed 3,009 lines of security-critical code across the iptables management layer, Squid proxy configuration, container entrypoint, domain-pattern validation, and the one-shot-token LD_PRELOAD library.
Overall posture: Strong. The defence-in-depth architecture (host iptables → Squid ACL → capability dropping → token isolation) is well-designed. Three low-to-medium findings were identified; none allow remote exploitation without physical access to the CLI flags. No critical vulnerabilities were found, and the npm dependency audit returned 0 vulnerabilities.
🔍 Findings from Previous Security Runs
No recent runs of firewall-escape-test or secret-digger workflows were reachable via the agentic-workflow log API during this run (tool returned exit status 1). Analysis relies solely on static code review and local command evidence.
🛡️ Architecture Security Analysis
Network Security Assessment — ✅ Strong
Evidence commands:
Finding: Firewall rule ordering is correct. Host-level
DOCKER-USER→ customFW_WRAPPERchain → Squid ACLs form a coherent multi-layer stack.Key observations:
host-iptables.ts).8.8.8.8, 8.8.4.4) can receive port-53 traffic; all other UDP is REJECTed ([FW_BLOCKED_UDP]prefix).ip6tablesis unavailable, IPv6 is disabled viasysctl net.ipv6.conf.all.disable_ipv6=1(src/host-iptables.ts:96–100,containers/agent/setup-iptables.sh:33–37).When the user specifies IPv6 DNS servers (e.g.,
--dns-servers 2001:4860:4860::8888), the IPv6 chain is created and ALL ICMPv6 message types are allowed. This includes:ICMP tunneling tools can carry arbitrary payloads over ICMP echo, completely bypassing Squid domain filtering. The risk is limited to networks that route IPv6, but the control should be tightened.
Recommended fix — replace the blanket accept with specific types:
Container Security Assessment — ✅ Strong with one observation
Evidence commands:
The seccomp profile (
containers/agent/seccomp-profile.json) hasdefaultAction: SCMP_ACT_ALLOWand only explicitly blocks 3 groups. The following dangerous syscalls are not blocked:unshare/clone(user namespace creation — can be used to gain faux-root inside a new namespace)mount(blocked by capability, but not by seccomp)chroot(blocked byCAP_SYS_CHROOTdrop in chroot mode; open otherwise)Mitigating factors that reduce severity:
no-new-privileges:trueis set (src/docker-manager.ts:884)CAP_SYS_ADMINis dropped bycapshbefore user code runs (entrypoint.sh:278)NET_ADMIN,SYS_PTRACE,SYS_MODULE,MKNOD,SYS_RAWIOare in the container-levelcap_droplistpivot_rootis blocked by seccompRecommendation: Adopt a deny-by-default seccomp profile (based on Docker's default allowlist) rather than an allow-by-default profile. At minimum, add
unshare,clone3,chroot, andmountto the SCMP_ACT_ERRNO list.AppArmor note: The agent container runs
apparmor:unconfined(src/docker-manager.ts:886). This is necessary to allow procfs mounting (mount -t proc), which is needed by .NET, JVM, and other runtimes. The comment notes that SYS_ADMIN is dropped before user code, limiting the practical window of exposure.Domain Validation Assessment — ✅ Excellent
Evidence command:
Key strengths:
[a-zA-Z0-9.-]*(not.*) —src/domain-patterns.ts:83*,*.*, patterns with>50%wildcard segments —src/domain-patterns.ts:155–178src/domain-patterns.ts:248(redacted)https://`) properly handledInput Validation — URL Pattern Injection
Evidence:
The
parseUrlPatternsfunction insrc/ssl-bump.ts:313–338does not strip newline characters from URL patterns. If a pattern containing\nis passed via--allow-urls, the generatedsquid.confwould contain injected directives.Exploitation path:
--allow-urlsCLI flaghttps://github.com/org/*\nhttp_access allow allhttp_access allow allintosquid.conf, bypassing all domain restrictionsSeverity: LOW — requires the attacker to directly invoke the AWF CLI with crafted flags. Typical AI agent workloads do not control CLI flags. However, if AWF CLI flags are assembled from untrusted input (e.g., a YAML template that interpolates user-supplied values), this could elevate to HIGH.
The
parseDomainshelper used to split--allow-urls(src/cli.ts:995) does call.trim()which strips leading/trailing whitespace, but internal newlines survive.Recommended fix: Add a newline/control-character check in URL pattern validation:
✅ Recommendations
🔴 Medium — Address Soon
1. Restrict ICMPv6 types in IPv6 chain (
src/host-iptables.ts:395–404)'-p', 'ipv6-icmp', '-j', 'ACCEPT'with specific type allows🟡 Low — Plan to Address
2. Add newline/control-char validation for
--allow-urls(src/cli.ts:~1005)\r,\n, or other control characters (/[\r\n\x00-\x1f]/)3. Harden seccomp profile to deny-by-default (
containers/agent/seccomp-profile.json)SCMP_ACT_ALLOWdefault with Docker's standard deny-by-default allowlistunshare,clone3,chroot,mountto the ERRNO blocklist4. Align DANGEROUS_PORTS between squid-config.ts and setup-iptables.sh
setup-iptables.shDANGEROUS_PORTS🟢 Informational
5. Consider specific ICMPv4 restriction (
src/host-iptables.ts)FW_WRAPPERchainhping3could theoretically use ICMP echo for tunneling over IPv4 tooNET_RAWdropped), limited practical impact6. Document LD_PRELOAD bypass in AGENTS.md / CLAUDE.md
containers/agent/one-shot-token/README.mdbut not in AGENTS.md📈 Security Metrics
Beta Was this translation helpful? Give feedback.
All reactions