Blockchain & Cryptocurrency Glossary

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

  • search-icon Clear Definitions
  • search-icon Practical
  • search-icon Technical
  • search-icon Related Terms

Man‑in‑the‑browser Attack

2 min read
Pronunciation
[mæn-ɪn-ðə-ˈbraʊ-zər ə-ˈtæk]
Analogy
Think of a man-in-the-browser attack as a corrupt translator sitting between you and a foreign banking representative. You write down instructions to send money to a specific account, but the translator—who both you and the banker trust completely—changes the account number on your instructions before passing them to the banker. The banker processes what appears to be your legitimate request, and neither of you realizes the translator has redirected your funds. Similarly, malicious code in your browser can modify transaction details after you've entered them but before they reach the blockchain, with both you and the website believing the communication is secure and unaltered.
Definition
A sophisticated cybersecurity attack where malicious code infiltrates a user's web browser, enabling attackers to intercept, modify, or inject data into the communication between the user and blockchain applications. These attacks can manipulate transaction details, alter wallet addresses, or steal credentials without the user or website being able to detect the compromise.
Key Points Intro
Man-in-the-browser attacks employ several key techniques to compromise blockchain transactions.
Key Points

Form field manipulation: Modifies recipient addresses and transaction amounts in web forms after user input but before submission.

API request interception: Alters transaction parameters in API calls between frontend interfaces and blockchain nodes.

DOM manipulation: Changes what's displayed to users, showing requested transaction details while executing different ones.

Credential harvesting: Captures private keys, seed phrases, and passwords entered into web-based wallet interfaces.

Example
Sarah uses a popular web-based wallet interface to manage her cryptocurrency. Unknown to her, her browser was compromised weeks earlier by malware hidden in a browser extension for checking token prices. When Sarah initiates a transaction to send 3 BTC to a merchant, she carefully verifies and enters the correct address. The transaction summary page shows the correct recipient and amount, which she confirms. However, the malicious code in her browser has silently modified the API request to send the funds to an attacker-controlled address instead. Sarah sees a successful transaction confirmation, and only realizes the attack when the merchant reports non-payment. By then, the funds have been moved through multiple addresses and are unrecoverable.
Technical Deep Dive
Man-in-the-browser attacks targeting blockchain applications typically implement several sophisticated technical mechanisms. The attack vector usually begins with browser extension compromise, browser exploit kit deployment, or malicious JavaScript injection through compromised website dependencies. Once established, the malware hooks into browser APIs including XMLHttpRequest, fetch(), WebSocket connections, and DOM manipulation functions using techniques like prototype tampering or service worker interception. For cryptocurrency-specific targeting, advanced implementations utilize regular expression pattern matching to identify wallet addresses across multiple blockchain formats, sometimes implementing substitution algorithms that preserve checksum validity. To evade detection, sophisticated variants employ code obfuscation, encrypted communications, and split execution patterns that distribute the attack across multiple components. Some advanced implementations utilize WebAssembly to conceal core functionality and employ timing analysis to execute only during actual transactions rather than test or verification attempts. For credential theft, keylogging is often implemented through input event listeners combined with form submission interception, capturing credentials even when autofill or password managers are used.
Security Warning
Web-based wallet interfaces are particularly vulnerable to these attacks. Whenever possible, use hardware wallets that require physical verification of transaction details. For high-value transactions, consider using a separate device or a bootable secure operating system dedicated exclusively to cryptocurrency management.
Caveat
Even supposedly secure browser-based wallet interfaces can be compromised by man-in-the-browser attacks, as the security model of modern browsers prioritizes functionality over isolation. Detection of these attacks is extremely difficult since the malicious code operates within the legitimate security context of the browser. While hardware wallets provide significant protection, they may still be vulnerable if users don't carefully verify transaction details on the hardware device itself, trusting instead what's displayed in the potentially compromised browser.

Man‑in‑the‑browser Attack - Related Articles

No related articles for this term.