Repository navigation
fix(view): contain the resolved view path to the views root - #7520
Closed
arcgod-design wants to merge 1 commit into
Closed
arcgod-design wants to merge 1 commit into
arcgod-design wants to merge 1 commit into
Conversation
View.prototype.lookup resolved paths without checking that the result stays inside the configured views directory, allowing path traversal through user-supplied view names (mirrors the containment check the send library applies for res.sendFile). closes expressjs#7140
arcgod-design
pushed a commit
to arcgod-design/gitswipe
that referenced
this pull request
Oct 11, 2026
…ch detection, automated PR creation THE REAL PR LANDED: expressjs/express#7520 - the full loop on a real major OSS repo: swipe -> nemotron analysis -> task contract -> worktree -> the fix -> fork -> push -> PR, closes #7140. The gh wiring (user directive: 'include this as github cli check and logged in and etc and allow gitswipe harness to use it properly'): - checkGitHubCli(): installed + version + logged-in account; reported in the serve banner and used at dispatch (the honest fallback chain when gh is absent: API -> compare-URL handoff) - forkRepository(): 'gh repo fork <o>/<r> --clone=false' when logged in - defaultBranchOf(): via 'gh api repos/<r> --jq default_branch' - the express PR failed on 'main' because the default branch is MASTER; the contract's base_branch + pr_base_branch now derive from the repo's ACTUAL default, never a hardcoded guess - createPullRequestViaCli(): 'gh pr create' with the fallback detail; the adapter's approved-push path now creates the PR automatically (thinking-summary 'creating the pull request...' + the completed summary carries the PR URL; gh-absent -> the compare-URL line) - The dispatch path sets forkOwner on the adapter (from the gh login) + configures remotes: origin = the fork, upstream = the target - 191/191 tests, typecheck clean
Contributor
|
Duplicate of #7142 |
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.
What
Adds a path-containment check to
View.prototype.lookup()so a resolved view path must stay inside the configured views directory, mirroring the root containmentres.sendFile()gets from thesendlibrary.Why
lookup()usedpath.resolve(root, name)without validating the result stays withinroot. Combined withdecodeURIComponent()in route parameter decoding, applications that pass user input tores.render()are exposed to path traversal (issue #7140).How
After resolving, the resolved path is checked against
resolve(root) + path.sep; views outside the root are skipped by the existing iteration.closes #7140