-
Notifications
You must be signed in to change notification settings - Fork 45
fix: prevent IPs from being used as long URL #2418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds validation to prevent IP addresses (both internal and private) from being used as long URLs in the link shortening service. This addresses a security vulnerability where users could potentially use IP addresses to access internal network resources. The fix is implemented in the shared validation utility and will be enforced across the dashboard, API, and bulk upload features.
Key Changes:
- Added IP address validation to
isValidUrl()function usingvalidator.isIP()to reject URLs with IP-based hostnames - Updated
package-lock.jsonwith automatic dependency updates, including movingdate-fnsfrom dev to production dependencies (correctly reflects its usage in production code)
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/shared/util/validation.ts | Added IP address check after URL validation to reject URLs with IP-based hostnames |
| package-lock.json | Automatic lockfile updates including dependency classification fixes (date-fns moved to production) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dcshzj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving first, but I think Copilot got valid points regarding the test coverage, would be good to add.
f72871d to
081f8fd
Compare
we do this so that if there's a drift in validation we can still return a result
081f8fd to
f8c17a3
Compare
Problem
closes https://linear.app/ogp/issue/ISOM-2009/vapt-low-internal-and-private-ip-addresses-as-long-urls
Solution