Skip to content

fix(security): prevent SSRF via unvalidated GitHub Enterprise URL in Copilot plugin#22

Open
tejas0077 wants to merge 9308 commits into
CyberStrikeus:mainfrom
tejas0077:fix/security-oauth-credential-detection
Open

fix(security): prevent SSRF via unvalidated GitHub Enterprise URL in Copilot plugin#22
tejas0077 wants to merge 9308 commits into
CyberStrikeus:mainfrom
tejas0077:fix/security-oauth-credential-detection

Conversation

@tejas0077

@tejas0077 tejas0077 commented Mar 19, 2026

Copy link
Copy Markdown

Fixes #23
What does this PR do?
Fixes a Server-Side Request Forgery (SSRF) vulnerability in the GitHub Copilot plugin where the enterpriseUrl input was only validated for URL format but not checked against safe domain patterns.
An attacker could supply internal addresses (127.0.0.1, localhost, 192.168.x.x) or attacker-controlled domains, causing CyberStrike to make OAuth requests to unintended endpoints and forward Bearer tokens to those endpoints.
Related to CWE-918 (Server-Side Request Forgery).
Type of change

Bug fix
Security tool / MCP server / Bolt plugin

Security impact

This PR modifies authentication / authorization logic

How did you verify it works?
Manually tested with the following inputs:

localhost → rejected with "Internal or loopback addresses are not allowed"
127.0.0.1 → rejected with "Internal or loopback addresses are not allowed"
192.168.1.1 → rejected with "Internal or loopback addresses are not allowed"
company.ghe.com → accepted correctly
github.mycompany.com → accepted correctly

Reviewed the fetch call chain to confirm baseURL, DEVICE_CODE_URL, and ACCESS_TOKEN_URL are always constructed from validated domains only. Defense in depth applied at both the UI validate hook and inside authorize().
Checklist

PR is focused on a single change
No secrets, credentials, or API keys in the diff
bun turbo typecheck passes
Tested locally with at least one LLM provider
Breaking changes are documented (if any)

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.