8000 tracer: bracket IPv6 hosts in allowed UI origins by tubibibo · Pull Request #210 · frida/frida-tools · GitHub
[go: up one dir, main page]

Skip to content

tracer: bracket IPv6 hosts in allowed UI origins - #210

Closed
tubibibo wants to merge 1 commit into
frida:mainfrom
tubibibo:fix/tracer-ipv6-ui-origins
Closed

tubibibo wants to merge 1 commit into
frida:mainfrom
tubibibo:fix/tracer-ipv6-ui-origins

Conversation

@tubibibo
@tubibibo tubibibo commented Nov 4, 2026
Copy link
Copy Markdown
Contributor

Summary

compute_allowed_ui_origins() built the allow-list with plain string interpolation, so an IPv6 bind host produced entries like http://::1:9230. Browsers always send the bracketed form (http://[::1]:9230, RFC 3986 §3.2.2), so the exact-match check in _handle_asset_request() never matched and the web UI answered 403 Cross-origin request denied to its own origin.

  • Bracket IPv6 literals when serializing origins (an already-bracketed host is left as is).
  • When binding to ::, also allow [::1], mirroring how 0.0.0.0 already allows 127.0.0.1.

Non-IPv6 behaviour is unchanged.

Verification

Against a real device process, frida-trace -U -p <pid> --ui-host ::1 --ui-port 9230:

code Origin: http://[::1]:9230 Origin: http://evil.test no Origin
before patch 403 403 200
after patch 200 403 200

(The --ui flag in the original report does not exist in current main; the UI starts when --ui-host/--ui-port are supplied.)

Unit tests are added to tests/test_tracer.py (TestTracerUiOrigins, 7/7 passing).

Fixes #203

compute_allowed_ui_origins() built the allow-list with plain string
interpolation, so an IPv6 bind host produced entries like
http://::1:9230. Browsers always send the bracketed form
(http://[::1]:9230) per RFC 3986, so the check in
_handle_asset_request() never matched and the web UI rejected every
request from a browser reaching it over IPv6 with 403.

Bracket IPv6 literals when serializing origins, and cover ::1 when
binding to the :: wildcard, mirroring how 0.0.0.0 covers 127.0.0.1.
@oleavr
oleavr commented Nov 5, 2026
Copy link
Copy Markdown
Member

Thanks! The bracketing fix already landed via #208. I picked up the :: → [::1] addition as 735a277, credited to you.

@oleavr oleavr closed this Nov 5, 2026
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.

frida-trace UI origin check rejects all IPv6 access: allowed origins built without RFC 3986 brackets

2 participants

0