T09 · Insecure Skill Coding Practices
- Location
scripts/run_opencode_discord_bridge.py:371- Finding
Unredacted OpenCode Execution Data Is Transmitted to Discord
- Content
View full analysis
list[str]: results: list[str] = [] if value is None: return results if isinstance(value, str): stripped = value.strip() if stripped: results.append(stripped) return results if isinstance(value, list): for item in value: results.extend(extract_text(item)) return results if isinstance(value, dict): preferred_keys = ( "text", "delta", "content", "message", "summary", "error", "input", "output", "name", "tool", "title", ) for key in preferred_keys: if key in value: results.extend(extract_text(value[key])) for item in value.values(): if isinstance(item, (dict, list)): results.extend(extract_text(item)) return results return results ``` ```python def render_status( state: dict[str, Any], prompt: str, command: list[str], done: bool = False, ) -> str: heading = "OpenCode run finished" if done else "OpenCode run in progress" preview = "\n".join(state["lines"][-STATUS_PREVIEW_LINES:]) or "(waiting for events)" stderr_preview = "\n".join(state["stderr"][-6:]) result = textwrap.dedent( f""" {heading} Repo: `{state["repo"]}` Model: `{state["model"]}` Command: `{shlex.join(command)}` Prompt: `{shorten(prompt, 180)}` Events: `{state["event_count"]}` Recent events: {preview} """ ).strip() if stderr_preview: resu ...[truncated 3640 chars]- Remediation
View remediation
