Security & Threats

Clipboard Hijacking: When Copy-Paste Becomes an Attack Surface

June 21, 2026 8 min read Haven Team

The clipboard is one of the most trusted parts of a computer and one of the least examined. You copy something, you paste it, and you assume the two are identical. A whole category of malware lives in the gap between those two actions, quietly substituting what you copied for something the attacker wants you to paste instead.


Copy-paste is muscle memory. You copy a payment address, a password, a command, a URL, and you trust that what lands is what you took. That trust is the entire vulnerability. The clipboard is a shared system buffer that, on most platforms, any running program or in some cases any open web page can read or write. When you treat the contents as verified simply because you copied them yourself, you hand attackers a clean substitution point.

Clipper Malware: The Silent Swap

The most common form is called a clipper. It is a piece of malware whose only job is to watch the clipboard and rewrite specific kinds of content. The textbook target is cryptocurrency addresses, because they are long, random-looking strings that no human verifies character by character, and because payments to them are irreversible.

The mechanics are simple and that is what makes them effective. The malware runs quietly in the background and monitors the clipboard for content matching a pattern, such as the format of a wallet address. When it sees a match, it overwrites the clipboard with an address the attacker controls. You copied your friend's address. You paste it. The field fills with a plausible-looking string of the right length and format. Unless you compare it character by character against the source, you send your money to a stranger.

Why this evades notice

The substituted value looks structurally correct. It is the right length, the right character set, the right prefix. Human pattern-matching registers "long random string, looks like an address" and moves on. The attack survives precisely because the output passes a glance.

Some clippers go further and keep a list of attacker addresses, choosing one that even shares the first and last few characters with common targets, since those are the parts people are most likely to spot-check. The defense of "I always check the first four and last four" is one the better clippers are explicitly built to defeat.

Pastejacking: The Website That Edits Your Copy

Clipboard hijacking does not always need malware on your machine. A website can do a constrained version of it directly in the browser, an attack known as pastejacking.

The browser exposes a copy event to JavaScript. A page can listen for when you copy text and replace what goes onto the clipboard with something else. The classic demonstration is a tutorial site that shows an innocent-looking command. You highlight it, copy it, and paste into your terminal. What actually lands is a different, longer command, sometimes with a trailing newline so it executes the instant it is pasted, before you can read it.

The lesson security professionals took from pastejacking is blunt: never paste anything copied from a web page directly into a terminal. Paste into a plain text editor first, look at what actually arrived, then move it. The gap between what is displayed and what is copied is exactly where the attack lives.

The Mobile Dimension: Apps Reading in the Background

On phones, the clipboard problem has a second face. For years, mobile apps could silently read clipboard contents whenever they were open, with no notice to the user. Researchers and platform changes brought this into the light. When mobile operating systems added a visible notification each time an app read the clipboard, a striking number of popular apps turned out to be reading it constantly, often with no legitimate reason.

This matters because of what people keep on their clipboards. If you copy a password out of a password manager, a two-factor code, a recovery phrase, or a private message, any app that reads the clipboard while that value sits there can capture it. The clipboard becomes a quiet broadcast channel for your most sensitive short-lived secrets.

Attack variant Needs malware? Primary target
Clipper Yes, on the device Payment addresses, anything pasted unverified
Pastejacking No, runs in the browser Commands pasted into terminals or fields
Background reads No, ordinary app permissions Passwords, codes, anything you copied

How to Defend Your Clipboard

The defenses are practical and mostly about removing the assumptions the attacks rely on.

The Bigger Picture

Clipboard hijacking is a good reminder that security is not only about the strength of your encryption or the length of your passwords. It is about the integrity of every step in a workflow, including the boring ones. You can use a perfectly secure wallet and a perfectly strong password and still lose both if the channel between copying and pasting is compromised.

This is the same reasoning behind verifying a contact's identity out of band before trusting an encrypted channel, the principle behind trust-on-first-use verification. The cryptography can be flawless while the human step that feeds it is quietly subverted. Attackers consistently target the seam between two trusted components rather than the components themselves, because the seam is where nobody is looking.

The fix is not paranoia about every paste. It is recognizing that the clipboard is an untrusted shared space, and treating the few high-stakes pastes, payment addresses, credentials, terminal commands, with the small extra care they deserve.

Try Haven free for 15 days

Encrypted email and chat in one app. No credit card required.

Get Started →