forked from kernel/kernel-images
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add proxy extension #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kryptocodes
wants to merge
3
commits into
main
Choose a base branch
from
feat/proxy-configuration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore: remove proxy config polling
Signed-off-by: kryptocodes <srivatsantb@gmail.com>
- Loading branch information
commit 3e0954f87e854503f25e7d9808b4681d08d5c3ee
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Chrome extension webRequest onAuthRequired details.isProxy challenger property API documentation💡 Result:
In
chrome.webRequest.onAuthRequired, the eventdetailsobject includes:details.challenger: an object describing the server (or proxy) that is requesting authentication:challenger.host(string): hostnamechallenger.port(integer): port (developer.mozilla.org)details.isProxy(boolean): indicates whether the auth challenge is coming from a proxy:true= proxy auth (Proxy-Authenticate, typically HTTP 407)false= origin/server auth (WWW-Authenticate, typically HTTP 401) (developer.mozilla.org)Notes:
onAuthRequiredis only fired for HTTP and HTTPS/TLS proxies that require authentication (not SOCKS proxies). (developer.mozilla.org)webRequestAuthProviderpermission to useonAuthRequired. (developer.chrome.com)Citations:
🏁 Script executed:
Repository: reclaimprotocol/popcorn-images
Length of output: 56
🏁 Script executed:
Repository: reclaimprotocol/popcorn-images
Length of output: 575
🏁 Script executed:
rg "proxyConfig\s*=" brightdata-proxy-extension/background.js -B 3 -A 3Repository: reclaimprotocol/popcorn-images
Length of output: 367
🏁 Script executed:
Repository: reclaimprotocol/popcorn-images
Length of output: 615
🏁 Script executed:
Repository: reclaimprotocol/popcorn-images
Length of output: 227
🏁 Script executed:
Repository: reclaimprotocol/popcorn-images
Length of output: 646
Restrict auth handling to proxy challenges to prevent credential leakage.
onAuthRequiredfires for both HTTP proxy auth challenges (HTTP 407,isProxy=true) and origin/server auth challenges (HTTP 401,isProxy=false). Without a guard ondetails.isProxy, proxy credentials are leaked to any website that requests authentication. Add a check fordetails.isProxy === truebefore responding with credentials, and optionally validate the challenger host matches the proxy host.🔒 Suggested hardening
chrome.webRequest.onAuthRequired.addListener( (details, callbackFn) => { + if (!details.isProxy) { + callbackFn({ cancel: false }); + return; + } + if (proxyConfig?.host && details.challenger?.host && details.challenger.host !== proxyConfig.host) { + callbackFn({ cancel: false }); + return; + } if (proxyConfig && proxyConfig.username && proxyConfig.password) { console.log("Auth required, providing credentials"); callbackFn({ authCredentials: { username: proxyConfig.username, password: proxyConfig.password } }); } else { console.log("Auth required but no credentials available"); callbackFn({ cancel: false }); } }, { urls: ["<all_urls>"] }, ["asyncBlocking"] );🤖 Prompt for AI Agents