mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-05 08:10:39 +00:00
CodeQL's Rust SSRF detector flagged the GitHub-and-provider HTTP calls in install mode because the `base_url` values flow through `pub` test-only setters (`with_github_api_base_url`, `with_provider_base_url`) that the analyzer treats as external entry points. In production these values are always the hardcoded `DEFAULT_*` constants, so the flagged paths are unreachable, but the fix also hardens the real request sites. Route every upstream URL through `parse_install_upstream_url`, which - parses the URL, - requires the scheme to be `http` or `https`, and - requires a host. Build request endpoints via `install_upstream_endpoint(base, &[segments])` so each segment is percent-encoded by `url`; a caller cannot inject extra path components, host overrides, or scheme changes via a path segment. GitHub's manifest `code` (from the browser callback) is also checked against the short base64url character set it uses. Closes code-scanning alerts #28 and #29. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| crates | ||
| packages/fabro-api-client | ||