Skip to content

chore: pin supertest to the same major real Express's own suite uses - #32

Merged
otnc merged 2 commits into
mainfrom
chore/pin-supertest-to-match-express
Sep 11, 2026
Merged

otnc merged 2 commits into
mainfrom
chore/pin-supertest-to-match-express

Conversation

@otnc

@otnc otnc commented Sep 11, 2026

Copy link
Copy Markdown
Owner

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.

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).
@socket-security

socket-security Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedsupertest@​7.2.2 ⏵ 6.3.499 +110010050 -37100

View full report

Resolves the conflict from #30 and #33 merging first (both touched
README.md's status line and/or the express-suite baseline). Numbers
recomputed by rerunning both suites fresh against the combined
source.
@otnc
otnc merged commit 8264f94 into main Sep 11, 2026
5 checks passed
@otnc
otnc deleted the chore/pin-supertest-to-match-express branch September 11, 2026 17:31
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