fix: harden serve.py redirects, docs prefix, traversal, and 404s#605
Open
Chessing234 wants to merge 3 commits into
Open
fix: harden serve.py redirects, docs prefix, traversal, and 404s#605Chessing234 wants to merge 3 commits into
Chessing234 wants to merge 3 commits into
Conversation
Bare /analysis did not match /analysis/ and raised FileNotFoundError. Co-authored-by: Cursor <cursoragent@cursor.com>
/analysis/docs was treated as a book path under /analysis/, so it served BOOK_SITE/docs instead of the doc-gen tree. Co-authored-by: Cursor <cursoragent@cursor.com>
os.path.join allowed .. escapes under /analysis; raising FileNotFoundError skipped SimpleHTTPRequestHandler's 404 path. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 23, 2026
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.
Summary
/analysisto/analysis/(was raisingFileNotFoundError)./analysis/docs(no trailing slash) toDOCS_SITEinstead ofBOOK_SITE/docs...path traversal under/analysisand return.missingfor unknown URLs (clean 404).Branches:
fix/serve-redirect-analysis,fix/serve-docs-prefix,fix/serve-traversal-and-404.Supersedes #597 and the
serve.pyhalf of #602.Test plan
/analysis→ 301/analysis//analysis/docs→ underDOCS_SITE/analysis/../etc/passwd→.path-rejected/foo→.missing