generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10
Maintainers usually reply within 1 day
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:
- IPv4-mapped IPv6 hosts. The code only matches the dotted form (
::ffff:127.,::ffff:10.and so on). The URL parser rewriteshttps://[::ffff:127.0.0.1]/to hostname[::ffff:7f00:1], so that branch never matches. 100.64.0.0/10(carrier-grade NAT). This range includes100.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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Orkas-AI/Orkas
-
Difficulty 3/5 Half a day Newbie friendliness 18/100
Orkas-AI/Orkas#243 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Orkas-AI/Orkas#224 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Orkas-AI/Orkas#174 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 28/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
NL-BioImaging/OMERO.biomero#92 ·
Maintainers usually reply within 1 day
-
bug: juros do parcelamento travados em 1x no gateway Rede Débito e Crédito 3DS (woo-rede 5.6.0)Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
LinkNacional/woo-rede#367 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Docs: 1 broken linkOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
bug Next.js
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
getsentry/sentry-wizard#1397 · 1 comment ·
Maintainers usually reply within 1 day