Skip to content

fix: add origin check to mockServiceWorker.js message handler#49

Merged
Faustze merged 1 commit into
mainfrom
fix/msw-origin-check
Jul 13, 2026
Merged

fix: add origin check to mockServiceWorker.js message handler#49
Faustze merged 1 commit into
mainfrom
fix/msw-origin-check

Conversation

@Faustze

@Faustze Faustze commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds an explicit origin check to the message handler in frontend/public/mockServiceWorker.js, closing the js/missing-origin-check CodeQL alert directly rather than just excluding the (MSW-generated) file from scanning.
  • Removes the paths-ignore added for this file in the CodeQL workflow now that the underlying finding is actually fixed.
  • Note: this file is regenerated by npx msw init and its header says not to hand-edit it — if it's ever regenerated, this check will need to be reapplied (or upstreamed to mswjs/msw).

Test plan

  • YAML and JS syntax validated
  • CI passes on this PR
  • Manual smoke test: MSW mocking still works in dev (pnpm dev, confirm mocked responses still intercepted)

Closes the js/missing-origin-check CodeQL alert instead of just
excluding the file from scanning. Service workers only ever control
same-origin clients, so this is defense-in-depth rather than a real
gap, but it satisfies the check without changing behavior. Drops the
paths-ignore added earlier now that the underlying finding is fixed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Faustze
Faustze merged commit ad24453 into main Jul 13, 2026
6 checks passed
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