Skip to content

fix: secure Copilot API endpoint transport - #11129

Merged
DOsinga merged 1 commit into
mainfrom
jbg/security-copilot-api-https
Aug 11, 2026
Merged

fix: secure Copilot API endpoint transport#11129
DOsinga merged 1 commit into
mainfrom
jbg/security-copilot-api-https

Conversation

@jbg

@jbg jbg commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • reject malformed and remote plaintext Copilot API endpoints from fresh token responses, memory, and legacy disk cache
  • permit only exact loopback HTTP as a compatibility exception, with proxies disabled and redirects confined to HTTPS or loopback
  • route both inference and model discovery through the same authenticated transport policy

Security impact

The Copilot token service controls the inference endpoint that receives the live Copilot bearer plus prompts, tool results, and images. Goose previously cached and used remote http:// endpoints without validation, allowing a misconfigured or compromised service plus an on-path observer to expose credentials and model traffic. This change enforces HTTPS across the initial request and redirects, while keeping a transport-confined loopback exception.

Closes project-loupe/audit-goose#726 after post-merge verification.

Verification

  • cargo fmt --all -- --check
  • cargo test -p goose --lib githubcopilot (18 passed)
  • cargo test -p goose-providers api_client (11 passed)
  • cargo build -p goose
  • cargo clippy -p goose -p goose-providers --all-targets -- -D warnings
  • git diff --check

Coverage includes endpoint policy, fresh responses, unexpired legacy cache, loopback model listing, HTTPS-only enforcement, environment-proxy bypass, and 307/308 redirect confinement.

This finding was discovered by Project Loupe.

@DOsinga DOsinga left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This applies the endpoint transport policy consistently to fresh token responses, cached state, inference, and model discovery. The loopback compatibility path disables proxies and confines redirects, while remote endpoints require HTTPS. The added tests cover the important cache, proxy, redirect, and model-listing cases. CI is green.

LGTM.

@DOsinga
DOsinga added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit db7a704 Aug 11, 2026
25 checks passed
@DOsinga
DOsinga deleted the jbg/security-copilot-api-https branch August 11, 2026 14:13
michaelneale added a commit that referenced this pull request Aug 11, 2026
* origin/main:
  chore(release): bump version to 1.46.0 (minor) (#10920)
  fix: secure Copilot API endpoint transport (#11129)
  fix(providers): map kimi_code provider name and pass correct provider to create_request (#11130)
  fix(cli): honor provider overrides on session resume (#10810)
  fix: enforce review check tool policy (#11128)
  chore(deps-dev): bump vite from 7.3.1 to 8.2.1 in /ui (#10977)
  chore(deps): bump jsonschema from 0.46.10 to 0.49.4 (#10857)
  chore(deps): bump sigstore-verify from 0.10.0 to 0.11.0 (#10856)
  chore(deps): bump lopdf from 0.42.0 to 0.44.0 (#10854)
  chore(deps): bump ctor from 0.2.9 to 0.6.3 (#10852)
  chore(deps-dev): bump @types/node from 20.19.37 to 26.1.2 in /ui (#10979)
  chore(deps-dev): bump @electron/fuses from 1.8.0 to 2.1.3 in /ui (#10978)
  chore(deps-dev): bump electron from 41.10.3 to 43.3.0 in /ui (#10974)
  fix(permissions): match extension owners exactly (#10455)
  fix: normalize critical command patterns (#10989)
  fix: keep LiteLLM default local (#10996)
  fix: encode GCP Vertex URL path segments (#10998)
  fix: make Open Plugins installs transactional (#10999)

# Conflicts:
#	Cargo.lock
#	ui/desktop/package.json
#	ui/pnpm-lock.yaml
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