T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/fetch_url.py:12
- Finding
- Disclosure of Sensitive URLs to Third-Party Conversion Services<![CDATA[ ## Vulnerability Details **File Location**: `scripts/fetch_url.py`, lines 12–16 and 33–34 **Vulnerability Type**: Sensitive information exposure through third-party services **Risk Level**: Medium ### Vulnerable Code ```python METHODS = [ ('r.jina.ai', lambda u: f'https://r.jina.ai/http://{u.removeprefix("https://").removeprefix("http://")}'), ('markdown.new', lambda u: f'https://markdown.new/{u}'), ('defuddle', lambda u: f'https://defuddle.md/{u}'), ] ``` The generated URLs are subsequently requested here: ```python for name, builder in METHODS: target = builder(args.url) try: text = fetch(target, args.timeout) ``` ### Technical Analysis The script embeds the complete user-supplied URL into requests sent to as many as three independent external services: `r.jina.ai`, `markdown.new`, and `defuddle.md`. It does not validate, sanitize, or redact URL components before transmission. URLs may contain sensitive information in their query strings, path segments, fragments, or user-information fields. Examples include signed object-storage parameters, password-reset tokens, invitation tokens, API keys, session identifiers, and private document-sharing secrets. When such a URL is supplied, its sensitive components are disclosed to the selected conversion service and may appear in that service's request logs or telemetry. The behavior is consistent with the skill's documented purpose, and there is no evidence that the services are malicious. Nevertheless, silently forwarding complete secret-bearing URLs across additional trust boundaries is an insecure data-handling practice. ### Attack Path 1. A user possesses a private or signed URL that contains an access token or other secret. 2. The user invokes `fetch_url.py` with that URL, or an attacker persuades the user or agent to process it. 3. The script inserts the complete URL into a request to `r.jina.ai`. 4. If that attempt fails or produces blocked or thin content, the sa ...[truncated 824 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Accept only `http` and `https` URLs and reject URLs containing embedded user information. 2. Detect potentially sensitive query parameters such as `token`, `key`, `signature`, `sig`, `auth`, `password`, and common signed-URL parameters. 3. Refuse to forward sensitive URLs by default, or require explicit user confirmation after presenting a redacted warning. 4. Redact secrets from logs, diagnostics, attempt history, and error messages. 5. Provide a direct-fetch mode that retrieves content from the destination without exposing the original URL to conversion services. 6. Clearly document that proxy-based conversion sends the complete URL to third parties. 7. Where practical, allow administrators to configure an approved service allowlist or disable external conversion services entirely. ]]>
