Form Jacking/Web Skimming

Learn how hackers inject malicious JavaScript code into online payment forms to steal sensitive user data, such as credit card details, login credentials, and personal information.

Formjacking is a type of cyberattack where hackers inject malicious JavaScript code into online payment forms to steal sensitive user data, such as credit card details, login credentials, and personal information. This method is similar to ATM skimming but targets online transactions instead.

How Does Formjacking Work?

  • Infection: Attackers exploit vulnerabilities in a website (often an e-commerce site) or a third-party service provider (such as a payment processor or analytics tool).
  • Code Injection: Malicious JavaScript is injected into the checkout page or another form that collects payment information.
  • Data Theft: When users enter their payment details, the script captures the data and sends it to the attacker's server.
  • Stealth Mode: The user and the website owner may remain unaware, as transactions continue to process normally.
  • Magecart Attacks: A well-known group of cybercriminals that has targeted major companies like British Airways, Ticketmaster, and Newegg.
  • Compromised Third-Party Libraries: Attackers often target third-party scripts (e.g., analytics or chatbots) used by multiple sites to maximize their reach.
  • Content Security Policy (CSP): Restrict which scripts can run on your website.
  • Subresource Integrity: Ensure third-party scripts have not been tampered with.
  • Regular Security Audits: Scan for unauthorized script modifications.
  • Web Application Firewall: Block suspicious activity before it reaches the user.
  • Tamper Detection: Use File Integrity Monitoring (FIM) to detect unauthorized changes in real time.