Magecart
Magecart refers to a style of online attack, and to the loosely related threat actors behind it, in which criminals sneak malicious code into an e-commerce website to steal payment card details as shoppers enter them at checkout. Rather than breaking into a stored database, the code quietly captures data from the online payment form and sends it to the attacker. Because the theft happens in the customer's browser as they type, shoppers and merchants often do not notice it right away.
Magecart is an umbrella term describing both a category of client-side web skimming (also called formjacking) attacks and the various threat actor groups associated with them, targeting e-commerce checkout and payment pages. Attackers inject malicious JavaScript into a website—either directly or through a compromised third-party script or supply-chain component—to intercept data entered into HTML payment forms and exfiltrate it to an attacker-controlled endpoint. Captured fields may include cardholder data such as the PAN, cardholder name, and expiration date, as well as sensitive authentication data such as the CAV2/CVC2/CVV2/CID entered at checkout; because the skimmer harvests values in the browser at the point of entry, it can capture sensitive authentication data that must not be stored after authorization. Magecart activity is a client-side threat that operates outside the merchant's server-side controls and can evade defenses focused solely on stored data, making script integrity monitoring, content controls over third-party scripts, and browser-side change detection relevant mitigations; these controls help reduce but do not guarantee prevention of skimming.
Why it matters
Magecart attacks strike at a point that many traditional payment security programs do not fully cover: the customer's browser at the moment of checkout. Controls that focus on protecting stored data—database encryption, access controls on back-end systems, and monitoring of server-side environments—do little to stop a skimmer that harvests card details as they are typed into an HTML payment form. Because the malicious code captures values at the point of entry, it can intercept sensitive authentication data such as the CAV2/CVC2/CVV2/CID that must never be stored after authorization, giving attackers exactly the data needed for card-not-present fraud.
The threat is compounded by its stealth and its supply-chain dimension. Skimming code is often introduced not by directly compromising the merchant's own site but by tampering with a third-party script the site already loads, meaning a single compromised component can affect many merchants at once. Shoppers and merchants frequently do not notice the theft for some time, since the checkout page continues to function normally while data is quietly exfiltrated to an attacker-controlled endpoint. Reported campaigns have targeted checkouts tied to major payment networks, illustrating that the technique remains actively used against live e-commerce environments.
Who it's relevant to
Inside Magecart
Common questions
Answers to the questions practitioners most commonly ask about Magecart.