9.4 Safe Downloads, Copy/Paste Habits, and Clipboard Risks
Provenance Is the Download's Real Metadata
A file carries two independent facts: its bytes and where it came from. Servers declare handling with Content-Disposition: attachment and a MIME type, but browsers may still sniff unless the site sends X-Content-Type-Options: nosniff. Operating systems keep the origin separately: Windows writes an alternate data stream, Zone.Identifier with ZoneId=3 -- the Mark-of-the-Web -- which is what SmartScreen reputation and Office macro blocking key off, so extraction paths that drop the flag silently remove that protection. Extension risk is a capability statement: invoice.pdf.exe hides behind "hide extensions for known file types", macros in .docm execute, and mounting an .iso reveals a .lnk that calls rundll32.
Script Containers in Innocent Wrappers
Executables are obvious; the interesting payloads are containers. .hta is HTML handed to a script host, .svg and .html can carry script when opened locally, .mhtml archives can render an authenticated page's content back to an attacker, and .url or shell library files launch commands with a friendly icon. Judge a download by what a double click makes the operating system do, not by its icon.
Copy/Paste Discipline
Paste is a context switch with no confirmation dialog: a credential into a lookalike window, or a secret into an SSH session someone left open. Two habits close most of the gap: paste unformatted text (Ctrl+Shift+V) so no foreign styles or hidden markup ride along, and never paste a command copied from a forum, chat answer, or "fix" tutorial -- review it in a text editor first, because trailing newlines execute on paste in many terminals and homoglyphs can hide characters a monospace font renders as a space.
Hidden-Text Injection
Rich text formats store instructions as formatting, so content can exist that you never see: white-on-white runs, one-point type, zero-height table rows, or blocks positioned off-screen with negative margins. Paste it into a document and it prints or forwards with your name on it; paste it into a summarizer or assistant and it becomes a prompt-injection channel. Formatting-carrying formats are an unreviewed input surface: convert to plain text before forwarding or processing anything untrusted.
Clipboard Scraping and Sync
The clipboard is shared memory with no access control between processes. Infected binaries poll the buffer and rewrite it the instant a wallet-address pattern appears, so the pasted value differs silently from what you copied. Remote-access tooling legitimately syncs clipboard contents into sessions, and OS clipboard history can roam the buffer to other signed-in devices, so a password copied once may be replicated and searchable. In the browser, navigator.clipboard.readText() needs focus and a permission grant, but a content script in a broad-permission extension can attach a copy event listener and read any selection. Defenses: one password manager with auto-clear, no secret copies inside unmanaged apps, clipboard history and cloud sync off, buffer cleared on lock.
Architecture Diagram
Key Takeaways
- Provenance matters as much as content: Mark-of-the-Web drives reputation and macro blocking, and extraction can erase it.
- Double-click capability, not icon, defines file risk -- containers like
.hta,.svg,.isocarry executable behavior. - Paste unformatted, and never paste unreviewed commands; trailing newlines and homoglyphs make paste unsafe by default.
- Rich text can carry invisible instructions that print, forward, or hijack an AI summarizer downstream.
- Clipboard pollers swap addresses and OS sync can roam secrets; auto-clear managers and disabled sync are the mitigation.