Skip to content
Info disclosure Advisory Advanced CVE-2026-17895

Inappropriate implementation in DataTransfer (CVE-2026-17895)

On Linux and ChromeOS, a middle-click paste into a page's editable region delivered the global CLIPBOARD image bytes to page JavaScript instead of the PRIMARY selection image. A page with a paste handler could therefore read an image the user had copied elsewhere, without any clipboard-read permission prompt.

[email protected] Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 43 days

Steps to reproduce the problem

PRECONDITIONS (all default config, no flags):

  • A web page with a focused contenteditable/textarea and a "paste" event listener.
  • The global CLIPBOARD (kStandard, Ctrl-C buffer) holds a victim PNG the user previously copied (e.g. a screenshot, or an image copied from another origin/app).
  • The PRIMARY selection (kSelection, middle-click buffer) advertises an image/png target (e.g. the user selected an image in an app that exports image/png to PRIMARY).

MANUAL STEPS:

  1. On a Linux desktop, copy an image to the CLIPBOARD with Ctrl-C (the "secret").
  2. In another app, select a DIFFERENT image so the PRIMARY selection advertises image/png.
  3. In Chrome, open a page whose editable region has this paste handler: editor.addEventListener('paste', async (e) => { for (const it of e.clipboardData.items) { if (it.kind === 'file' && it.type === 'image/png') { const f = it.getAsFile(); const buf = await f.arrayBuffer(); // bytes of the CLIPBOARD image, NOT PRIMARY exfiltrate(buf); } } });
  4. MIDDLE-CLICK into the editable region to perform a PRIMARY-selection paste.
  5. getAsFile() returns a File whose bytes are the CLIPBOARD (Ctrl-C) image — the image the user never authorized this page to read. The user only performed a PRIMARY paste.

DETERMINISTIC REPRODUCTION (containerized, no physical display): Reproduced on Chromium 149.0.7827.114, Debian 12 arm64 container, Xvfb virtual X server.

  1. Seed buffers with distinct solid-color PNGs via xclip: xclip -selection clipboard -t image/png -i victim_red.png # kStandard xclip -selection primary -t image/png -i decoy_green.png # kSelection
  2. Launch Chromium with --ozone-platform=x11 (NOT --headless; headless uses an in-memory clipboard stub and will not exercise the real PRIMARY path).
  3. Load a page with the paste handler above, focus the editor, and issue a real X11 middle-click (xdotool click 2).
  4. Compare the SHA-256 of the returned File against the two seeded images.

OBSERVED RESULT (2 of 2 runs, deterministic): getAsFile() -> image.png, image/png, 80 bytes SHA-256 = 42cb5164... == victim_red (the CLIPBOARD image) (decoy_green PRIMARY image SHA-256 = b4966ee9... was NOT returned) => the page received the CLIPBOARD image during a PRIMARY-selection paste.

NOTE: kPasteGlobalSelection is SupportedFromMenuOrKeyBinding only; it is NOT reachable via execCommand('paste'). A genuine middle-click user gesture is required.

Problem Description

On Linux/ChromeOS, Chrome exposes two OS clipboard buffers: the global CLIPBOARD (kStandard, the Ctrl-C/Ctrl-V buffer) and the PRIMARY selection (kSelection, the middle-click buffer). These are distinct trust surfaces: a middle-click PRIMARY paste must deliver only what is on PRIMARY and must not surrender the global CLIPBOARD.

SystemClipboard tracks the active buffer in buffer_. The editor-paste read helpers (ReadPlainText/ReadHTML/ReadRTF) all follow buffer_. During a middle-click paste, ClipboardCommands::ExecutePasteGlobalSelection calls SetSelectionMode(true) (sets buffer_ = kSelection), runs Paste(), then restores the buffer. Critically, Paste() dispatches the JS "paste" event SYNCHRONOUSLY, while buffer_ is still kSelection.

The defect: DataObjectItem::GetAsFile() — reached from page JS as clipboardData.items[i].getAsFile() inside the paste handler — reads the clipboard PNG with a HARDCODED mojom::blink::ClipboardBuffer::kStandard, ignoring buffer_. So during a PRIMARY-selection middle-click paste, getAsFile() returns a File containing the CLIPBOARD (kStandard) image bytes — an image the user copied from another origin or another application — even though the user performed only a PRIMARY paste and never authorized disclosure of the CLIPBOARD.

The preceding sequence-number guard does NOT prevent this: SequenceNumber() also follows buffer_, so it compares the kSelection sequence (which matches) and then reads kStandard regardless. The guard never consults which buffer the bytes come from.

This is the exact defect class fixed for the MARKUP paste path in the commit titled "Fix middle-click paste leaking kStandard image cross-buffer" (bug 497251066), which added a buffer-following no-arg ReadImageAsImageMarkup() overload. That fix did NOT touch the JS-facing GetAsFile() path, which embeds the identical hardcoded-kStandard defect and remains unfixed at tip. The sibling method in the same file, GetAsString(), correctly follows buffer_ via the no-arg ReadPlainText/ReadHTML/ReadRTF overloads — only the PNG/file path hardcodes a buffer. That asymmetry is the bug.

IMPACT: Cross-clipboard-buffer information disclosure to page JavaScript, in default configuration, from an ordinary "paste" event handler with NO clipboard-read permission prompt — sidestepping the async Clipboard API (navigator.clipboard.read) permission gate for the kStandard image. The page obtains raw PNG bytes the user copied elsewhere (screenshots, photos, images from other origins/apps). Gated by a real user middle-click and by PRIMARY advertising image/png while a different image sits on CLIPBOARD.

SUGGESTED FIX: Route the PNG read through the active buffer. Add a no-arg SystemClipboard::ReadPng() returning ReadPng(buffer_) (mirroring ReadPlainText() and the seed CL's ReadImageAsImageMarkup()), and call it from GetAsFile(); keep the explicit ReadPng(buffer) overload for legitimate async Clipboard API callers. Gate behind the existing ClipboardPasteImageRespectBuffer feature so both the markup and getAsFile() paths follow buffer_.

Summary

Middle-click paste discloses global clipboard image to web page on Linux/ChromeOS

Additional Data

Category: Security
Chrome Channel: Stable
Regression: N/A \

The original report as published on the Chromium issue tracker, by [email protected]. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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 file-returning clipboard helper used by page JavaScript hardcodes the standard clipboard buffer instead of following the buffer currently being pasted from, unlike the text and markup helpers.

Impact

A page could read raw PNG bytes of an image the user copied from another origin or application, bypassing the clipboard-read permission prompt, though it requires a real middle-click and PRIMARY advertising image/png while a different image sits on CLIPBOARD.

What the attacker needed

Linux or ChromeOS desktop; image copied to CLIPBOARD via Ctrl-C; PRIMARY advertises image/png; victim middle-clicks the page

The fix

The PNG read should be routed through the active buffer via a no-arg read helper called from GetAsFile(), gated behind the existing feature flag; the text does not say it was fixed.

How it was found

  1. Copy an image to the CLIPBOARD buffer with Ctrl-C on a Linux desktop.
  2. Select a different image in another app so the PRIMARY selection advertises image/png.
  3. Open a Chrome page whose editable region has a paste handler that reads image files from the paste event.
  4. Middle-click into the editable region to perform a PRIMARY-selection paste.
  5. Observe that the returned file's bytes match the CLIPBOARD image, not the PRIMARY image.

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.

Linux desktops keep two separate clipboards: one filled by Ctrl-C and one filled by selecting text or images with the mouse, which is pasted with a middle-click. Chrome is supposed to hand a web page only the buffer the user actually pasted from. Here, a middle-click paste gave the page the Ctrl-C image instead, so a site could grab a screenshot or picture the user had copied from somewhere else.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.