Skip to content

fix: validate paths after stripping publicPath - #77

Merged
chenjiahan merged 2 commits into
mainfrom
chenjiahan/guard-stripped-public-path
Oct 22, 2026
Merged

chenjiahan merged 2 commits into
mainfrom
chenjiahan/guard-stripped-public-path

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Summary

The existing containment check blocks files outside the output directory, but a request such as /static../dist/index.html can leave and re-enter that directory after stripping publicPath: "/static". Validate the stripped remainder before joining it to the output path so these requests return 403, while retaining the final containment check and the fast path for ordinary requests.

Add one regression case using the existing traversal fixture across all six frameworks; it returns 200 before this change and 403 afterward.

Related Links

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-22T03:10:39.153106Z 84e3135 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chenjiahan
chenjiahan merged commit 5ee1f63 into main Oct 22, 2026
5 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/guard-stripped-public-path branch October 22, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant