Skip to content

[Bug] [Security] -H 0.0.0.0 serves wrong IP address on MacOS #8868

Closed

Description

@kfsone

name: Unsloth Studio Bug
about: Report a problem with the Unsloth Studio desktop app or web UI
title: "[Studio Bug] [Security] -H 0.0.0.0 serves wrong IP address on MacOS"
labels: bug, security
assignees: ""

Environment

Where are you using Unsloth?

  • Studio desktop application
  • Studio web UI (unsloth studio)
  • Unsloth CLI
  • Python package or notebook
  • Colab or Kaggle

Operating system and version:

      Model Name: Mac mini
      Model Identifier: Mac14,12
      Model Number: Z170000FTLL/A
      Chip: Apple M2 Pro
      Total Number of Cores: 10 (6 Performance and 4 Efficiency)
      Memory: 32 GB
Mac|zsh% sw_vers
ProductName:            macOS
ProductVersion:         26.5.2
BuildVersion:           25F84

GPU model(s) and accelerator backend:
CPU/MLX

Versions:
unsloth 2026.8.15

What happened?

  1. clean install (no pre-existing config)
  2. unsloth studio -p 8888 -H 0.0.0.0

NOTE: No --cloudflare, tested with pristine unsloth install on fresh machine, pristine env.

Expected behavior:

INFO:     Unsloth Studio running on http://0.0.0.0:8888 (To stop: press Ctrl+C -- on macOS, Control+C not Command+C)

Actual behavior:

INFO:     Unsloth Studio running on http://104.32.48.18:8888 (To stop: press Ctrl+C -- on macOS, Control+C not Command+C)

Model and operation involved:
Operation: Startup

Diagnostics and logs

Session log: /Users/oliver.smith/.unsloth/studio/logs/server/server-20260814-133050-pid26022.log
Loading Unsloth Studio, please wait... (this can take a few minutes)
  - loading PyTorch, Unsloth and Transformers...
{"timestamp": "2026-08-14T20:30:52.634600Z", "level": "info", "event": "Imported FastAPI app in 2056.3ms"}
  - Starting server...
{"timestamp": "2026-08-14T20:30:52.636303Z", "level": "info", "event": "Ensured Unsloth directories in 2292.4ms"}
[OK] Frontend loaded from /Users/oliver.smith/.unsloth/studio/unsloth_studio/lib/python3.13/site-packages/studio/frontend/dist
{"timestamp": "2026-08-14T20:30:52.741546Z", "level": "info", "event": "run_server pre-uvicorn setup completed in 2397.7ms"}
�[32mINFO�[0m:     Started server process [�[36m26022�[0m]
�[32mINFO�[0m:     Waiting for application startup.
{"timestamp": "2026-08-14T20:30:53.110478Z", "level": "info", "event": "Removing unsloth compiled cache: /Users/oliver.smith/.unsloth/studio/compiled_cache"}
{"timestamp": "2026-08-14T20:30:53.315279Z", "level": "info", "event": "lifespan pre-auth setup completed in 205.6ms"}

============================================================
DEFAULT ADMIN ACCOUNT CREATED
    username: unsloth
    password saved to: /Users/oliver.smith/.unsloth/studio/auth/.bootstrap_password
    Open the Unsloth UI to sign in and change it.
============================================================

{"timestamp": "2026-08-14T20:30:53.347406Z", "level": "info", "event": "lifespan startup completed in 237.7ms"}
�[32mINFO�[0m:     Application startup complete.
�[32mINFO�[0m:     Unsloth Studio running on �[1mhttp://104.32.48.18:8888�[0m (To stop: press Ctrl+C -- on macOS, Control+C not Command+C)
{"timestamp": "2026-08-14T20:30:53.349366Z", "level": "info", "event": "Uvicorn startup hook completed in 3005.5ms"}
{"timestamp": "2026-08-14T20:30:53.349532Z", "level": "info", "event": "run_server uvicorn ready after 3005.7ms"}
{"timestamp": "2026-08-14T20:30:53.558735Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/export/status", "status_code": 401, "process_time_ms": 106.39}
{"timestamp": "2026-08-14T20:30:53.561703Z", "level": "info", "event": "Unsloth will shut down in 3600s unless the default admin password is changed."}

�[38;5;150m🦥 Unsloth Studio is running�[0m
�[38;5;245m────────────────────────────────────────────────────�[0m
�[38;5;245m  On this machine -- open this in your browser:�[0m
�[38;5;108;1m    http://127.0.0.1:8888�[0m
�[38;5;245m    (same as http://localhost:8888)�[0m

�[38;5;245m  From another device on your network / to share:�[0m
�[38;5;109m    http://104.32.48.18:8888�[0m

�[38;5;245m  API & health:�[0m
�[38;5;109m    http://127.0.0.1:8888/api�[0m
�[38;5;109m    http://127.0.0.1:8888/api/health�[0m
�[38;5;245m────────────────────────────────────────────────────�[0m
{"timestamp": "2026-08-14T20:30:53.572467Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/export/status", "status_code": 401, "process_time_ms": 1.57}
{"timestamp": "2026-08-14T20:30:53.585724Z", "level": "info", "event": "request_completed", "method": "POST", "path": "/api/auth/refresh", "status_code": 401, "process_time_ms": 2.29}
{"timestamp": "2026-08-14T20:30:53.619930Z", "level": "info", "event": "request_completed", "method": "POST", "path": "/api/auth/refresh", "status_code": 401, "process_time_ms": 4.22}
{"timestamp": "2026-08-14T20:30:53.626158Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/auth/status", "status_code": 200, "process_time_ms": 5.83}
{"timestamp": "2026-08-14T20:30:53.721990Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/change-password", "status_code": 200, "process_time_ms": 31.89}
{"timestamp": "2026-08-14T20:30:55.274121Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/health", "status_code": 200, "process_time_ms": 1018.16}
W0814 13:30:56.249000 26022 torch/distributed/elastic/multiprocessing/redirects.py:29] NOTE: Redirects are currently not supported in Windows or MacOs.
Hardware detected: MLX — Apple Silicon (arm64)
{"timestamp": "2026-08-14T20:30:56.549403Z", "level": "info", "event": "InferenceOrchestrator initialized (subprocess mode)"}

�[38;5;203;1m  Reachability check: http://104.32.48.18:8888/ is NOT reachable from the public internet (3/3 probe nodes failed).�[0m
�[38;5;245m    Usually a cloud firewall (AWS security group, GCP firewall / Azure NSG rule) or home router isn't allowing inbound TCP 8888.�[0m
�[38;5;245m    No firewall change needed -- SSH local-forward from your own computer:�[0m
�[38;5;245m        ssh -L 8888:localhost:8888 <user>@104.32.48.18�[0m
�[38;5;245m    then open http://localhost:8888/ in your browser.�[0m
�[38;5;108;1m  You can access Unsloth Studio locally in the meantime: http://127.0.0.1:8888�[0m
  Cloudflare tunnel: OFF (default). Unsloth is reachable on your local network only. Pass --cloudflare to expose a public Cloudflare HTTPS link.
Server-side tools follow each request's enable_tools; the Studio UI's tool toggles decide. Pass --enable-tools to force them on for every request.

�[38;5;215;1m  To stop Unsloth Studio: press Ctrl+C (Control+C, not Command+C, on macOS).�[0m
�[38;5;245m────────────────────────────────────────────────────�[0m

{"timestamp": "2026-08-14T20:31:00.649398Z", "level": "info", "event": "torch warm finished in 7302.1ms"}
{"timestamp": "2026-08-14T20:34:11.965500Z", "level": "info", "event": "Graceful shutdown initiated -- cleaning up subprocesses..."}
{"timestamp": "2026-08-14T20:34:11.967683Z", "level": "info", "event": "All subprocesses cleaned up"}

Shutting down...
�[32mINFO�[0m:     Shutting down
�[32mINFO�[0m:     Waiting for application shutdown.
{"timestamp": "2026-08-14T20:34:12.115719Z", "level": "info", "event": "Removing unsloth compiled cache: /Users/oliver.smith/.unsloth/studio/compiled_cache"}
�[32mINFO�[0m:     Application shutdown complete.
�[32mINFO�[0m:     Finished server process [�[36m26022�[0m]

Raw output:

  Start Unsloth Studio now? [Y/n] n
  launch         to start later, run:
                 unsloth studio -p 8888
                 (add -H 0.0.0.0 for LAN / cloud access; exposes the raw port only, not a public URL)
                 (add -H 0.0.0.0 --cloudflare for a public Cloudflare HTTPS link, or --secure to keep the raw port private; anyone with the API key can run code)


[26-08-14 13:30:40 ~]
Mac|zsh% unsloth studio -p 8888 -H 0.0.0.0
Starting Unsloth Studio on http://104.32.48.18:8888
2026-08-14 13:30:50 [info     ] run_server startup begin api_only=False host=0.0.0.0 port=8888
Child-process cleanup on abnormal exit is NOT guaranteed: no kernel-level parent-death signal on this platform. Children may survive a crash or a force quit; the startup sweep reaps them on the next launch.
Session log: /Users/oliver.smith/.unsloth/studio/logs/server/server-20260814-133050-pid26022.log
Loading Unsloth Studio, please wait... (this can take a few minutes)
  - loading PyTorch, Unsloth and Transformers...
{"timestamp": "2026-08-14T20:30:52.634600Z", "level": "info", "event": "Imported FastAPI app in 2056.3ms"}
  - Starting server...
{"timestamp": "2026-08-14T20:30:52.636303Z", "level": "info", "event": "Ensured Unsloth directories in 2292.4ms"}
[OK] Frontend loaded from /Users/oliver.smith/.unsloth/studio/unsloth_studio/lib/python3.13/site-packages/studio/frontend/dist
{"timestamp": "2026-08-14T20:30:52.741546Z", "level": "info", "event": "run_server pre-uvicorn setup completed in 2397.7ms"}
INFO:     Started server process [26022]
INFO:     Waiting for application startup.
{"timestamp": "2026-08-14T20:30:53.110478Z", "level": "info", "event": "Removing unsloth compiled cache: /Users/oliver.smith/.unsloth/studio/compiled_cache"}
{"timestamp": "2026-08-14T20:30:53.315279Z", "level": "info", "event": "lifespan pre-auth setup completed in 205.6ms"}

============================================================
DEFAULT ADMIN ACCOUNT CREATED
    username: unsloth
    password saved to: /Users/oliver.smith/.unsloth/studio/auth/.bootstrap_password
    Open the Unsloth UI to sign in and change it.
============================================================

{"timestamp": "2026-08-14T20:30:53.347406Z", "level": "info", "event": "lifespan startup completed in 237.7ms"}
INFO:     Application startup complete.
INFO:     Unsloth Studio running on http://104.32.48.18:8888 (To stop: press Ctrl+C -- on macOS, Control+C not Command+C)
{"timestamp": "2026-08-14T20:30:53.349366Z", "level": "info", "event": "Uvicorn startup hook completed in 3005.5ms"}
{"timestamp": "2026-08-14T20:30:53.349532Z", "level": "info", "event": "run_server uvicorn ready after 3005.7ms"}
{"timestamp": "2026-08-14T20:30:53.558735Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/export/status", "status_code": 401, "process_time_ms": 106.39}
{"timestamp": "2026-08-14T20:30:53.561703Z", "level": "info", "event": "Unsloth will shut down in 3600s unless the default admin password is changed."}

🦥 Unsloth Studio is running
────────────────────────────────────────────────────
  On this machine -- open this in your browser:
    http://127.0.0.1:8888
    (same as http://localhost:8888)

  From another device on your network / to share:
    http://104.32.48.18:8888

  API & health:
    http://127.0.0.1:8888/api
    http://127.0.0.1:8888/api/health
────────────────────────────────────────────────────
{"timestamp": "2026-08-14T20:30:53.572467Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/export/status", "status_code": 401, "process_time_ms": 1.57}
{"timestamp": "2026-08-14T20:30:53.585724Z", "level": "info", "event": "request_completed", "method": "POST", "path": "/api/auth/refresh", "status_code": 401, "process_time_ms": 2.29}
{"timestamp": "2026-08-14T20:30:53.619930Z", "level": "info", "event": "request_completed", "method": "POST", "path": "/api/auth/refresh", "status_code": 401, "process_time_ms": 4.22}
{"timestamp": "2026-08-14T20:30:53.626158Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/auth/status", "status_code": 200, "process_time_ms": 5.83}
{"timestamp": "2026-08-14T20:30:53.721990Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/change-password", "status_code": 200, "process_time_ms": 31.89}
{"timestamp": "2026-08-14T20:30:55.274121Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/health", "status_code": 200, "process_time_ms": 1018.16}
W0814 13:30:56.249000 26022 torch/distributed/elastic/multiprocessing/redirects.py:29] NOTE: Redirects are currently not supported in Windows or MacOs.
Hardware detected: MLX — Apple Silicon (arm64)
{"timestamp": "2026-08-14T20:30:56.549403Z", "level": "info", "event": "InferenceOrchestrator initialized (subprocess mode)"}

  Reachability check: http://104.32.48.18:8888/ is NOT reachable from the public internet (3/3 probe nodes failed).
    Usually a cloud firewall (AWS security group, GCP firewall / Azure NSG rule) or home router isn't allowing inbound TCP 8888.
    No firewall change needed -- SSH local-forward from your own computer:
        ssh -L 8888:localhost:8888 <user>@104.32.48.18
    then open http://localhost:8888/ in your browser.
  You can access Unsloth Studio locally in the meantime: http://127.0.0.1:8888
  Cloudflare tunnel: OFF (default). Unsloth is reachable on your local network only. Pass --cloudflare to expose a public Cloudflare HTTPS link.
Server-side tools follow each request's enable_tools; the Studio UI's tool toggles decide. Pass --enable-tools to force them on for every request.

  To stop Unsloth Studio: press Ctrl+C (Control+C, not Command+C, on macOS).
────────────────────────────────────────────────────

{"timestamp": "2026-08-14T20:31:00.649398Z", "level": "info", "event": "torch warm finished in 7302.1ms"}

## Additional context

Note this is attempting to expose the raw unencrypted http interface.

Activity

  1. added
    feature request
    on Aug 14, 2026
  2. kfsone commented on Aug 14, 2026

    @kfsone
    Author

    Also note the machine has no cloudflare interfaces or connections:

    Mac|zsh% sudo netstat -anb | grep 104\\.
    Mac|zsh% ifconfig | grep 104
    Mac|zsh% 
    
  3. Lyxot commented on Aug 16, 2026

    @Lyxot
    Collaborator

    That IP is the public IP assigned to you by your ISP. It’s usually unreachable unless you configure your router.

    But -h 0.0.0.0 is working as expected, and other devices on the same LAN can access it.

  4. kfsone commented on Aug 19, 2026

    @kfsone
    Author

    There is a massive difference between the public IP address of my network's gateway and the IP addresses of a device on my network.

    Common use of 0.0.0.0 is for machines on a DHCP network and/or with multiple interfaces such as load balancing, wifi+eth, etc. Especially with a raw, unencrypted HTTP port.

    There's a tiny set of scenarios where what unsloth is doing would work on an IPv4 network, and all of them are incredibly dangerous for an HTTP port:
    1- Running on public network whereby the device's local and publicly reachable addresses are the same,
    2- Running unsloth on the gateway device (eg with a modem or on your router),
    3- Running on the DMZ device inside a private network,

    #2 and #3 are going to require the user to set up port-forwarding before it can work anyway.

    I didn't ask unsloth to go out and expose probes to the internet to find my gateway address, I asked it to receive packets from multiple interfaces and not care when DHCP switched networks.

    "unsloth studio -p $port -H 0.0.0.0" should be private on any local interface, inc loopback
    suggest:

    unsloth studio -p $port --public
    unsloth studio -p $port --external
    unsloth studio -p $port -H 0.0.0.0 --external
    

    And unless that public/external flag is there, it has no business going announcing itself to the outside world to discover an ip address it has no business knowing/using internally.

  5. reopened this on Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfeature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions