Bug description
Starting with marimo 0.23.2, Chrome 147+ on macOS (Sequoia 26.4) shows "Can't open this page — Error code: 5" when navigating to http://127.0.0.1:2718 or http://localhost:2718 in edit mode. The server starts fine, curl returns HTTP 200 with valid HTML, but Chrome refuses to render the page.
marimo 0.23.1 and earlier work correctly with the same Chrome version and macOS configuration.
Root cause
PR #9170 (commit 727dc67) introduced two new response headers on HTML page responses:
_HTML_SECURITY_HEADERS: dict[str, str] = {
"Referrer-Policy": "no-referrer",
"X-Content-Type-Options": "nosniff",
}
These headers are added in marimo/_server/api/endpoints/assets.py (line 130–133).
Chrome 147 on macOS enforces Local Network Access permissions (introduced in Chrome 130+). When combined with Referrer-Policy: no-referrer, Chrome appears to treat the localhost page load as a private-network request without a valid referrer, triggering the Local Network Access check. If the macOS "Local Network" permission for Chrome has any edge-case state (toggled but not restarted, or enterprise-managed), Chrome blocks the page entirely with error code 5.
Evidence from bisection:
| Version |
Referrer-Policy header |
X-Content-Type-Options header |
Chrome 147 loads? |
| 0.20.4 |
absent |
absent |
✅ Yes |
| 0.21.0 |
absent |
absent |
✅ Yes |
| 0.22.0 |
absent |
absent |
✅ Yes |
| 0.23.1 |
absent |
absent |
✅ Yes |
| 0.23.2 |
no-referrer |
nosniff |
❌ Error code 5 |
| 0.23.3 |
no-referrer |
nosniff |
❌ Error code 5 |
| 0.23.5 |
no-referrer |
nosniff |
❌ Error code 5 |
Environment
- marimo: 0.23.2+ (broken), 0.23.1 (works)
- Chrome: 147.0.7727.138
- macOS: Sequoia 26.4.0 (darwin 25.4.0), Apple Silicon (arm64)
- Python: 3.13.5
- Launch command:
marimo edit notebook.py --port 2718 --host 127.0.0.1 --no-token
Steps to reproduce
- Install marimo 0.23.2+:
pip install marimo==0.23.5
- Start edit mode:
marimo edit notebook.py --host 127.0.0.1 --no-token
- Open
http://127.0.0.1:2718 in Chrome 147+ on macOS
- Observe "Can't open this page — Error code: 5"
- Downgrade to 0.23.1:
pip install marimo==0.23.1 and repeat — page loads fine
Workarounds
- Downgrade to marimo 0.23.1
- Use Safari instead of Chrome (Safari is not affected)
- Use
--host 0.0.0.0 instead of 127.0.0.1 (sometimes works)
Suggested fix
Consider making the Referrer-Policy header conditional — either:
- Only set it when
--token-auth is active (the header's purpose is to prevent token leakage via Referer, which is moot with --no-token)
- Use
Referrer-Policy: same-origin instead of no-referrer (still prevents cross-origin leakage but doesn't strip the referrer entirely for same-origin requests)
- Add
Access-Control-Allow-Private-Network: true to the response headers to explicitly satisfy Chrome's Private Network Access check
Option 2 seems like the best balance of security and compatibility.
Bug description
Starting with marimo 0.23.2, Chrome 147+ on macOS (Sequoia 26.4) shows "Can't open this page — Error code: 5" when navigating to
http://127.0.0.1:2718orhttp://localhost:2718in edit mode. The server starts fine,curlreturns HTTP 200 with valid HTML, but Chrome refuses to render the page.marimo 0.23.1 and earlier work correctly with the same Chrome version and macOS configuration.
Root cause
PR #9170 (commit
727dc67) introduced two new response headers on HTML page responses:These headers are added in
marimo/_server/api/endpoints/assets.py(line 130–133).Chrome 147 on macOS enforces Local Network Access permissions (introduced in Chrome 130+). When combined with
Referrer-Policy: no-referrer, Chrome appears to treat the localhost page load as a private-network request without a valid referrer, triggering the Local Network Access check. If the macOS "Local Network" permission for Chrome has any edge-case state (toggled but not restarted, or enterprise-managed), Chrome blocks the page entirely with error code 5.Evidence from bisection:
Referrer-PolicyheaderX-Content-Type-Optionsheaderno-referrernosniffno-referrernosniffno-referrernosniffEnvironment
marimo edit notebook.py --port 2718 --host 127.0.0.1 --no-tokenSteps to reproduce
pip install marimo==0.23.5marimo edit notebook.py --host 127.0.0.1 --no-tokenhttp://127.0.0.1:2718in Chrome 147+ on macOSpip install marimo==0.23.1and repeat — page loads fineWorkarounds
--host 0.0.0.0instead of127.0.0.1(sometimes works)Suggested fix
Consider making the
Referrer-Policyheader conditional — either:--token-authis active (the header's purpose is to prevent token leakage via Referer, which is moot with--no-token)Referrer-Policy: same-origininstead ofno-referrer(still prevents cross-origin leakage but doesn't strip the referrer entirely for same-origin requests)Access-Control-Allow-Private-Network: trueto the response headers to explicitly satisfy Chrome's Private Network Access checkOption 2 seems like the best balance of security and compatibility.