Skip to content

fix(sponsor): block internal sponsor links - #81

Open
aiirvizionz wants to merge 1 commit into
profullstack:masterfrom
aiirvizionz:clientkit/sponsor-url-guard
Open

fix(sponsor): block internal sponsor links#81
aiirvizionz wants to merge 1 commit into
profullstack:masterfrom
aiirvizionz:clientkit/sponsor-url-guard

Conversation

@aiirvizionz

Copy link
Copy Markdown
Contributor

Summary

  • route sponsor URL validation through the existing external URL guard
  • reject internal/private hosts such as localhost, private IPv4, and IPv6 loopback
  • preserve the existing user-facing errors for invalid URL and protocol inputs

Bug

Sponsor links were validated only for URL shape and http/https protocol. That allowed links to internal hosts to be stored for prize sponsorships, unlike other submitted external URLs in the app.

Validation

  • apps/web/node_modules/.bin/vitest.cmd run apps/web/lib/sponsor-url.test.ts apps/web/lib/url-guard.test.ts passed: 16 tests

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