Anatomy of a Breach

Anatomy of a Breach: Heartland Payment Systems — 130 Million Cards and a SQL Injection

> series: anatomy_of_a_breach —— part: 002 —— target: heartland_payment_systems —— cards_compromised: 130,000,000<span class="cursor-blink">_</span>_

Hedgehog Security 28 February 2009 14 min read

One vulnerable web form. One hundred and thirty million cards.

On 20 January 2009 — the day of President Obama's inauguration, in what critics called a deliberate attempt to bury the news — Heartland Payment Systems announced that it had been the victim of a security breach. The reality, as it emerged over the following months, was staggering: attackers had used a SQL injection vulnerability in a web login page to gain access to Heartland's corporate network in late 2007, spent approximately six months evading multiple anti-virus systems while working their way into the payment processing network, and installed sniffer software that captured payment card data as it was processed in real-time. The total: approximately 130 million credit and debit card records — the largest card breach ever reported at the time.

Heartland processed 100 million payment card transactions per month for 175,000 merchants, making it the fifth-largest credit card processor in the United States. The breach was orchestrated by Albert Gonzalez, a former Secret Service informant turned cybercriminal who was also behind the TJX (TK Maxx) breach — and who was ultimately sentenced to 20 years in federal prison.


Recommended

Not sure where to start?

We'll scope your test for free and tell you exactly what you need. No obligation, no hard sell.

Free Scoping Call

How the attack unfolded.

Heartland Breach — Attack Timeline
── Late 2007 ──────────────────────────────────────────────
SQL injection attack against a web login page
The vulnerable page had been deployed 8 years earlier
Attackers gain foothold on Heartland's corporate network

── Early-Mid 2008 ────────────────────────────────────────
Attackers spend ~6 months moving laterally
Multiple anti-virus systems bypassed
Malware tested against 20+ AV products before deployment
Gradual escalation toward the payment processing network

── Mid 2008 ──────────────────────────────────────────────
Sniffer software installed on payment processing systems
Card data captured in real-time as transactions processed
Data includes card numbers, expiry dates, cardholder names

── October 2008 ──────────────────────────────────────────
Visa and MasterCard alert Heartland to suspicious activity
Forensic investigation begins — takes 2+ months

── 20 January 2009 ──────────────────────────────────────
Heartland publicly discloses the breach
Stock price drops 50% within days, 77% by March
Visa removes Heartland from PCI DSS compliant list

── August 2009 ──────────────────────────────────────────
Albert Gonzalez and two Russian co-conspirators indicted
Total financial impact exceeds $200 million

An eight-year-old web form.

The initial compromise was a SQL injection attack against a web login page that had been deployed eight years earlier and never subsequently reviewed for security vulnerabilities. SQL injection — where an attacker inserts malicious database commands through a web input field — was a well-understood vulnerability even in 2007. The OWASP Top 10 had listed injection flaws as the number one web application vulnerability since its inception. This was not a zero-day exploit or a novel attack technique. It was the exploitation of a known, preventable vulnerability class in a forgotten application.

This is a pattern we see repeatedly in our web application penetration testing engagements: legacy web applications deployed years ago, forgotten by the development team, excluded from patching cycles, and never subjected to security testing — yet still running in production, still connected to the network, and still exploitable. Our testing methodology specifically includes discovery of forgotten applications and legacy code, because these are consistently where the most critical vulnerabilities reside.


A routine web application test would have prevented this.

The Heartland breach is the definitive case study for why web application penetration testing is not optional. A standard web application test conducted at any point during those eight years would have identified the SQL injection vulnerability in the login page. A standard infrastructure penetration test would have identified the lack of network segmentation between the corporate network and the payment processing environment. And continuous monitoring through a SOC in a Box-style service would have detected the six months of lateral movement, privilege escalation, and data exfiltration that occurred between initial compromise and card capture.

Failure What Testing Would Have Caught
SQL injection in legacy web application A web application penetration test would have identified this immediately. SQL injection testing is the most fundamental component of any web application assessment.
No segmentation between corporate and payment networks An internal infrastructure test would have demonstrated that a compromise of any corporate system could reach the payment processing environment — exactly the attack path Gonzalez exploited.
Six months of undetected lateral movement Continuous monitoring — the kind provided by SOC in a Box — would have detected the anomalous network activity, privilege escalation attempts, and malware installation that occurred over the six-month dwell period.
Card data transmitted unencrypted within the processing network Card data was captured by sniffers because it traversed internal networks in cleartext. A security architecture review or PCI DSS assessment would have identified this gap. After the breach, Heartland pioneered end-to-end encryption — a control that should have existed before the incident.

What the breach cost Heartland.

Financial Impact: Over $200 Million
Heartland paid more than $145 million in compensation for fraudulent payments, plus tens of millions in legal fees, forensic investigation costs, and card brand fines. The total financial impact exceeded $200 million — for a breach that started with a single SQL injection in a forgotten web form.
Stock Price: -77%
Heartland's stock price dropped 50% within days of the disclosure announcement and continued falling to a 77% decline by March 2009. The company was temporarily removed from Visa's list of PCI DSS compliant processors, losing business during the four months it took to re-certify.
Criminal Prosecution
Albert Gonzalez was sentenced to 20 years in federal prison — the longest sentence for a computer crime at the time. Two Russian co-conspirators were also indicted. Gonzalez was simultaneously connected to the TJX, Hannaford Brothers, and 7-Eleven breaches.
Industry Change
Post-breach, Heartland became a vocal advocate for end-to-end encryption of payment card data — a technology they pioneered in response to the breach. The incident accelerated PCI DSS adoption and enforcement across the payment processing industry.

What this breach still teaches us.

The Heartland breach teaches three lessons that remain as relevant today as they were in 2009. First: legacy applications are your most dangerous assets — if you have web applications that have not been security-tested, test them now, because attackers are looking for exactly these forgotten entry points. Second: network segmentation is not optional — if a compromise of your corporate email can reach your most sensitive systems, your architecture is broken. Third: PCI compliance is necessary but not sufficient — Heartland was PCI DSS compliant at the time of the breach.

If you process payments, our PCI DSS penetration testing goes beyond compliance checkbox to test real-world exploitability. If you want to detect the lateral movement and dwell time that defined this breach, SOC in a Box provides the continuous monitoring that Heartland did not have. And if you need incident response when a breach is discovered, our parent company UK Cyber Defence provides the forensic capability to investigate, contain, and recover.


SQL injection is still the number one web vulnerability.

Our <a href="/penetration-testing/web-application">web application penetration testing</a> identifies injection flaws, authentication bypasses, and business logic vulnerabilities — including in the legacy applications that most organisations have forgotten about but attackers have not.

Next Step

Not sure where to start?

We'll scope your test for free and tell you exactly what you need. No obligation, no hard sell.

Free Scoping Call

Related Articles