generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10

Open Beginner friendly
#263 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@goranai is already working on this.

Since Nov 25, 2026.

  • #264 by @goranai — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
node.js, typescript
Domain
security

Research direction

Start at isPrivateReferenceHost in src/main/features/generation_reference_assets.ts, the guard normalizeUrl calls before download, and read it against isPublicRemoteMediaIp in local_agents/media.ts, which already covers both ranges. Reproduce with new URL('https://[::ffff:127.0.0.1]/a.png').hostname to see the compressed hex form, then extend the check for mapped IPv6 and 100.64.0.0/10. Done looks like those hosts getting the existing "HTTPS public URL or asset:// provider URL" rejection, plain IPv4 behaviour unchanged.

Written by the indexing model from the issue text.

Description

What happens

generate_image accepts reference_image_urls. Each URL is checked by isPrivateReferenceHost in src/main/features/generation_reference_assets.ts and then downloaded by the app. The check misses two kinds of private address:

  1. IPv4-mapped IPv6 hosts. The code only matches the dotted form (::ffff:127., ::ffff:10. and so on). The URL parser rewrites https://[::ffff:127.0.0.1]/ to hostname [::ffff:7f00:1], so that branch never matches.
  2. 100.64.0.0/10 (carrier-grade NAT). This range includes 100.100.100.200, the Alibaba Cloud metadata address.
Steps
new URL('https://[::ffff:127.0.0.1]/a.png').hostname      // '[::ffff:7f00:1]'
new URL('https://[::ffff:169.254.169.254]/').hostname      // '[::ffff:a9fe:a9fe]'

Pass any of these as a reference URL: https://[::ffff:127.0.0.1]/a.png, https://[::ffff:10.0.0.1]/a.png, https://[::ffff:192.168.1.1]/a.png, https://100.100.100.200/a.png. normalizeUrl accepts them. https://127.0.0.1/a.png is rejected as expected.

Expected

Same result as the plain IPv4 form: "reference URL must be an HTTPS public URL or asset:// provider URL". local_agents/media.ts (isPublicRemoteMediaIp) already blocks both 100.64.0.0/10 and mapped addresses.

Notes

Checked on main at 870f879d. The request is https only, so I did not test against a real internal HTTPS server. The guard accepting the URL is the part I could prove. A fuzz of 176655 hosts against net.BlockList found 18038 wrong answers on main and 0 with the fix.

Validated with Claude Opus 5.5.

Dominant language
JavaScript
Stars
9.1k
Forks
529
Avg merge
1h 43m
Merged PRs (30d)
112

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Orkas-AI/Orkas

All issues in Orkas-AI/Orkas

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.