Missing authorization in PDF (CVE-2026-121031)
A logic flaw in the executeScript API for webview and controlledframe allows a malicious app to inject scripts into the privileged PDF extension frame, bypassing extension isolation. An attacker could then execute arbitrary code in the PDF extension's main world, gaining access to powerful chrome.* APIs.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 7 months
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: A logic flaw in programmatic script injection allows a malicious Chrome App or Isolated Web App to execute arbitrary scripts within the highly privileged PDF extension frame using <webview>.executeScript({allFrames: true}). By injecting a blob URL script, the attacker escapes the isolated world and executes code in the extension's main world, gaining access to powerful chrome.* APIs.
Affected files:
extensions/renderer/programmatic_script_injector.ccextensions/browser/script_executor.ccextensions/browser/url_request_util.cc
Estimated timestamp from git blame: 2024-04-12
Description
A potential security vulnerability exists in the implementation of the executeScript API for <webview> (Platform Apps) and <controlledframe> (Isolated Web Apps). When the allFrames: true option is used on a guest page embedding a PDF, programmatic script injection can reach the Out-of-Process IFrame (OOPIF) PDF extension frame (chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.html), which runs in a highly privileged kPrivilegedExtension context.
This vulnerability is caused by two logic failures that allow the injection to bypass standard extension isolation:
-
Browser-side Enumeration Failure (
extensions/browser/script_executor.cc): TheMaybeAddSubFramefunction attempts to skip children of the PDF extension frame to prevent scripting the inner PDF content. However, it only checks if a frame's parent's origin is the PDF extension ID. Since the PDF extension frame itself is a subframe of the embedding guest page, its parent is the guest origin, not the extension. Consequently, the extension frame is not skipped and is targeted for script injection. -
Renderer-side Check Bypass (
extensions/renderer/programmatic_script_injector.cc): InCanExecuteOnFrame, the renderer returnskAllowedfor any subframe whenis_web_viewis true. This early return occurs before callingExtensionInjectionHost::CanExecuteOnFrame, which contains the strict cross-extension scripting block (inextension_injection_host.cc) that would normally prevent one extension or app from scripting another.
Once injected into the PDF extension's isolated world, an attacker can escalate to the main world. The PDF extension's manifest (chrome/browser/resources/pdf/manifest.json) permits blob: URLs in its script-src Content Security Policy. An attacker can create a blob: URL containing a malicious payload and append it as a <script> tag to the DOM. Because blob URLs inherit the origin of the document that created them, the payload executes in the main world with the PDF extension's full privileges.
Impact
Successful exploitation provides full access to the PDF extension's privileged chrome.* APIs, including:
chrome.contentSettings: Can be used to silently modify camera, microphone, and location settings for any origin profile-wide.chrome.tabs: Can enumerate all open tabs and their URLs.chrome.fileSystem: Allows writing to the file system.chrome.metricsPrivate,chrome.pdfViewerPrivate, andchrome.resourcesPrivate.
Potential Steps to Reproduce
(Note: These are potential steps as our tooling does not yet have the ability to run code.)
- Create a Platform App with the
webviewpermission (or an Isolated Web App withcontrolledframe). - In the app, create a
<webview>and set itssrcto a PDF URL, or embed a PDF within a guest page:<embed src='https://target.origin/test.pdf' type='application/pdf'>. - Wait for the PDF to load, which creates the extension frame as a subframe in the guest's frame tree.
- Call
webview.executeScript({code: PAYLOAD, allFrames: true}). - The
PAYLOADshould create aBlobcontaining malicious code (e.g., usingchrome.contentSettings) and inject it into the DOM via a<script>tag. Example payload:JavaScript const b = new Blob(['chrome.contentSettings.camera.set({primaryPattern:"https://evil.example/*",setting:"allow"})'], {type: 'text/javascript'}); const s = document.createElement('script'); s.src = URL.createObjectURL(b); document.head.appendChild(s); - Verify that the profile-wide content settings have been modified as intended.
Suggested Fix
- In
extensions/browser/script_executor.cc(MaybeAddSubFrame): The logic should be updated to check the frame's own origin in addition to the parent's origin to properly exclude the PDF extension frame from script execution targets. - In
extensions/renderer/programmatic_script_injector.cc(CanExecuteOnFrame): The check for!frame->IsOutermostMainFrame()whenis_web_viewis true is too permissive. It should explicitly forbid injection into privileged extension schemes (chrome-extension://), or ensure that the strict cross-extension scripting checks inExtensionInjectionHost::CanExecuteOnFrameare not bypassed for extension subframes within a guest view.
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 two logic errors: the browser-side frame enumeration only checks the parent's origin, so it fails to skip the PDF extension frame, and the renderer-side check allows injection into any subframe when is_web_view is true, bypassing the cross-extension scripting block.
Impact
Successful exploitation could provide full access to the PDF extension's privileged chrome.* APIs, allowing silent modification of camera, microphone, and location settings, enumeration of tabs, and file system writes.
What the attacker needed
Malicious Chrome App or Isolated Web App; webview or controlledframe permission; victim loads a PDF in the app
The fix
The fix should update the browser-side frame enumeration to check the frame's own origin and explicitly forbid injection into privileged extension schemes in the renderer-side check.
How it was found
- Create a Platform App with the webview permission (or an Isolated Web App with controlledframe).
- In the app, create a <webview> and set its src to a PDF URL, or embed a PDF within a guest page.
- Wait for the PDF to load, which creates the extension frame as a subframe in the guest's frame tree.
- Call webview.executeScript({code: PAYLOAD, allFrames: true}).
- The PAYLOAD should create a Blob containing malicious code and inject it into the DOM via a <script> tag.
- Verify that the profile-wide content settings have been modified as intended.
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.
A Chrome App can ask a webview to run a script in all frames, including a hidden PDF viewer frame that has special permissions. Because of a mistake in how frames are checked, the script can run inside that privileged frame and then use a trick with blob URLs to run code with full extension powers, letting it change browser settings or read files.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.