AAK-SKILL-UNTRUSTED-EXEC-PATH: Untrusted-search-path executable override in skill/install flow
- Severity
- HIGH
- Category
- Supply Chain (
supply-chain) - Scanner
agent_audit_kit/scanners/skill_untrusted_exec_path.py- Auto-fixable
- No.
- SARIF name
SkillUntrustedExecPath
What it detects
Install or skill-setup code resolves an executable, interpreter, or build tool from a workspace-controlled source and runs it without an absolute-path pin or allowlist, so the workspace decides which binary executes. Detected sources: a .env / dotenv-sourced variable (load_dotenv() then os.environ.get(...) / os.getenv(...) / dotenv_values(...)), a PATH prepended with a non-absolute / workspace directory (os.environ['PATH'] = os.getcwd() + os.pathsep + ...), shutil.which(...) resolved over such a tainted PATH, or a Homebrew / package-manager binary chosen via an env override (HOMEBREW_* / BREW). Anchor: CVE-2026-53819 (CWE-426 Untrusted Search Path, CVSS 8.7) — OpenClaw before 2026.5.27 let a workspace .env override the Homebrew executable selection during skill install, executing unintended Homebrew-compatible binaries to compromise the system. This is an install-time code-execution sink, distinct from AAK-CLAUDE-WIN-001 (a Windows ProgramData config-path hijack) and from the AAK-SKILL-001..005 SKILL.md content checks.
How to fix
Pin the executable to an absolute path; do not resolve build tools from workspace-controlled env. Hard-code the trusted binary location (e.g. /opt/homebrew/bin/brew) or validate the resolved path against an allowlist with os.path.isabs before exec, and never let a workspace .env or a workspace-relative PATH prepend select the interpreter / build tool used during skill setup.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-SKILL-UNTRUSTED-EXEC-PATH
Limitations
Reads .py, .sh and .bash files whose name or content looks like install or skill-setup code. In Python the sinks are subprocess.run, call, check_call, check_output, getoutput, getstatusoutput, a lowercase popen and the os.system, os.popen, os.exec* and os.spawn* calls, so subprocess.Popen([brew, ...]) and asyncio.create_subprocess_exec are not reported. A mention of os.path.isabs, an allowlist or ALLOWED_BINARIES anywhere in the file clears it, whatever it guards, and an install script written in JavaScript is not read.
References
- CVE: CVE-2026-53819
- OWASP Agentic Top 10: ASI05 (Unexpected Code Execution (RCE))
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-PATH-01
All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-SKILL-UNTRUSTED-EXEC-PATH.md: the page then shows that text, with the registry reference appended under it.