Skip to content

fix(security): scope model-catalog credentials to the provider origin - #26

Merged
TheStreamCode merged 2 commits into
mainfrom
fix/discovery-auth-scope
Oct 21, 2026
Merged

TheStreamCode merged 2 commits into
mainfrom
fix/discovery-auth-scope

Conversation

@TheStreamCode

Copy link
Copy Markdown
Owner

Summary

Live model discovery sent the provider credential to any configured modelsUrl, even when the catalog lived on a different origin from the provider API. The interactive path already applied the same-origin / explicit-modelsAuth rule; discovery did not. This is finding CPB-1 from the portfolio code review.

Change

  • Extract the header rule into src/models-auth.mjs and use it from both discovery.mjs and cli.mjs, so the two paths cannot drift.
  • Add test/models-auth.test.mjs covering every modelsAuth mode and discovery coverage proving a cross-origin catalog receives no credential.
  • Prepare the 2.0.1 security release: CHANGELOG, CITATION, AGENTS protection note.

Verification

  • npm ci, npm run check (lint + 195 tests, 2 skipped), npm pack --dry-run, npm audit --omit=dev --audit-level=high (0 vulnerabilities).
  • No configuration change is required for existing providers; a provider that legitimately needs a cross-origin catalog must set modelsAuth explicitly.

Michael Gasperini added 2 commits October 21, 2026 18:45
Discovery attached the provider credential to every configured modelsUrl, including catalogs hosted on a different origin, while the interactive path already applied the same-origin or explicit-modelsAuth rule. Extract that rule into src/models-auth.mjs and use it from both paths. Add unit coverage for every modelsAuth mode and discovery coverage proving that a cross-origin catalog receives no credential.
Security patch release for the discovery credential scope. Align CITATION and the AGENTS protection note with the current single-maintainer branch protection.
@TheStreamCode
TheStreamCode merged commit 617cc17 into main Oct 21, 2026
9 checks passed
@TheStreamCode
TheStreamCode deleted the fix/discovery-auth-scope branch October 21, 2026 17:03
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.

1 participant