New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 333094 link

Starred by 2 users

Issue metadata

Status: Fixed
Last visit 29 days ago
Closed: Mar 2014
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug-Security

Sign in to add a comment

Security: Flash allows clipboard theft / manipulation for duration of session after receiving a single paste event

Reported by, Jan 10 2014

Issue description


Not sure if this is the correct place to report this, but this affects Flash as shipped with Chrome the most, due to Flash's event handlers not stalling the rest of the browser.

Flash allows you to manipulate (inside click events) as well as read (inside paste events) the clipboard. Flash attempts to curb abuse by ensuring that the event handler was triggered by user action, however an attacker may extend the duration of the event by blocking in the handler.

Additionally, Flash event handlers continue to execute even after the tab has closed. Since you may call `.getData()` and `.setData()` on `generalClipboard` as many times as you want so long as you're in an user-initiated event handler, convincing users to paste something onto your page allows you to steal and selectively manipulate their clipboard for the duration of the session.

Click event handlers are much easier get users to trigger (using a single-pixel flash object that follows the mouse until it receives a click,) but only allow write access to the clipboard.

The only real caveat is that Chrome will ask the user if they want to kill Flash after a few seconds when the user browses to another page with flash embedded.

Chrome Version: 33.0.1750.18 dev
Operating System: Ubuntu 13.04
Flash Version: Shockwave Flash 12.0 r0 (


`simple_jack.mxml` and `simple_jack.swf` in the attached archive are trivial examples of the issue and alert the current clipboard contents for up to 60 seconds after a paste event. 'Something else' is also appended to the clipboard whenever it's changed.

The files in `persist_jack` demonstrate how an attacker may actually use this exploit. Event bubbling is used to bypass the 60-second time limit for event handlers and the effect persists for up to 2 hours, across tab closes. 

While the tab is open, we exfiltrate clipboard contents by passing them to JavaScript via ``. When the tab is closed and we can no longer call JavaScript, we abuse the fact that `Socket.write*()` is synchronous and write to a previously opened socket.

We also modify the clipboard as soon as it's changed. We just append "AAAAAAAAH" to it, but we could selectively rewrite things that look like commands and whatnot.

As a side note, doing a context-menu paste under Linux will cause a segfault with this demo, but I don't think it's exploitable.
99 KB Download
There's really 3 issues at play here:

1) Access to `Clipboard.generalClipboard.getData()` is unrestricted inside a `paste` event handler. I think mimicking Chrome's behaviour in the JS Clipboard API would make sense. If the clipboard contents have changed since the `paste` event was raised, `getData()` should return null / undefined.

2) Access to `Clipboard.generalClipboard.setData()` is unrestricted inside a number of event handlers. This is basically a revival of `` with interaction. I'm not sure of a restriction that would make sense here without breaking content.

3?) ActionScript can execute long after the embedding page has gone away by triggering nested event handlers. In practice this seems to be limited to 2 hours since event handlers are killed after blocking for 60 seconds, and I could only nest handlers to a depth of 140.

Comment 2 by, Jan 10 2014

For #1, it seems like Flash should be using the clipboard sequence number.

Comment 3 by, Jan 10 2014

Labels: Cr-Internals-Plugins-Flash Security_Severity-Low OS-Windows
Status: Available

Comment 4 by, Jan 10 2014

Labels: OS-Linux OS-MAC Pri-2 Security_Impact-Stable Security_Impact-Beta
Assuming this does impact Beta and Stable (I didn't try).

Comment 5 by, Jan 10 2014

Labels: yzshen
Thanks for the detailed report. 1) makes sense. Can you explain 2) in more detail? Is this a bug or expected behavior.

3) sounds like a separate bug that should also be addressed.

Comment 6 by, Jan 10 2014

Labels: -yzshen
> Assuming this does impact Beta and Stable (I didn't try).

I tested Stable on Linux and Windows, both are affected.

> Can you explain 2) in more detail? Is this a bug or expected behavior.

It's expected behavior, but it should probably be restricted further; I'm just not sure how. Flash allows you to set the contents of the clipboard inside a click event handler, but we can block in the click event for as long as we want without freezing the rest of the page. Combined with point 3, we're able to continually clobber the clipboard until the plugin is killed just by having someone click our page. Like but malicious. 

The "user-initiated event" precaution doesn't work very well when blocking inside the handlers isn't penalized by the page freezing or a hung script message appearing (as would normally happen when blocking inside JS event handlers.)

By continually placing "echo 'hey there!'\n" in the clipboard, I accidentally got command execution on myself a few times when copying and pasting commands between two terminals. Attached is an example of how `setData()` in a `click` event handler may be abused.

This'd probably affect any other function that checks for user-initiated events ( ,) but most of those are just annoyances like opening modal dialogs.
43.4 KB Download

Comment 8 by, Jan 13 2014

(I'm not sure who else from the Adobe side to notify on this...cpu maybe you know).

Anthony could you look in to this? We can provide a sequence number exposed from pepper but it would be good if someone could fix issues 1) and 3) on the flash side.

Comment 9 by, Jan 13 2014

I'm no longer on the flapper project. Please contact Jeromie or Bob, thanks!

Comment 11 by, Jan 13 2014

Labels: Cr-Security-UX

Comment 12 by, Jan 13 2014

Thanks for the notification.  This is Adobe 3692913.  We'll get it assigned and investigated ASAP.
jeclark: I've posted to expose a clipboard sequence number in pepper.
Project Member

Comment 15 by, Jan 28 2014

r247383 | | 2014-01-28T01:45:33.967441Z

Changed paths:

Add GetSequenceNumber function to PPB_Flash_Clipboard

This provides access to a sequence number which identifies the clipboard state.

BUG= 333094 

Review URL:

Comment 16 by, Jan 29 2014

Is this fixed or does it need further work?
This still needs work by Adobe on the flash side to address the issues mentioned. I've landed a GetSequenceNumber function for the clipboard state so that the plugin can detect when the state changes.

jeclark is there any update on this? Thanks!

Comment 18 by, Feb 5 2014

Status: Assigned
jeclark@ - ping?

Comment 19 by, Feb 5 2014

Sorry, I wrote a response on Friday and left it sitting in an open tab.

The developer working the issue has a local fix.  He's out for a couple days, but his status as of Friday was that he expects to have it checked in and confirmed towards the end of the week.

Comment 20 by, Feb 8 2014

Xing committed a fix today, we're still verifying.  CLs are 1243958 in Mainline and 1243959 in King.
Labels: -OS-Windows -OS-Linux -OS-MAC OS-All
Did the fix for this ship?

Comment 22 by, Mar 12 2014

Yes, it should be in
Status: Fixed
Project Member

Comment 24 by ClusterFuzz, Mar 12 2014

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify
Project Member

Comment 25 by ClusterFuzz, Jun 18 2014

Labels: -Restrict-View-SecurityNotify
Bulk update: removing view restriction from closed bugs.
Project Member

Comment 26 by ClusterFuzz, Feb 2 2016

Labels: -Security_Impact-Beta
Project Member

Comment 27 by, Oct 1 2016

This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit - Your friendly Sheriffbot
Project Member

Comment 28 by, Oct 2 2016

This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit - Your friendly Sheriffbot
Labels: allpublic
Components: -Security>UX
Labels: Team-Security-UX
Security>UX component is deprecated in favor of the Team-Security-UX label

Sign in to add a comment