fix: close unauthenticated Pub/Sub event injection (CVSS 9.8)#64
Open
yuvalk wants to merge 5 commits intoRHEcosystemAppEng:mainfrom
Open
fix: close unauthenticated Pub/Sub event injection (CVSS 9.8)#64yuvalk wants to merge 5 commits intoRHEcosystemAppEng:mainfrom
yuvalk wants to merge 5 commits intoRHEcosystemAppEng:mainfrom
Conversation
PUBLIC_PREFIXES allowed any /marketplace/* path to skip authentication. This was overly permissive — only /marketplace/pubsub needs to be public (it has its own Google OIDC verification). The specific path was already in PUBLIC_PATHS, making the prefix redundant and dangerous. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The hybrid /dcr endpoint accepted both DCR and Pub/Sub requests without verifying Pub/Sub message authenticity, enabling forged marketplace events. Split into /dcr (DCR only) and /pubsub (Google OIDC-verified). - /dcr now rejects requests without software_statement (400) - /pubsub verifies Google OIDC tokens via google.oauth2.id_token before processing any event, rejecting unauthenticated requests (401) - Audience verification is configurable via PUBSUB_AUDIENCE setting Closes the unauthenticated marketplace event injection vulnerability (CVSS 9.8) that allowed a full authentication bypass chain. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add pubsub_audience config for OIDC audience verification on Pub/Sub tokens. Warn at startup if unset in Cloud Run (K_SERVICE present) since tokens without audience binding could be reused across services. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- 13 new tests in test_pubsub_auth.py covering OIDC verification, endpoint separation, and middleware hardening - Update existing Pub/Sub tests in test_dcr.py to use /pubsub endpoint with mocked Google OIDC token verification Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
suppressing since this is an external function that cannot be modified Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
|
The PR is missing the new configuration on the pubsub topic to send request to the pubsub endpoint instead of dcr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/dcrendpoint into/dcr(DCR only) and/pubsub(Pub/Sub with Google OIDC verification), preventing forged marketplace events/marketplace/*auth bypass (PUBLIC_PREFIXES) from middleware — only/marketplace/pubsubremains public (has its own OIDC auth)PUBSUB_AUDIENCEsetting for OIDC audience verification, with a production warning when unset in Cloud RunVulnerability
A researcher identified a CVSS 9.8 attack chain: forge Pub/Sub events → create fake entitlements → register OAuth clients → bypass authentication entirely. See
report.txtfor full details.How it's fixed
/dcr/dcrrejects Pub/Sub payloads (400);/pubsubrequires Google-signed OIDC token/marketplace/*bypass removed; DCR requires validsoftware_statementJWTTest plan
test_pubsub_auth.pypass/pubsubwith mocked OIDC🤖 Generated with Claude Code