Author: Liz & Reborn

Editor: Sherry

Background

In the last issue of the Web3 security beginner's guide, we analyzed the Pi Xiu disk scam, and this issue will focus on clipboard security.

In many incidents of stolen cryptocurrency assets, one of the most confusing points for victims is often: 'I never transmitted my private key online, how could it be stolen?' In fact, the leakage of private keys / mnemonic phrases does not necessarily occur through cloud or network transmission; it can also happen in what seems to be 'local, secure' operations. For example, have you ever filled in your private key / mnemonic phrase by copying and pasting? Have you ever saved it in a note or screenshot? These common operations are also the vulnerabilities that hackers target.

This issue will focus on clipboard security, helping you understand its principles, attack methods, and the preventive suggestions we have summarized in practice to help users build a stronger asset protection awareness.

Why is there a risk with the clipboard?

The clipboard is a temporary storage space provided by the operating system for local applications to share, primarily used for storing temporary data (such as text, images, file paths, etc.) so that different applications can conveniently copy and paste content. For example, when you copy a wallet address, the operating system stores that address in the clipboard until it is overwritten or cleared by new content.

  • Plaintext storage: Most operating systems (such as Windows, macOS, Linux) do not encrypt clipboard data by default, but store it in plaintext in memory.

  • System API provides access methods: Most operating systems provide clipboard-related APIs that allow applications to access the clipboard. This means that if an application (such as a text editor, browser extension, input method, screenshot tool, or even malware) has the corresponding permissions, it can silently read or even alter data in the background.

Moreover, since the content of the clipboard is not automatically cleared by default, it may remain accessible for a long time. If a user copies sensitive information but does not promptly overwrite or clear it, malicious software or third-party applications have the opportunity to read that content.

Some clipboard malware is specifically designed to tamper with addresses. The fraud report on transnational organized crime in Southeast Asia published by the United Nations Office on Drugs and Crime in 2024 mentions that a commonly used malware by Southeast Asian criminal groups is a clipper. This software monitors the clipboard of the infected system, waiting for an opportunity to replace addresses in cryptocurrency transactions. Once the victim inadvertently conducts a transaction, the funds will be transferred to the attacker's address. Because cryptocurrency wallet addresses are usually very long, users are less likely to notice changes in the receiving address.

(https://www.unodc.org/roseap/uploads/documents/Publications/2024/TOC_Convergence_Report_2024.pdf)

By this point, I believe everyone has realized that the fundamental way to prevent clipboard attacks is to avoid copying sensitive information and to install professional antivirus software to prevent malware intrusion.

The main purpose of clearing the clipboard is to shorten the exposure time of sensitive information and reduce the risk of being read by malicious software or other applications. If you accidentally copy sensitive information, clearing the clipboard in a timely manner can lower the possibility of leakage. A simple method is to immediately copy a large chunk of irrelevant content to 'flush' the previously copied sensitive information, which can reduce the probability of it being read to some extent.

However, if your device has already been infected with malware that steals or alters clipboard content, then manually clearing the clipboard has limited effectiveness. This is because such malware can monitor and read data in real-time, and the speed of manual clearing is often unable to keep up with their operations. Therefore, the best practice is to avoid copying sensitive information from the source and ensure device security. If you suspect that your device has been infected, it is advisable to quickly transfer assets to a new wallet to prevent further losses.

In addition to the clipboard, sensitive information may also be leaked through the following methods, and users should be extra cautious:

  • Albums, cloud storage, input methods: Avoid exposing private keys / mnemonic phrases to the internet, including but not limited to albums, cloud storage, WeChat favorites, mobile notes, etc. Avoid entering sensitive information in the input method; it is recommended to use the system's built-in input method, disable the 'cloud sync' feature of the input method, and try not to fill in private keys / mnemonic phrases by copying and pasting.

  • Malware risks: Regularly use antivirus software to scan the system and eliminate potential malware.

  • Browser extension permission issues: Disable unnecessary browser extensions. If you are concerned about the permission risks of a certain extension, you can choose not to use it after installation, check the extension ID, search for the local path on the computer, and find the manifest.json file in the root directory of the extension to send the file content to AI for permission risk interpretation. If you have a mindset for isolation, consider enabling a separate Chrome Profile for unfamiliar extensions to at least make malicious actions controllable.

  • Transfer address tampering risk: When performing cryptocurrency transfers and other operations, be sure to carefully verify the wallet address to avoid misdirecting funds due to clipboard tampering.

Clipboard Clearing Tutorial

Here are some relatively simple methods to clear the clipboard on macOS, iOS, Android, and Windows that you can try:

macOS only saves the current clipboard content and does not record history. Copying a piece of irrelevant content can overwrite sensitive history. iOS also only saves the current clipboard content; in addition to copying a piece of irrelevant content, users can create a shortcut to add the command to clear the clipboard to the home screen for easier clearing.

(https://x.com/0xBeyondLee/status/1855630836118467028)

Windows 7 and earlier versions only save the current clipboard content without a history, and you can overwrite the original content in the clipboard by copying a piece of irrelevant content, thus indirectly clearing it. Windows 10 / 11 (if 'Clipboard History' is enabled): Press Win + V to view clipboard history, then click the 'Clear All' button in the upper right corner to delete all history.

The clipboard history in Android usually refers to the clipboard history provided by the input method. Many Android devices offer clipboard history functionality within the input method, allowing users to enter the clipboard management interface of the input method to manually clear unwanted records.

In short, if the system itself does not save history, simply copying new content to overwrite is sufficient. If the system has clipboard history (such as Windows 10 / 11 or certain Android devices), then manually clearing the history as described above is necessary.

Summary

The clipboard is a frequently overlooked yet prevalent channel for leaks. We hope this article can help users re-evaluate the security risks of copy-pasting and recognize that 'local operations do not equal absolute security.' Security is not just a technical issue, but also a matter of behavioral habits. Only by maintaining vigilance, raising security awareness, and implementing basic protective measures in daily operations can one truly safeguard their assets.