diff options
| author | NWX10 <179748639+NWX10@users.noreply.github.com> | 2026-11-22 00:10:33 +0300 |
|---|---|---|
| committer | NWX10 <179748639+NWX10@users.noreply.github.com> | 2026-11-22 00:28:32 +0300 |
| commit | ed9c90a463731c1b921137d66988002178046aea (patch) | |
| tree | 1ff90aec90e9520cc0ace130497a0b924f73274c /runtime/src/pe_loader.cpp | |
| parent | 4e390e0871d7265e629b51aca8ff99a15a6a6845 (diff) | |
viewer/serve.py: answer only requests addressed to 127.0.0.1 or localhost (DNS rebinding)
The viewer binds to 127.0.0.1, which keeps other machines out but not
other web pages: a page on any site can point its own domain at 127.0.0.1
(DNS rebinding) and then fetch http://<its domain>:8765/world/... as
same-origin, reading world.json and the .glb chunks built from the
player's copy. Those requests still carry the page's domain in the Host
header.
send_head now refuses (403) any request whose Host is not 127.0.0.1,
localhost or [::1] (any port, any case, trailing dot allowed). A request
with no Host header (a local tool, never a browser) is still served.
tests/test_world_build.py: host_allowed cases, and a live-server test
where Host rebind.example gets 403 without the world data while
localhost/127.0.0.1 get 200. Both fail on main.
AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/pe_loader.cpp')
0 files changed, 0 insertions, 0 deletions