T09 · Insecure Skill Coding Practices
- Location
scripts/audit.py:27- Finding
Repository-controlled Git configuration can execute commands with the auditor's inherited environment
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a coherent repository auditor, but it runs Git against configured repositories with the full inherited environment, creating a real credential and command-execution exposure if a repository's Git configuration is hostile.
Install only if you will run it under a least-privileged account with a minimal environment, against repositories whose Git configuration you trust or have hardened. Avoid scheduled or --fetch/--github/--persist operation until you are comfortable with the Git subprocess risk and have isolated credentials and network access.
scripts/audit.py:27Repository-controlled Git configuration can execute commands with the auditor's inherited environment
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
remaining = self.deadline - time.monotonic()
if remaining <= 0:
raise Unknown("budget exhausted")
env = dict(os.environ, GIT_OPTIONAL_LOCKS="0", GIT_TERMINAL_PROMPT="0")
try:
p = subprocess.run(argv, capture_output=True, env=env,
timeout=min(remaining, self.timeout), check=False)
The skill describes and instructs use of high-risk capabilities including shell execution, filesystem reads/writes, environment access, and optional networked GitHub operations, but it does not declare an explicit tool/permission scope in the metadata. Without a restrictive allowlist, an agent runtime may expose broader capabilities than intended, making accidental or unauthorized command execution, data access, or persistence more likely.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
raise Unknown("budget exhausted")
env = dict(os.environ, GIT_OPTIONAL_LOCKS="0", GIT_TERMINAL_PROMPT="0")
try:
p = subprocess.run(argv, capture_output=True, env=env,
timeout=min(remaining, self.timeout), check=False)
except subprocess.TimeoutExpired:
raise Unknown("timeout") from None
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
with tempfile.TemporaryDirectory() as d:
p=Path(d)/"repo"; p.mkdir()
def git(*args):
subprocess.run(["git","-C",str(p),*args],check=True,capture_output=True)
git("init")
git("-c","user.name=Fixture","-c","user.email=fixture@example.invalid",
"commit","--allow-empty","-m","fixture")
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
parser.add_argument("--config", type=Path, required=True)
args=parser.parse_args()
try:
p=subprocess.run(["openclaw","automations","get",args.job_id],capture_output=True,text=True,timeout=15)
if p.returncode: raise ValueError("query unavailable")
job=json.loads(p.stdout)
if "job" in job: job=job["job"]