fix(orb): validate ORB_BROKER_URL to prevent enrollment-secret leakage#1401
Open
JSONbored wants to merge 1 commit into
Open
fix(orb): validate ORB_BROKER_URL to prevent enrollment-secret leakage#1401JSONbored wants to merge 1 commit into
JSONbored wants to merge 1 commit into
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1401 +/- ##
=======================================
Coverage 95.33% 95.34%
=======================================
Files 192 192
Lines 20750 20763 +13
Branches 7500 7504 +4
=======================================
+ Hits 19783 19796 +13
Misses 383 383
Partials 584 584
🚀 New features to boost your workflow:
|
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.
Motivation
ORB_BROKER_URLwith an unsafe destination.https:except for explicit localhost development hosts.Description
orbBrokerBaseUrl()which parsesORB_BROKER_URL, rejects invalid URLs, userinfo, query/fragment, and disallows plaintexthttp:except forlocalhost,127.0.0.1, and[::1]development hosts.orbBrokerBaseUrl()infetchBrokeredInstallationTokenandregisterOrbRelayTargetso the enrollment secret is never sent to an unvalidated origin.test/unit/orb-broker-client.test.tscovering unsafe URL errors (invalid URL, userinfo, query/fragment, non-HTTPS), localhost HTTP allowance, and relay-registration fail-closed behavior.[::1]).Testing
npx vitest run test/unit/orb-broker-client.test.ts test/unit/github-app.test.tsand observed both test files pass (39 tests passed).npm run typecheckandgit diff --check, both of which succeeded locally and showed no type or diff issues.npm run test:coverage) which started but failed during coverage remapping due to an upstream dependency mismatch (TypeError: jsTokens is not a function) unrelated to the PR logic;vitestunit runs themselves passed.npm audit/npm ciwhich hit registry access errors in this environment (403), so dependency-audit and full CI audit steps could not complete here.Codex Task