Skip to content

fix(auth): validate device-login verification URLs - #118

Merged
jlrickert merged 1 commit into
mainfrom
fix/device-login-url-validation
Sep 28, 2026
Merged

jlrickert merged 1 commit into
mainfrom
fix/device-login-url-validation

Conversation

@jlrickert

Copy link
Copy Markdown
Owner

Summary

The device flow opened whatever verification URL the hub returned. A hostile or spoofed hub could return a file:, javascript:, or cross-origin address, and on Windows the URL went through cmd.exe, where shell metacharacters are interpreted.

  • ValidateBrowserURL accepts only HTTP(S) URLs with no embedded credentials or control characters.
  • Device login additionally requires verification_uri and verification_uri_complete to match the configured hub's origin (scheme, host, effective port).
  • On Windows, the URL is printed for manual opening instead of being passed to cmd /c start.

Testing

  • New pkg/tapper/browser_security_test.go
  • go build, go vet, go test ./..., -race for keg/tapper/parity
  • task lint:docs, task lint:fs

The device flow opened whatever verification URL the hub returned. A
hostile or spoofed hub could hand back a file:, javascript:, or
cross-origin address, and on Windows the URL went through cmd.exe. The
verification URLs must now be HTTP(S) on the configured hub's origin,
and Windows prints the URL for manual opening instead of shelling out.
@jlrickert
jlrickert merged commit 082656f into main Sep 28, 2026
1 check failed
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