chore(deps): patch runtime security vulns and fix flaky username test - #50
Merged
Conversation
Bump elysia to ^1.4.29 and force patched axios (^1.18.0), form-data (^4.0.6) and follow-redirects (^1.16.0) through a package.json "overrides" block. The critical CVEs (axios prototype pollution, SSRF and credential leaks) reached the tree transitively via @sendgrid/mail. Overrides dedupe the vulnerable nested copies across the whole dependency tree without promoting these transitives to direct dependencies. bun audit drops from 50 to 21 findings; the remainder are dev-only tooling and low-impact. All 244 tests pass.
UserMother built users with faker.internet.username(), which often
exceeds the domain's 14-char username limit. Built via User.from()
(no validation), the invalid entity was created silently; the
"keep own username" test then fed it to updateUsername(), which
validates length and threw, making the test fail intermittently.
Use faker.string.sample({ min: 1, max: 14 }), matching the pattern
already used by UserUsernameUpdaterRequestMother so the mother yields
entities that respect the domain invariant. Verified flake-free
across 20 consecutive runs.
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
bun auditdrops from 50 to 21findings, eliminating every high/critical runtime CVE (axios, form-data,
follow-redirects, elysia, file-type).
UserUsernameUpdatercaused byUserMothergenerating domain-invalid usernames.Security changes
The worst CVEs (axios prototype pollution, SSRF, credential leaks) reached the
tree transitively through
@sendgrid/mail. A plainbun updateleft thevulnerable nested copies in place and promoted transitives to direct deps, so
this uses a
package.jsonoverridesblock to force patched versions acrossthe whole tree without polluting direct dependencies. SendGrid pins axios
^1.12.0, so1.18.0stays within its contract — no breakage.The remaining 21 findings are dev-only tooling (eslint / commitlint /
lint-staged) plus low-impact transitives where forcing overrides would risk
breaking typeorm/svix for near-zero real gain.
Test fix
UserMotherbuilt users viaUser.from()(no validation) withfaker.internet.username(), which often exceeds the domain's 14-char usernamelimit. The "keep own username" test fed that value into
updateUsername()—which does validate length and threw — so the test failed ~50% of runs.
Switched to
faker.string.sample({ min: 1, max: 14 }), matching the patternalready used by
UserUsernameUpdaterRequestMother.Changes
package.jsonoverridesblockbun.locktests/unit/modules/users/mothers/UserMother.tsTest plan
bun audit— 50 → 21 findings, no runtime high/critical leftbun test— 244 pass / 0 fail