Skip to main content
Back
IntrusionAWS
1 min read

Magecart payment skimmers spread through publicly writable Amazon S3 files

Victim
Website operators and third-party script suppliers
When
Early April 2019, exact day unreportedDisclosed Jul 10, 2019
Entry
Public write access to Amazon S3 objects used as website scripts.

A Magecart group altered scripts stored in publicly writable Amazon S3 buckets. Sites using those files then served payment-skimming code to visitors. RiskIQ counted more than 17,000 affected domains, but many of the scripts never loaded on a checkout page.

What happened

Outside publishing team
External writer
Internet
Website supplier
S3 script files

Website supplier

  1. 1

    Unapproved writers change website files

    From early April 2019

    RiskIQ observed changes to existing website scripts in S3 buckets that permitted anyone to write. The unauthorized changes added payment-skimming code.

  2. 2

    Dependent websites deliver the changed files

    During the campaign

    Websites that depended on the changed scripts delivered the altered code to visitors. RiskIQ found that many of the scripts were used away from payment pages.

Impact

RiskIQ linked modified scripts to more than 17,000 domains. The report gives no count of stolen cards.

Could this have been prevented?

Separate permission to publish a script from permission to read it

A public script can stay readable while its S3 bucket policy limits changes to approved publishers. Website operators can separately review which third-party scripts their checkout pages accept.

Incident control assessments

1
Prevented
0
Contained
1
Not covered

How it could have been prevented

The same replay with the controls in place. Green marks where a step is refused, blue where it is bounded, and red where no control reaches it. Open a row to read the control, why it acts, and its caveat.

Outside publishing team
External writer
Internet
Website supplier
S3 script files

Website supplier

1 · Unapproved writers change website files

1 Prevented

2 · Dependent websites deliver the changed files

1 Not covered

Key facts

  • RiskIQ traced the campaign back to early April 2019.
  • The affected buckets let unapproved writers change existing files.
  • RiskIQ counted more than 17,000 affected domains.
  • Many affected scripts did not load on checkout pages.

Sources

Every fact in this breakdown comes from the public reporting below. The replay is a model of that reporting, not a reconstruction of the environment it describes.

  1. 1.
    Magecart Breaches Websites Via Misconfigured Amazon S3 BucketsRiskIQ, Yonathan Klijnsma · Jul 10, 2019 · ResearchFirsthand campaign telemetry, unrestricted write access, modified site assets and limits on checkout exposure.
  2. 2.
    Magecart: The State of a Growing ThreatRiskIQ · Oct 4, 2019 · ResearchThe monitored campaign began in early April 2019 and affected more than 17,000 domains.
  3. 3.
    Bucket policies for Amazon S3Amazon Web Services · undated · Vendor reportResource policies can control which principals may read or write specified objects.
  4. 4.
    Policy evaluation logicAmazon Web Services · undated · Vendor reportAn applicable explicit denial takes precedence over an allow.

The estate in the replay is illustrative and drawn at the level of attack stages; the victim's real environment is not public. Verdicts describe what a control does when it is in place before the incident. They are not an assessment of the victim's security program.

More cloud attack breakdowns

All breakdowns