Back
Credit card data hack on WooCommerce

How can hackers steal credit card data from your WooCommerce store?

If you have credit card form on your WooCommerce Checkout page, it is time to worry. We have noticed that a large part of the Payment Gateway plugins allows customers to enter credit card information on the same checkout page. Though if you did not save this data in your online store, in case of favourable opportunities, it could be read and saved to a file on another server. If hackers manage to find a vulnerability in your online store, it is very likely that it will be possible to inject a keylogger that can steal your customers’ credit card data.

How hackers can steal credit card data 1

The difference between entering data in your WooCommerce store and payment provider page

When you have credit card input fields on the checkout page, these fields can be affected by JavaScript or PHP code. This risk disappears when you need to enter credit card details on another page, for example PayPal, or when the credit card form is loaded from a different site as an iframe. If you do not know how these fields are displayed on your website, we recommend contacting your online store administrator to explain if there is a risk of data leakage.

An example of how credit card details can be stolen

You have credit card fields on the checkout page, and you use some plugins, and one of them has a vulnerability such as “stored XSS”, which is quite often found in various plugins. We remind you that the more plugins you use, the greater the risk of having security issues. Always evaluate your plugins. “Stored XSS” vulnerability allows the hacker to place a keylogger in your online store and affect the credit card’s input fields, i.e. send them to the hacker.

Let’s say you are using the Advanced Search for WooCommerce plugin, where we recently have found the “Stored XSS” vulnerability. This plugin has a Custom CSS field where the CSS code can be saved. The existing “Stored XSS” vulnerability allows changing this field even if the user is not logged-in on the website. The hacker places a keylogger (JavaScript script) that will be loaded on each page, including the payment page.

Keylogger is uploaded using the security vulnerability in Advanced Search for WooCommerce plugin.

How hackers can steal credit card data 2

The uploaded keylogger looks like this. It is loaded on every page including the checkout page.

How hackers can steal credit card data 3

The JavaScript keylogger code looks like this:

How hackers can steal credit card data 4

When the “Place Order” button is pressed, this code collects the credit card details, i.e. the cardholder’s name, card number, expiry date and security code, and sends these data using the HTTP POST method to the file on the hacker’s server.

Then, on the hacker’s server, all of this data is stored in the credit_cards.txt file, the PHP code looks like this:

How hackers can steal credit card data 5

All saved data can be viewed in the credit_cards.txt file.

How hackers can steal credit card data 6

Similar Posts

Security threat caused by closed WordPress plugins

WordPress Plugins closed by WordPress.org security team still endangers thousands of websites

Plugins are the most common cause of WordPress website hacking. In February, we have found a security vulnerability in the Simple Contact ...

Coinhive script clean up from hacked website

How to clean up CoinHive miner code from the hacked WordPress website?

We have noticed that a massive number of hacked WordPress websites are used for Monero cryptocurrency mining. Hackers use CoinHive – a ...

Credit card data hack on WooCommerce

How can hackers steal credit card data from your WooCommerce store?

If you have credit card form on your WooCommerce Checkout page, it is time to worry. We have noticed that a large part of the Payment ...

Leave a Reply

Your email address will not be published. Required fields are marked *