British Airways

WikipediaVerified

Breach Date

June 21, 2018

Records Affected

500,000

Verified

Yes

Source

wikipedia

Summary

Between June and September 2018, British Airways suffered a major data breach when the Magecart cybercriminal group injected malicious JavaScript code into the airline's website and mobile app, skimming payment card details from approximately 500,000 customers as they made bookings. The attack is one of the most prominent examples of a web supply-chain skimming attack (formjacking) and led to one of the largest GDPR fines in UK history.

The attackers modified a JavaScript file on the British Airways website (modernizr.js) to capture payment form data — including card numbers, expiry dates, and CVV codes — as customers entered it during the booking process. The stolen data was transmitted in real-time to a server controlled by the attackers. The attack also affected the BA mobile app, which loaded content from the compromised website.

The UK Information Commissioner's Office (ICO) initially announced a record fine of GBP 183 million in July 2019 — the first major GDPR enforcement action. This was subsequently reduced to GBP 20 million in October 2020, with the ICO citing the economic impact of COVID-19 and BA's cooperation. Despite the reduction, the fine remained the largest GDPR penalty issued by the ICO at the time and established important precedents for airline and e-commerce data security obligations.

Breach Details

Breach Date
June 21, 2018
Records Affected
500,000
Source
Wikipedia
Verified
Verified
Industry
Transportation
Type
Hacked

Impact Analysis

Scale of Impact

  • ~500,000 customers had payment card details stolen
  • Customers who made bookings on ba.com or the BA mobile app between June 21 and September 5, 2018
  • Payment card data captured in real-time as it was entered

Data Types Exposed

  • Payment card numbers
  • Card expiry dates
  • CVV/CVC security codes
  • Names
  • Billing addresses
  • Email addresses

Financial Impact

CategoryAmount
ICO GDPR fine (reduced from GBP 183M)GBP 20 million
Customer compensation claimsUndisclosed (thousands of claims)
Card replacement and fraud costsUndisclosed
Remediation and security improvementsUndisclosed
Total financial impactGBP 20+ million (fine alone)

Downstream Effects

  • Customers experienced fraudulent transactions on compromised payment cards
  • Banks and card issuers incurred costs for card replacements and fraud chargebacks
  • The breach triggered the first major GDPR enforcement action by the ICO
  • British Airways faced class action lawsuits from affected customers
  • The Magecart threat gained widespread recognition in the cybersecurity community
  • Airlines and e-commerce companies globally reviewed their web application security
  • The breach demonstrated that GDPR fines for security failures could be substantial

Timeline

  • June 21, 2018: Magecart attackers inject malicious JavaScript into the British Airways website
  • June-September 2018: Payment card data is skimmed from approximately 500,000 customers in real-time
  • September 5, 2018: British Airways detects the breach and removes the malicious code
  • September 6, 2018: British Airways publicly discloses the breach
  • September 2018: BA begins notifying affected customers and offers credit monitoring
  • October 2018: Security firm RiskIQ publishes detailed technical analysis attributing the attack to Magecart
  • July 8, 2019: ICO announces intention to fine BA GBP 183 million — the first major GDPR fine
  • October 16, 2020: ICO issues final penalty of GBP 20 million (reduced from GBP 183M due to COVID-19 impact and BA cooperation)
  • 2021: British Airways settles class action claims from affected customers
  • Post-2018: BA implements comprehensive web application security overhaul including Content Security Policy, Subresource Integrity, and real-time script monitoring

Lessons Learned

1. Client-Side JavaScript Is a Critical Attack Surface

The Magecart attack exploited the fact that website JavaScript runs in the user's browser and can capture any data entered into forms. Organizations must implement Content Security Policy (CSP) headers, Subresource Integrity (SRI) checks, and continuous monitoring of client-side scripts to detect unauthorized modifications.

2. Web Supply Chain Security Requires Active Monitoring

The modified JavaScript file went undetected for approximately 15 days. Organizations must implement file integrity monitoring for all production web assets and alerting systems that detect unauthorized changes to scripts, stylesheets, and other static resources.

3. Mobile Apps That Load Web Content Share Web Vulnerabilities

The BA mobile app was affected because it loaded content from the compromised website. Mobile applications that render web content inherit all vulnerabilities of the underlying web assets. Mobile and web security must be assessed together.

4. GDPR Fines for Security Failures Can Be Substantial

Although the final fine was reduced from GBP 183M to GBP 20M, it established that regulators view inadequate security measures as a serious GDPR violation. The initial announcement of GBP 183M sent a clear signal about regulatory expectations.

5. Payment Card Data Capture Creates Immediate Financial Harm

Unlike breaches of hashed passwords or email addresses, the real-time capture of complete payment card details (including CVVs) enables immediate fraudulent transactions. This makes web skimming attacks particularly damaging to consumers.

Technical Details

Attack Vector: Magecart JavaScript Injection (Formjacking)

The Magecart group modified a JavaScript file (modernizr.js) on the British Airways website to include a card-skimming payload. The malicious code intercepted payment form data as customers entered it and transmitted it to an attacker-controlled server.

Technical Details

  • Attack group: Magecart (specifically Magecart Group 6)
  • Method: Modification of a legitimate JavaScript library on ba.com
  • Compromised file: modernizr.js (22 lines of malicious code added)
  • Exfiltration: Data sent to baways.com — a domain registered by the attackers to mimic British Airways
  • Duration: June 21 to September 5, 2018 (approximately 15 days of active skimming)
  • Scope: ba.com website and BA mobile app (which loaded website content)

How the Attack Worked

  1. Initial compromise: Attackers gained access to British Airways web infrastructure (method not fully disclosed)
  2. Code injection: 22 lines of JavaScript were added to the legitimate modernizr.js library
  3. Data capture: The malicious script attached an event listener to the payment form's submit button
  4. Exfiltration: When customers clicked 'Submit,' the script captured all form fields (card number, expiry, CVV, name, address) and sent them via XMLHttpRequest to baways.com
  5. Stealth: The legitimate form submission proceeded normally, so customers had no indication their data was being stolen

Malicious Code Behavior

The injected JavaScript:

  • Listened for the mouseup and touchend events on the payment form submit button
  • Serialized all form input fields into a JSON object
  • Sent the data to https://baways.com/gateway/app/data498 via AJAX
  • Used a domain name designed to blend in with legitimate BA infrastructure

Why Existing Security Failed

  • No Content Security Policy (CSP) headers to restrict script sources
  • No Subresource Integrity (SRI) checks to detect modified files
  • No file integrity monitoring on production JavaScript files
  • Insufficient network monitoring to detect data exfiltration to an unknown domain

Frequently Asked Questions

What happened in the British Airways breach?

Between June and September 2018, the Magecart cybercriminal group injected malicious JavaScript code into the British Airways website and mobile app, stealing payment card details from approximately 500,000 customers as they made bookings. The card data was captured in real-time and sent to an attacker-controlled server.

What data was stolen?

Complete payment card details including card numbers, expiry dates, and CVV security codes, along with cardholder names, billing addresses, and email addresses.

How were customers affected?

Customers who made bookings on ba.com or the BA mobile app between June 21 and September 5, 2018, had their payment card details stolen. Many experienced fraudulent transactions on their compromised cards.

What was the GDPR fine?

The ICO initially announced a fine of GBP 183 million — the first major GDPR enforcement action. This was reduced to GBP 20 million in the final decision, with the ICO citing the COVID-19 economic impact and BA's cooperation.

Who was behind the attack?

The attack was attributed to Magecart Group 6, a cybercriminal organization specializing in web-based payment card skimming (formjacking). Magecart is an umbrella term for multiple criminal groups that use JavaScript injection to steal payment data from e-commerce websites.

What should affected customers have done?

Monitor bank and credit card statements for fraudulent transactions. Request replacement cards from their bank. Enable transaction alerts and notifications. Report any unauthorized transactions to their bank immediately.

Back to Breach Database
Breach data sourced from Wikipedia: List of data breaches, licensed under CC BY-SA 3.0.

Protect Your Organization From Data Breaches

Our security experts can help you identify vulnerabilities and strengthen your defenses.