T09 · Insecure Skill Coding Practices
- Location
scripts/verify_public_anchors.py:72- Finding
Manifest-Controlled URLs Permit SSRF and Redirect-Based Policy Bypass
- Content
View full analysis
tuple[int, bytes | None, str | None]: req = urllib.request.Request(url, headers={"User-Agent": UA}, method="GET") try: with urllib.request.urlopen(req, timeout=timeout) as resp: return resp.status, resp.read(), None except urllib.error.HTTPError as e: return e.code, None, str(e) except Exception as e: return 0, None, str(e) ``` ```python man_path = Path(args.manifest) if args.manifest else stack / "docs" / "public_verify_manifest.json" built = False if args.build_manifest: if not args.i_trust_stack: print( json.dumps( { "verdict": "BLOCKED", "errors": ["build_manifest_requires_i_trust_stack"], "hint": "pass --i-trust-stack only for a stack checkout you control", } ), file=sys.stderr, ) return 2 if not man_path.is_file(): builder = Path(__file__).resolve().parent / "build_public_verify_manifest.py" if builder.is_file(): from _safe_invoke import run_python_script # noqa: E402 code, out = run_python_script( builder, ["--stack-root", str(stack)], cwd=stack, stack=stack, ) built = code == 0 if code != 0: print(f"build_manifest_failed code={code} {out[:300]}", file=sys.stderr) endpoints = [] if man_path.is_file(): man = json.loads(man_path.read_text(encoding="utf-8")) endpoints = man.get("public_endpoints") or [] else: endpoints = list(DEFAULT_ENDPOINTS) ALLOWED_VERIFY = {"http_required", "http_soft", "skip"} results = [] hard_fail = ...[truncated 3774 chars]- Remediation
View remediation
