T09 · Insecure Skill Coding Practices
- Location
scripts/run-duo.py:75- Finding
Unfiltered Sandbox Contents Are Transmitted to an External API
- Content
View full analysis
str: """Call Gemini API with the given prompts.""" url = f"https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent?key={API_KEY}" payload = { "contents": [ { "role": "user", "parts": [{"text": f"{system_prompt}\n\n---\n\n{user_prompt}"}] } ], "generationConfig": { "temperature": 0.9, "maxOutputTokens": 2048 } } response = requests.post(url, json=payload) if response.status_code == 200: data = response.json() return data["candidates"][0]["content"]["parts"][0]["text"] else: return f"ERROR: {response.status_code} - {response.text}" def read_sandbox() -> str: """Read all sandbox files into a string.""" contents = [] for file in SANDBOX.rglob("*"): if file.is_file() and file.name != "run-experiment.py" and file.name != "experiment-log.md": try: contents.append(f"\n### {file.relative_to(SANDBOX)}\n```\n{file.read_text()}\n```") except: pass return "\n".join(contents) ``` The collected content is then placed in the API prompt: ```python workspace = read_sandbox() user_prompt = f"Here is the workspace you need to analyze:\n{workspace}\n\nProvide your analysis and recommendations." ``` The documentation also encourages potentially sensitive test data: ```markdown ### Modify the Sandbox Create custom scenarios in `/tmp/chaos-sandbox/`: - Add realistic project files - Include edge c ...[truncated 2756 chars]- Remediation
View remediation
