Skip to content

fix(deps): bump @fastify/swagger-ui to 6.x for the @fastify/static advisory - #204

Merged
aquie00t merged 1 commit into
mainfrom
fix/fastify-static-advisory
Aug 24, 2026
Merged

fix(deps): bump @fastify/swagger-ui to 6.x for the @fastify/static advisory#204
aquie00t merged 1 commit into
mainfrom
fix/fastify-static-advisory

Conversation

@aquie00t

Copy link
Copy Markdown
Collaborator

What does this PR do?

Closes the second advisory dependabot reported it cannot fix (#90):

The latest possible version of @fastify/static that can be installed is 9.1.3. The earliest fixed version is 10.1.2.

@fastify/swagger-ui@5.2.6 pins @fastify/static at 9.1.3, so there is no in-range update. This bumps @fastify/swagger-ui 5.2.6 → 6.1.1, which declares @fastify/static: ^10.1.0 and resolves to 10.1.3.

Why bump swagger-ui instead of overriding @fastify/static

I flagged this one in #203 as deserving its own review, and that still holds. Overriding @fastify/static to 10.x underneath swagger-ui 5 would force a major across a boundary swagger-ui 5's own code was never tested against — the same class of move that made the exact hono pin backfire in #184. Bumping swagger-ui is the supported path, and it lines up with the rest of the tree: 6.1.1 wants fastify-plugin ^6.0.0, which main already runs since #200.

Verification — I booted the app rather than trusting the version

A swagger-ui major is exactly the kind of bump where "tests pass" proves nothing, since no test hits the docs route. So I initialised the real App and injected requests:

request result
GET /api/v1/docs 200, 950 bytes (UI shell)
GET /api/v1/docs/static/index.html 302/api/v1/docs/ (expected swagger-ui behaviour)
GET /api/v1/docs/static/swagger-ui-bundle.js 200, 1.5 MB — assets serve through @fastify/static 10.1.3
GET /api/v1/docs/json 200, 41 KB OpenAPI document
GET /api/v1/docs/static/../../../package.json 404 — the advisory's own shape, not escaping

Plus pnpm lint, pnpm format:check, pnpm build, pnpm test:unit 597/597.

Result

pnpm audit
No known vulnerabilities found

Zero advisories at any severity, down from 45 (16 high) when this started. For the record, the chain that got here: #184 made the overrides actually apply, #198 raised the stale lodash floor, #203 handled deepmerge-ts, and this one clears the last.

Worth noting the audit step in CI is continue-on-error since #183 — so it will not gate on this, but it is now genuinely green rather than merely non-blocking.


Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Chore

Checklist

  • My branch follows the naming convention (feature/, fix/, chore/, docs/)
  • My commits follow Conventional Commits
  • I have tested my changes locally
  • I have not introduced any breaking changes
  • I have updated relevant documentation if needed

🤖 Generated with Claude Code

…visory

@fastify/swagger-ui 5.2.6 pins @fastify/static to 9.1.3, so the route-guard
bypass via non-leading .. and %2E%2E segments (patched in 10.1.2) has no
in-range fix and dependabot cannot resolve it.

Overriding @fastify/static to 10.x under swagger-ui 5 would force a major
across a boundary its own code was never tested against. Bumping swagger-ui
instead is the supported path: 6.1.1 declares @fastify/static ^10.1.0, which
resolves to 10.1.3, and fastify-plugin ^6.0.0, which main already runs since
 #200.

Verified by booting the app and injecting requests rather than trusting the
version bump: the docs shell, the static asset bundle and the OpenAPI json
all serve, and a non-leading traversal segment gets a 404.

pnpm audit is now clean — no known vulnerabilities at any severity.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@aquie00t
aquie00t merged commit 60a05d2 into main Aug 24, 2026
10 checks passed
@aquie00t
aquie00t deleted the fix/fastify-static-advisory branch August 24, 2026 19:52
github-actions Bot pushed a commit that referenced this pull request Aug 24, 2026
## [1.0.5](v1.0.4...v1.0.5) (2026-08-24)

### Bug Fixes

* **deps:** bump @fastify/swagger-ui to 6.x for the @fastify/static advisory ([#204](#204)) ([60a05d2](60a05d2))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant