PyPI Malware Targets E-commerce Platforms with Fully Automated Carding Toolkit

A recent investigation by the Socket Research Team has uncovered a malicious Python package, disgrasya, hosted on the Python Package Index (PyPI).

This package introduces a fully automated carding toolkit that specifically targets WooCommerce-based e-commerce platforms integrated with CyberSource payment gateways.

Unlike traditional supply chain attacks that rely on deception or typosquatting, disgrasya makes no effort to appear legitimate, openly distributing its malicious payload to enable large-scale credit card fraud.

Carding Attacks and Their Growing Threat

Carding is a form of payment fraud where attackers test stolen credit card information to identify active cards for resale or misuse.

Fraudsters often acquire card details from dark web marketplaces or leaked databases and use tools like disgrasya to automate the testing process.

By simulating real checkout flows complete with tokenized payment data and randomized billing details the script bypasses fraud detection systems, making it nearly indistinguishable from legitimate user activity.

The financial implications of such attacks are staggering. Juniper Research projects that online payment fraud will cost businesses over $362 billion globally between 2023 and 2028, with annual losses nearly doubling from $38 billion in 2023 to $91 billion by 2028.

Carding attacks represent a significant portion of these losses due to their stealthy and scalable nature.

Technical Breakdown of the Attack

The disgrasya package automates the entire carding workflow, from product selection to payment verification.

According to the Report, the attack begins by scraping product IDs from targeted WooCommerce stores using GET requests.

It then simulates adding items to the cart via AJAX requests and harvests critical security tokens, such as CSRF nonces and CyberSource’s capture_context, directly from the checkout page.

The script proceeds to tokenize stolen credit card data using CyberSource’s mechanisms and submits it through WooCommerce’s real checkout endpoints.

If the card is valid, the attacker receives confirmation without triggering fraud detection systems like CAPTCHAs or JavaScript-based protections.

One of the most alarming aspects of this attack is its exfiltration mechanism.

The script sends stolen card data including numbers, expiration dates, CVVs, and tokenized representations to an external server controlled by the attacker (railgunmisaka[.]com). This allows fraudsters to verify card validity remotely while maintaining anonymity.

At the time of its discovery, disgrasya had been downloaded over 34,860 times from PyPI.

Its modular design enables even low-skilled attackers to deploy sophisticated fraud campaigns against WooCommerce stores.

The package’s name Filipino slang for “disaster” aptly describes its devastating impact on online merchants.

The script’s ability to mimic legitimate user behavior makes it particularly difficult to detect.

Actions such as navigating product pages, adding items to carts, and submitting tokenized payments are identical to those performed by genuine shoppers.

This low-noise approach allows attackers to evade traditional fraud detection systems.

To combat such threats, e-commerce platforms must adopt layered defenses:

  • Fraud Protection Rules: Enable rules that block low-value transactions commonly used in carding attacks.
  • Traffic Monitoring: Watch for unusual patterns like high failure rates or multiple small orders from a single IP address.
  • Bot Protection: Implement CAPTCHAs or other anti-bot measures during checkout.
  • Rate Limiting: Restrict access to critical endpoints like AJAX-based checkout flows.

WooCommerce provides specific guidelines for preventing carding attacks, including dynamic adjustments to fraud protection settings and monitoring for evolving attack patterns.

While disgrasya has been removed from PyPI, its methodology remains a blueprint for future attacks.

The incident highlights the need for vigilant monitoring of third-party packages and robust security measures at every stage of the e-commerce transaction process.

Find this Story Interesting! Follow us on LinkedIn and X to Get More Instant Updates

Mandvi
Mandvi
Mandvi is a Security Reporter covering data breaches, malware, cyberattacks, data leaks, and more at Cyber Press.

Trending News

Related Stories