Skip to content

Validate TUS Location origin and bump pulsevault-mieweb - #36

Merged
morepriyam merged 1 commit into
mainfrom
fix/tus-client-location-origin-check
Jul 1, 2026
Merged

morepriyam merged 1 commit into
mainfrom
fix/tus-client-location-origin-check

Conversation

@morepriyam

Copy link
Copy Markdown
Collaborator

Summary

resolveLocation in tus-client.ts resolved the server's Location response header via new URL(location, base) with no check that the result stayed on the paired server's origin. A malicious or compromised paired server could return an absolute Location on a different host and receive every subsequent HEAD/PATCH/DELETE for that upload — each carrying Authorization: Bearer <token> — redirecting the capability token to that host instead. This is the "token redirect" threat named in RFC 6750 §10.4, and matches the same-origin validation OWASP recommends for any server-supplied redirect target before resending credentials.

resolveLocation now throws a non-retryable error if the resolved location's origin doesn't match the paired server's.

Also bumps the pulsevault-mieweb submodule to pick up the corresponding server-side fix for the same class of bug — authorize() was resolving a different artifactId than the one a PATCH/HEAD request actually operated on — plus the other hardening merged there (streaming checksum validation, storage collision-guard fixes, https enforcement in buildUploadLink).

Test plan

  • tus-client.test.ts — 8/8 passing, including two new tests: rejects a cross-origin Location, accepts a same-origin Location on a different path prefix
  • tsc --noEmit — clean

…s origin

resolveLocation resolved the server's Location response header via
new URL(location, base) with no check that the result stayed on the
paired server's origin. A malicious or compromised paired server
could return an absolute Location on a different host and receive
every subsequent HEAD/PATCH/DELETE for that upload — each carrying
Authorization: Bearer <token> — redirecting the capability token to
that host instead. This is the "token redirect" threat named in
RFC 6750 §10.4, and the same same-origin validation OWASP recommends
for any server-supplied redirect target before resending credentials.

resolveLocation now throws a non-retryable TusUploadError if the
resolved location's origin doesn't match the paired server's.

Bumps the pulsevault-mieweb submodule to pick up the corresponding
server-side fix for the same class of bug (authorize() resolving a
different artifactId than the one a request actually operates on),
plus the other hardening in that release.
@morepriyam
morepriyam merged commit 8c86ab7 into main Jul 1, 2026
1 check passed
@morepriyam
morepriyam deleted the fix/tus-client-location-origin-check branch July 1, 2026 06:38
morepriyam added a commit that referenced this pull request Aug 12, 2026
…-check

Validate TUS Location origin and bump pulsevault-mieweb
@morepriyam morepriyam self-assigned this Aug 14, 2026
@github-project-automation github-project-automation Bot moved this from Ready to Done in Scrum Team Jerry Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant