Repository navigation
Commit 387ab43
committed
[fix.security.rho.D8+] over Tailscale the page loaded and the daemon said 403, which the UI renders as "backend offline"
Measured from this box: http://100.78.155.10:1338/ → 200, and
http://100.78.155.10:8901/health → 403. The Host allowlist derived this box's
addresses from `gethostname()` plus the source address of the DEFAULT ROUTE — so
the LAN address was in the set and the Tailscale address never was. A security
refusal was therefore wearing the costume of a dead service, and that is exactly
the report Ivan filed from the Mac earlier ("为什么显示 backend offline").
Now enumerates every address on every interface (`ip -o addr`), v4 and v6, with
v6 bracketed the way a Host header carries it, plus a documented
DIRAC_EXTRA_HOSTS escape hatch for NAMES — MagicDNS names and reverse-proxy
hostnames cannot be enumerated from an interface, and a wildcard is not an
acceptable substitute for a list.
THIS DOES NOT WIDEN THE THREAT MODEL, and the reasoning is in the code: the
rebinding attack this check exists to stop is a page resolving ITS OWN hostname
to one of this box's addresses. Allowing all of the box's own addresses is
precisely the intent; what must never be allowed is a name that is not ours.
Verified in BOTH directions, because a widened allowlist that no longer refuses
anything would be worse than the bug: Tailscale/LAN/loopback all 200, and
`-H 'Host: evil.example.com'` still 403.
The 403 is now DIAGNOSABLE from the server side. The response stays opaque —
echoing the allowlist would hand an attacker this box's addresses — but the log
names the rejected Host and prints the exact fix:
[host] REFUSED Host='evil.example.com' — not one of this box's 14 known
names/addresses. If this is a real interface or DNS name, add it:
DIRAC_EXTRA_HOSTS=evil.example.com
A refusal that names neither the actor nor the way forward is the product rule
this repo already applies to chemistry errors; there was no reason for the
security path to be exempt. The interface-enumeration failure is loud for the
same reason: silently falling back to the old narrow set would restore the
outage-shaped 403 with nothing on screen to explain it.1 parent d02b496 commit 387ab43
1 file changed
Lines changed: 48 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1374 | 1374 | | |
1375 | 1375 | | |
1376 | 1376 | | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
1377 | 1413 | | |
1378 | 1414 | | |
1379 | 1415 | | |
| |||
1384 | 1420 | | |
1385 | 1421 | | |
1386 | 1422 | | |
1387 | | - | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
1388 | 1435 | | |
1389 | 1436 | | |
1390 | 1437 | | |
| |||
0 commit comments