Repository navigation
chore: pin supertest to the same major real Express's own suite uses - #32
Merged
Merged
Conversation
Real Express pins supertest ^6.3.0 (v5) / ^6.1.6 (v4) in its own devDependencies, not the current ^7.x. Confirmed empirically (a plain Node http.Server + each supertest major) that this isn't cosmetic: supertest 7's superagent resolves a client-given path like '/users/../../todo.txt' through `new URL(path, base)` before the request ever reaches the wire, silently collapsing the dot-segments; supertest 6's superagent sends the literal path unchanged. Every one of the "unfixable" express.static() path-traversal suite failures investigated over the last several rounds turned out to be this -- not an exphono bug, not even reachable from userland, just the newer test client normalizing the attack away before the server ever saw it. Pinning to match the version real Express's own suite was written against lets the suite actually exercise what it was designed to exercise. Express suite: 1108/8 -> 1112/4 (v5, only the two client-abort cases and one -- express.text()'s unrelated inflate-timeout race -- remain). 1151/47 -> 1155/43 (v4, this branch measured directly against main since #30/#31 are still separate open PRs).
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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
Real Express pins `supertest ^6.3.0` (v5) / `^6.1.6` (v4) in its own devDependencies, not the current `^7.x` this project had. Confirmed empirically (a plain Node `http.Server` + each supertest major) that this isn't cosmetic: supertest 7's superagent resolves a client-given path like `/users/../../todo.txt` through `new URL(path, base)` before the request ever reaches the wire, silently collapsing the dot-segments; supertest 6's superagent sends the literal path unchanged.
Every one of the "unfixable" `express.static()` path-traversal suite failures investigated over the last several rounds (including #29's deep dive) turned out to be this -- not an exphono bug, not even reachable from userland, just the newer test client normalizing the attack away before the server ever saw it. Pinning to match the version real Express's own suite was written against lets the suite actually exercise what it was designed to exercise.
Test plan
Note
Per your instructions, this PR is not merged -- ready for your review. Once #30 (ENAMETOOLONG) also lands, "should 404 when URL too long" should clear too, leaving only the two client-abort cases in v5.