Skip to content

tracer: Bracket IPv6 hosts in allowed UI origins - #208

Open
protonnegativo wants to merge 1 commit into
frida:mainfrom
protonnegativo:fix/203-ipv6-ui-origin
Open

protonnegativo wants to merge 1 commit into
frida:mainfrom
protonnegativo:fix/203-ipv6-ui-origin

Conversation

@protonnegativo

Copy link
Copy Markdown

Fixes #203

With --ui-host ::1 the allowed origins were built as http://::1:PORT, while the browser sends Origin: http://[::1]:PORT, so every UI request got a 403. compute_allowed_ui_origins() now wraps hosts containing : in brackets. The same applies to --ui-host ::, which produced http://:::PORT and now gives http://[::]:PORT.

Repro on main (d4e287e):

$ frida-trace --ui-host ::1 --ui-port 29230 -i "open*" -p <pid>
$ curl -i -H "Origin: http://[::1]:29230" "http://[::1]:29230/"
HTTP/1.1 403 Forbidden
Cross-origin request denied

With this change the same request returns 200 OK with the UI's index.html.

Testing:

  • Added test_ipv6_ui_origin_is_bracketed and test_ipv6_bind_origin_is_bracketed to tests/test_tracer.py (both fail without the fix)
  • python -m unittest tests.test_tracer -v: 7 tests OK
  • black --check, isort --check-only and pyflakes on the touched files

I didn't make --ui-host :: also allow http://[::1]:PORT, the way 0.0.0.0 allows 127.0.0.1. That widens what gets accepted, so I left it out. Happy to add it if you want it.

Browsers send IPv6 origins as http://[::1]:PORT, but the allow-list
was built as http://::1:PORT, so with --ui-host ::1 every request to
the UI was rejected with 403.

Fixes frida#203
@protonnegativo
protonnegativo marked this pull request as ready for review October 24, 2026 03:40
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

1 participant