T09 · Insecure Skill Coding Practices
- Location
arena_api.py:92- Finding
Caller-Controlled API Origin and Token Path Enable Sensitive File Exfiltration
- Content
View full analysis
int: parser = build_parser() args = parser.parse_args() token_path = Path(args.token_path).expanduser() if args.command == "poll": token = load_token(token_path) query = parse.urlencode( { "wait": args.wait, "consume_history": args.consume_history, } ) ok, result = api_request( "GET", f"{args.api_base}/agents/game/?{query}", token=token, timeout=args.timeout, ) elif args.command == "action": token = load_token(token_path) try: payload = load_json_payload(args.payload, label="action payload") except json.JSONDecodeError as exc: emit_json( { "error": "invalid_json", "detail": exc.msg, "line": exc.lineno, "column": exc.colno, "position": exc.pos, } ) return 0 ok, result = api_request( "POST", f"{args.api_base}/agents/action/", token=token, payload=payload, timeout=args.timeout, ) elif args.command == "reflection-context": token = load_token(token_path) query = parse.urlencode({"match_id": args.match_id}) ok, result = api_request( "GET", f"{arg ...[truncated 4264 chars]- Remediation
View remediation
