Skip to content

Validate forge URLs before opening a browser - #196

Open
andrew wants to merge 1 commit into
mainfrom
fix/browser-url-validation
Open

andrew wants to merge 1 commit into
mainfrom
fix/browser-url-validation

Conversation

@andrew

@andrew andrew commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

browse and the issue, PR, and label --web commands passed forge-supplied URLs directly to the system opener. Validate the final destination before launching: require an absolute HTTP(S) URL without userinfo, and match its host and port against the resolved forge host. This rejects local paths, custom protocols, opener options, and unrelated hosts while preserving HTTP self-hosted instances.

Add CLI regression coverage using API responses with unsafe repository, issue, and PR URLs, plus validation cases for malformed URLs, host spoofing, IPv6, and configured ports. browse --no-browser continues to print the URL without opening it.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 13:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

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.

2 participants