Observable discrepancy in Extensions (CVE-2026-130942)
An extension with only declarativeNetRequest and declarativeNetRequestFeedback permissions, but no host permissions, can extract sensitive response headers cross-origin. It does this by creating ALLOW rules with responseHeaders conditions using wildcards and using getMatchedRules as an oracle to infer the header value byte-by-byte.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 8 months
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: An extension with declarativeNetRequest and declarativeNetRequestFeedback permissions, but no host permissions, can extract sensitive response headers (like Set-Cookie) cross-origin. It achieves this by creating ALLOW rules with responseHeaders conditions using wildcards, and using getMatchedRules as an oracle to infer the header value byte-by-byte.
Affected files:
extensions/browser/api/declarative_net_request/request_params.ccextensions/browser/api/declarative_net_request/composite_matcher.ccextensions/browser/api/declarative_net_request/action_tracker.ccextensions/browser/api/declarative_net_request/declarative_net_request_api.ccextensions/browser/api/declarative_net_request/rules_monitor_service.ccextensions/browser/api/declarative_net_request/ruleset_manager.ccextensions/browser/api/web_request/extension_web_request_event_router.ccextensions/browser/api/web_request/web_request_info.ccextensions/browser/api/declarative_net_request/indexed_rule.cc
Estimated timestamp from git blame: 2024-05-22
Summary
A potential vulnerability in the declarativeNetRequest (DNR) API allows an extension with only the declarativeNetRequest and declarativeNetRequestFeedback permissions to read sensitive response headers (such as Set-Cookie, Authorization, or CSRF tokens) from any website the user visits. This bypasses the Chrome extension permission model, which normally requires explicit host permissions for cross-origin data access.
Vulnerability Mechanism
The issue arises from the combination of DNR's responseHeaders matching condition and the getMatchedRules API, which together create a side-channel oracle:
- Response Header Matching: Extensions can define rules that match based on response headers. The matching logic in
extensions/browser/api/declarative_net_request/request_params.ccusesbase::MatchPattern, which supports wildcards (*for 0+ characters and?for 0-1 characters). - Forcing Cookie Visibility: By default, sensitive headers like
Set-Cookieare stripped from the response headers sent from the Network Service to the browser process. To bypass this, an attacker extension can register a dummychrome.webRequest.onHeadersReceivedlistener with the["extraHeaders"]option. This setshas_any_extra_headers_listeners_to true inWebRequestProxyingURLLoaderFactory::InProgressRequest, appendingkURLLoadOptionUseHeaderClientto the URLLoader options and exposing the raw cookies to the browser process and DNR engine. - Lack of Host Permission Check for Evaluation: Rulesets for extensions with the
declarativeNetRequestpermission are evaluated for every request regardless of host permissions.GetHostPermissionsAlwaysRequired(inrules_monitor_service.cc) returnsfalsefor this permission, causing DNR to evaluate rules withWebRequestPermissions::DO_NOT_CHECK_HOSTinruleset_manager.cc. - Host Permission Bypass for ALLOW Actions: In
CompositeMatcher::GetAction, onlyREDIRECTactions are flagged as requiring host permissions.ALLOWandBLOCKactions are returned even if the extension lacks host permissions for the request's origin. - Information Leak via getMatchedRules: When a rule matches, if the extension has the
declarativeNetRequestFeedbackpermission, the match is recorded by theActionTracker(inaction_tracker.cc). Crucially,ShouldRecordMatchedRuleonly checks for the feedback permission and does not verify if the extension has host access to the request's URL. The extension can then callchrome.declarativeNetRequest.getMatchedRules()to retrieve therule_idof the rule that matched.
Potential Exploit Scenario (The Oracle)
An extension can implement a byte-by-byte extraction oracle as follows (note: these are suggested steps, our tooling agent doesn't yet have the ability to run code):
- The extension adds session rules matching prefixes of a sensitive header:
sessionid=a*,sessionid=b*, etc., each with a uniquerule_idencoding the character. - The extension registers a dummy
webRequestlistener with["extraHeaders"]to ensure cookies are sent to the browser process. - When the user visits a target site (e.g., via a hidden iframe), the DNR engine matches the header against the rules. If the site sends
Set-Cookie: sessionid=k7f3..., the rule forsessionid=k*matches because theALLOWaction bypasses host permission withholding. - The extension calls
getMatchedRules, learns the first byte is 'k' (converted to lowercase bybase::ToLowerASCIIinHasHeaderValue), and updates its session rules to probe the next byte (sessionid=ka*,sessionid=kb*, etc.). - Through iterative updates and monitoring of subsequent requests or navigations, the extension can extract the full header value.
Suggested Fix
The vulnerability stems from the fact that getMatchedRules exposes information about requests for which the extension does not have host permissions. The fix should likely involve one or more of the following:
- Modify
ActionTracker::ShouldRecordMatchedRuleto ensure that rules are only recorded if the extension has host permissions for the request URL, similar to the checks performed forREDIRECTactions or when evaluatingkDeclarativeNetRequestWithHostAccessextensions. - Alternatively,
declarativeNetRequest.getMatchedRulescould be restricted to only return matches for URLs where the extension has host permissions at the time of the API call. - Restrict the
responseHeaderscondition itself to only evaluate on requests where the extension has host permissions.
Evaluated with Chrome root at commit: a9cbf6e8b275fe4147435aa905f3b7f5a656f5f0
Results from so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the getMatchedRules API records rule matches without checking whether the extension has host permissions for the request URL, and ALLOW actions are returned even without host permissions.
Impact
An attacker could read sensitive response headers such as Set-Cookie, Authorization, or CSRF tokens from any website the user visits, bypassing the extension permission model.
What the attacker needed
Victim installs malicious extension; extension has DNR and feedback permissions; extension lacks host permissions; victim visits target site
The fix
The fix should likely involve ensuring that getMatchedRules only records or returns matches for URLs where the extension has host permissions, or restricting the responseHeaders condition to requests with host permissions.
How it was found
- The extension adds session rules matching prefixes of a sensitive header, each with a unique rule_id encoding the character.
- The extension registers a dummy webRequest listener with extraHeaders to ensure cookies are sent to the browser process.
- When the user visits a target site, the DNR engine matches the header against the rules.
- The extension calls getMatchedRules, learns the first byte, and updates its session rules to probe the next byte.
- Through iterative updates and monitoring of subsequent requests or navigations, the extension can extract the full header value.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Browser extensions normally need explicit permission to read data from websites. This report shows that a malicious extension could bypass that requirement and read secret values like session cookies by asking the browser a series of yes/no questions about the cookie's value. The extension never directly sees the cookie, but it can guess it one character at a time.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.