T03 · Remote Payload Retrieval and Execution
- Location
SKILL.md:32- Finding
Mutable Remote Payload Retrieval and Subsequent Execution
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Markdown linter mostly matches its stated purpose, but its install instructions fetch executable code from a mutable remote branch and its external link checker can make unrestricted network requests.
Install and run the bundled reviewed md_linter.py rather than downloading from the mutable GitHub main branch. Use --check-external only on trusted Markdown or inside a network-restricted environment, and avoid running ci/verify_product.py against untrusted package directories.
SKILL.md:32Mutable Remote Payload Retrieval and Subsequent Execution
md_linter.py:158Blind SSRF Through Unrestricted External Link Validation
This function executes arbitrary Python files discovered in the target product directory as part of verification by invoking them with a self-test argument. In a CI or pre-merge context, an attacker can submit a malicious product containing a crafted .py file, causing the verifier to run untrusted code on the host and enabling remote code execution, data exfiltration, or CI compromise.
def has_self_test(fp):
r = subprocess.run([sys.executable, fp, "self-test"], capture_output=True, text=True, timeout=30)
return r.returncode == 0 and "PASS" in r.stdout
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
all_ok &= axis(False, "frontmatter (no SKILL.md)")
all_ok &= axis(False, "docs (no SKILL.md)")
# 3 compiles
comp_ok = all(subprocess.run([sys.executable, "-m", "py_compile", fp],
capture_output=True).returncode == 0 for fp in files)
all_ok &= axis(comp_ok, "compiles (py_compile all .py)")
# 4 self-test (any of 3 valid forms)
This code executes any test_*.py or *_test.py file found in the product directory, treating attacker-controlled repository content as trusted code. In CI, a malicious contributor can place hostile logic in a test file and obtain code execution under the verifier's privileges, potentially stealing tokens, modifying artifacts, or pivoting within the build environment.
tests = [os.path.join(folder, f) for f in os.listdir(folder)
if (f.startswith("test_") or f.endswith("_test.py")) and f.endswith(".py")]
if tests:
st_ok = all(subprocess.run([sys.executable, t], capture_output=True, text=True,
timeout=30).returncode == 0 for t in tests)
st_note = f"{len(tests)} test_*.py"
elif re.search(r"(?im)^test\s*:", skill_txt):
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# 7 deploy-ready
ci = os.path.join(os.path.dirname(os.path.abspath(__file__)), "ci_check.py")
if os.path.isfile(ci) and os.path.isfile(skill):
r = subprocess.run([sys.executable, ci], cwd=folder, capture_output=True, text=True)
all_ok &= axis(r.returncode == 0, "deploy-ready (ci/ci_check.py PASS)")
else:
all_ok &= axis(True, "deploy-ready (skipped)")
No suspicious patterns detected.