T09 · Insecure Skill Coding Practices
- Location
SKILL.md:396- Finding
Repository-controlled Python modules can execute during report assembly ## Remediation Suggestions - Invoke the reporting interpreter in isolated mode, for example `python3 -I -`, so the current repository and Python-specific environment settings cannot influence imports. - Run trusted reporting code from a trusted directory outside the checkout, supplying validated artifact paths explicitly. - Keep reporting dependencies outside repository-controlled paths. - Add a regression test containing a repository-level `json.py` with a harmless execution marker, and verify that report assembly never imports it. - Apply least privilege to the reporting process as defense in depth, limiting access to unrelated secrets and host files.
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:396–397; the workflow runs this program from the cloned repository.
Vulnerability Type: T09: Insecure Skill Coding Practices
Risk Level: HighTechnical Analysis
Step 3 assembles the report by invoking Python with its program supplied through standard input:
bash python3 - <<'PY' import json, os, base64In a standard Python invocation of this form, the current directory participates in module resolution. Because the current directory is the repository being inspected, a repository-controlled
json.pyfile orjsonpackage can be imported instead of the standard-library module. Importing that module executes its top-level code.The reporting command does not use Python isolated mode or otherwise exclude the repository from module resolution. Consequently, repository content intended only for inspection can become executable code with the scanning agent's permissions.
The default setting that skips Maven compilation does not block this path: report assembly is a separate workflow stage and still invokes Python.
Attack Path
- An attacker contributes a top-level
json.pyfile orjsonpackage to a repository branch that will be scanned. - An authorized user requests a scan of that branch. The user need not enable
isBuild. - The Skill clones the repository and uses its root as the working directory.
- Step 3 executes
python3 -and importsjson. - Python resolves the attacker-controlled module from the repository and executes its top-level code before report assembly completes.
This attack requires control of repository content, not control of the scanning host or the user's Skill parameters.
Impact Assessment
Successful exploitation permits arbitrary code execution under the scanning process's operating-system identity. The payload can access files, credentials, and network resources available to that process.
The supplied project does not establish sandbox res ...[truncated 233 chars]
- An attacker contributes a top-level
