Conversation
Salvage stale PR #7 against current main for issue aiming-lab#13. Share/copy boxes, hidden next fields, and GitHub host recovery no longer leak localhost or example.com placeholders. Relative next redirects are validated, and a regression checker plus unit tests cover the known leak classes. Co-authored-by: Xuanrui Li <xuanrui.li@se24.qmul.ac.uk>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reviewer takeover of stale author PR #7 for issue #13 (user-visible mirror URL leaks). Reimplemented against current
aiming-lab/WebHarbormain. Does not touch Best Buy (#135/#48), Google Flights (#136), the site registry, or.assets-revision.Original PR: #7 (
hqhq1025, May 2026, 0 comments, base far behind main)Fork branch: https://github.com/Lxr-max/WebHarbor/tree/cursor/fix-url-leak-realism-7f54
Problem
Share/copy/
next/localhost surfaces leaked local mirror hosts orexample.complaceholders:http://localhost:40008/place/<slug>https://example.com/<slug>request.urlinto hiddennextinputswindow.location.hrefhttp://localhost:40006Benchmark/runtime localhost URLs in
tasks.jsonland Docker docs are left intact.What changed
Salvaged #7’s approach and corrected GitHub host-header recovery:
example.comseed rows (no HF rewrite)seed_data.pywrites Maps URLs instead of placeholdersnextfields are root-relative; redirects accept only/...pathssource_url(BBC fallback if missing);main.jsno longer copies the mirror locationHost: github.comserves the local route in place instead of bouncing to:40006(avoids Fix user-visible mirror URL leaks #7’s relative-redirect loop when the Host header is sticky)docs/url-realism-audit.md,scripts/check_url_realism.py, andscripts/tests/test_url_realism.pyBerkeley still has a
request.urlnextinput; left out of scope because #13 did not list it.Verification
Results on this branch:
py_compileOKscripts/check_url_realism.py→URL realism checks passedpython3 -m unittest scripts.tests.test_url_realism→ 7/7 OKFlask
test_client(isolated Google Map SQLite):/place/galleria-vittorio-emanuelereturns 200https://www.google.com/maps/place/Galleria+Vittorio+Emanuele+II+Milan/localhost:40008orexample.com/galleria-vittorio-emanueleHelper contract tests (AST-loaded from the live site files, no full-app seed):
current_relative_url()keeps path+querysafe_redirect_target()rejectshttp://localhost:...,https://evil..., and//evil...bbc_article_share_url()preferssource_url, elsehttps://www.bbc.com/news/articles/<slug>is_external_github_host()is true forgithub.comand false for localhost/127.0.0.1Docker image rebuild /
/resetbyte-identity was not re-run here (no Docker daemon; seed DBs untouched; Google Map uses a runtime fallback for existingexample.comrows).Fixes #13.