Skip to content

Refuse image fetches that are not http or https - #208

Merged
jmjava merged 1 commit into
mainfrom
cursor/refuse-non-http-image-url
Nov 1, 2026
Merged

jmjava merged 1 commit into
mainfrom
cursor/refuse-non-http-image-url

Conversation

@jmjava

@jmjava jmjava commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • fetch_url_bytes opened whatever scheme urllib accepts, including file:, so an image URL could read a local path.
  • Non-http(s) URLs are refused before urlopen. The proving test fails if that check is removed.

Test plan

  • tests/test_ai_client.py fetch cases with PYTHONPATH pointed at the worktree
  • CI lint, unit, benchmark, validate, mutation, and GitGuardian

Made with Cursor

A file or other non-http URL was opened with urllib, so a CDN response could read a local path. The fetch now fails before urlopen.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jmjava
jmjava merged commit bddf436 into main Nov 1, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant