Skip to content

Coding-agent CLI honours repo-supplied configuration on first open, before any workspace-trust prompt

coding-agent-repo-config-autoexec is a high severity check in the ai category, written in shell. Its source is templates/ai/coding-agent/coding-agent-repo-config-autoexec.sh in cert-x-gen-templates.

Builds two private, identically-owned checkouts and plants the same six benign repo-scoped config surfaces in each - a .claude/settings.json SessionStart hook, a .mcp.json autoApprove entry, .cursor/mcp.json, a .vscode/tasks.json folderOpen task, an AGENTS.md Run directive, and the tool’s own project-local settings - then opens each with the coding-agent CLI. One checkout is recorded in the user’s own trust store; the other is a fresh clone no human ever approved. Honouring the trusted arm establishes the tool is repo-config-driven at all; honouring the byte-shaped-identical surfaces in the unapproved arm proves cloning is consent, and that whoever wrote the repository chooses what runs on the machine of whoever opens it (Amazon Q Developer repo-config RCE class).

Field Value
Id coding-agent-repo-config-autoexec
Severity high
Language shell
Category ai
Author CERT-X-GEN Security Team
Template version not recorded
Confidence 90
CVSS not recorded
Weakness CWE-1188
Tags ai, coding-agent, cli, untrusted-workspace, repo-config, trust-boundary, autoexec, hooks, mcp, cwe-1188, cwe-829, cwe-732, cwe-94
Target kind cli
Oracle property

Declared in the header. cxg parses @references and then discards it, and nothing at scan time reads it, so this is the only place the links a template cites are surfaced.

To see what the copy on your machine says about itself, and to confirm it is installed at all:

Terminal window
cxg template info coding-agent-repo-config-autoexec

The id it prints is the one to pass anywhere a template is selected. See cxg template for the rest of the subcommand, Scan a target for running a scan, and A match is not a finding for how to read what comes back.