You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you run mitmproxy with strace? Or maybe RUST_LOG=TRACE mitmdump -vvv?
I tried RUST_LOG=TRACE mitmproxy -vvv, but the output was identical to what I’d already seen—no extra details appeared.
I’ve now found that the crash only happens when the request body contains Chinese characters.
For example, with this curl command mitmproxy refuses to let me edit the request (the response also contains Chinese, yet the response can be edited without issue):
When I install mitmproxy via Homebrew the behavior is different: I cannot edit requests or responses even when they contain no Chinese characters. In this case the Events tab shows the following traceback:
info: [13:08:10.625] HTTP(S) proxy listening at *:8080.
info: [13:08:15.490][[::1]:59401] client connect
info: [13:08:15.761][[::1]:59401] server connect httpbin.org:443 (35.174.89.159:443)
info: [13:08:16.702][[::1]:59401] client disconnect
info: [13:08:16.702][[::1]:59401] server disconnect httpbin.org:443 (35.174.89.159:443)
error: [13:08:19.239] Unhandled error in task.
Traceback (most recent call last):
File "asyncio/events.py", line 89, in _run
File "urwid/event_loop/asyncio_loop.py", line 104, in wrapper
File "urwid/display/_posix_raw_display.py", line 285, in wrapper
File "urwid/display/_raw_display_base.py", line 488, in parse_input
File "urwid/event_loop/main_loop.py", line 466, in _update
File "urwid/event_loop/main_loop.py", line 566, in process_input
File "mitmproxy/tools/console/window.py", line 302, in keypress
File "urwid/widget/frame.py", line 526, in keypress
File "urwid/widget/widget.py", line 729, in keypress
File "mitmproxy/tools/console/window.py", line 43, in keypress
File "urwid/widget/frame.py", line 526, in keypress
File "urwid/widget/overlay.py", line 571, in keypress
File "mitmproxy/tools/console/overlay.py", line 140, in keypress
File "mitmproxy/tools/console/keymap.py", line 163, in handle
File "mitmproxy/tools/console/commandexecutor.py", line 17, in __call__
File "mitmproxy/command.py", line 292, in execute
File "mitmproxy/command.py", line 280, in call_strings
File "mitmproxy/command.py", line 149, in call
File "mitmproxy/command.py", line 322, in wrapper
File "mitmproxy/tools/console/consoleaddons.py", line 187, in nav_select
File "mitmproxy/tools/console/master.py", line 201, in inject_key
File "urwid/event_loop/main_loop.py", line 566, in process_input
File "mitmproxy/tools/console/window.py", line 302, in keypress
File "urwid/widget/frame.py", line 526, in keypress
File "urwid/widget/widget.py", line 729, in keypress
File "mitmproxy/tools/console/window.py", line 43, in keypress
File "urwid/widget/frame.py", line 526, in keypress
File "urwid/widget/overlay.py", line 571, in keypress
File "mitmproxy/tools/console/overlay.py", line 130, in keypress
File "mitmproxy/tools/console/consoleaddons.py", line 274, in callback
File "mitmproxy/command.py", line 280, in call_strings
File "mitmproxy/command.py", line 149, in call
File "mitmproxy/command.py", line 322, in wrapper
File "mitmproxy/tools/console/consoleaddons.py", line 512, in edit_focus
File "<frozen _collections_abc>", line 811, in get
File "mitmproxy/contentviews/_registry.py", line 70, in __getitem__
AttributeError: 'NoneType' object has no attribute 'lower'
I checked this and there are two issues:
1 - It mistakes the request body data as binary due to the chinese chars, which I fixed in this pr
2 - It uses bless as hexeditor because macos has it's own bless binary but it's not a hex editor which causes the weird error messages:
> man bless | head
BLESS(8) System Manager's Manual BLESS(8)
NAME
bless – set volume bootability and startup disk options
SYNOPSIS
bless --help
bless --folder directory [--file file] [--bootefi [file]]
[--label name | --labelfile file] [--setBoot] [--nextonly]
About the second issue I guess it should be addressed in another pr and my simplest idea would be to check if the which response contains /sbin which is the case of macos bless since it's a system binary, lmk what you think and i can also fix it
About the second issue I guess it should be addressed in another pr and my simplest idea would be to check if the which response contains /sbin which is the case of macos bless since it's a system binary, lmk what you think and i can also fix it
I'd be fine with just removing bless of the supported list of hex editors. Do you want to send a PR? :)
Activity
mhils commentedon Aug 3, 2025
Thank you for your report. No idea what's going on here. Can you run mitmproxy with strace? Or maybe
RUST_LOG=TRACE mitmdump -vvv?Urie96 commentedon Aug 4, 2025
I tried
RUST_LOG=TRACE mitmproxy -vvv, but the output was identical to what I’d already seen—no extra details appeared.I’ve now found that the crash only happens when the request body contains Chinese characters.
For example, with this curl command mitmproxy refuses to let me edit the request (the response also contains Chinese, yet the response can be edited without issue):
With this curl command everything works fine:
When I install mitmproxy via Homebrew the behavior is different: I cannot edit requests or responses even when they contain no Chinese characters. In this case the Events tab shows the following traceback:
mhils commentedon Aug 4, 2025
This is outdated.
mhils commentedon Aug 4, 2025
I can reproduce this with the cURL request you posted though. Alternative repro:
Edit -> request body
repro.mitm.zip
caiquejjx commentedon Oct 25, 2025
I checked this and there are two issues:
1 - It mistakes the request body data as binary due to the chinese chars, which I fixed in this pr
2 - It uses
blessas hexeditor because macos has it's ownblessbinary but it's not a hex editor which causes the weird error messages:About the second issue I guess it should be addressed in another pr and my simplest idea would be to check if the
whichresponse contains/sbinwhich is the case of macos bless since it's a system binary, lmk what you think and i can also fix itmhils commentedon Oct 27, 2025
I'd be fine with just removing bless of the supported list of hex editors. Do you want to send a PR? :)