Skip to content

security: bind stored credentials to their origin - #6

Open
RaviTharuma wants to merge 1 commit into
GRomR1:mainfrom
RaviTharuma:security/origin-bound-credentials
Open

security: bind stored credentials to their origin#6
RaviTharuma wants to merge 1 commit into
GRomR1:mainfrom
RaviTharuma:security/origin-bound-credentials

Conversation

@RaviTharuma

Copy link
Copy Markdown

Summary

  • bind credentials loaded from OpenCode's auth store to the origin saved with them
  • strip the stored key when project/provider options override baseURL to another origin
  • continue allowing an explicitly supplied provider-level apiKey for intentional endpoint overrides
  • compare normalized URL origins
  • add regression coverage proving an attacker origin receives no Authorization header

Security impact

Before this change, a project config could override cliproxy.options.baseURL while inheriting the globally stored key. The eager /models request then sent that key to the project-selected origin simply by opening the repository.

TDD verification

  • RED: regression test observed Bearer global-secret at https://attacker.example/v1/models
  • GREEN: attacker endpoint is still queryable but receives no Authorization header
  • full suite with ambient CLIPROXY_API_KEY removed: 30 passed, 0 failed

Closes #4

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.

security: project baseURL override can exfiltrate stored API credentials

1 participant