Recently members of the Fidus penetration testing team noticed an interesting blog post on the OnePlus forum by an individual discussing recent fraudulent attempts made on two of their credit cards. The forum user states that the only place both cards were used was on the OnePlus website in November 2017, they go on to ask whether other members of the community have had the same issue (spoiler:they had). OnePlus are currently using the Magento eCommerce platform, which is a common platform in which credit card hacking takes place.
These findings do not confirm OnePlus have suffered a breach. Instead, they look into the current structure of the payment flow and how it could have been achieved.
A further update has been posted at the bottom of this blog post.
We stepped through the payment process on the OnePlus website to have a look what was going on. Interestingly enough, the payment page which requests the customer’s card details is hosted ON-SITE. This means all payment details entered, albeit briefly, flow through the OnePlus website and can be intercepted by an attacker. Whilst the payment details are sent off to a third-party provider upon form submission, there is a window in which malicious code is able to siphon credit card details before the data is encrypted.
Straight away there are two issues that stand out:
Credit card fraud is not new to the Magento eCommerce platform. Sucuri blogged about this very issue back in 2015.
The other method commonly used by attackers, as described in the Sucuri blog, is modification of the app/code/core/Mage/Payment/Model/Method/Cc.php file. This method requires shell access to the server and indicates a serious compromise.
The Cc.php file handles the saving of card details on the eCommerce website. Regardless if card details are actually saved or not, the file is called regardless. Attackers are able to place code within this file which allows for payment details to be compromised and sent to an off-site location controlled by the attacker. Since this takes place within the prepareSave() function within Cc.php, the card details are not yet encrypted and are at risk. An example of malicious code can be seen below:
The below image highlights exactly where an attacker is able to compromise raw credit card data.
As it stands, the poll on the OnePlus forum regarding affected users has over 39 users complaining of recent fraudulent attempt. Numerous users of Reddit have also complained of the same issue.
Users of twitter have also started to question this potential issue.
The safest option to prevent credit card fraud is to use an OFF-SITE payment processor, or a processor who offers iFrame integration with checkout pages. Third-party payment providers have created PCI compliant sandboxes for the very purpose of securely taking card payments; utilise it.
Furthermore, it is highly recommended to conduct regular penetration testing assessments against your eCommerce websites to highlight any security risks.
Upon further review of the payment system, it should be noted that OnePlus are currently making use of the CyberSource Magento add-on, as can be seen below.
CyberSource note on their Magento marketplace page that all data submission is done within the client’s browser and never touches the eCommerce infrastructure (Fidus do not currently have an environment to test this statement).
If this is true, this leaves 2 potential avenues for attack and rules out the Cc.php theory:
It is also worth noting CyberSource have a statement within their Data Sheet PDF which states:
Secure Acceptance Silent Order POST limits your exposure to payment data, which reduces your PCI DSS scope, because many of the controls may no longer be applicable. For certain businesses, this can mean having to complete the PCI-DSS Self-Assessment Questionnaire (SAQ) versus a full scale audit. No payment solution, however, negates the need to validate compliance. You should consult with your acquiring bank to uate the level compliance required for your organization.
An update posted on the OnePlus website and an e-mail sent out to affected customers has confirmed a breach did occur and 40,000 customers had their payment details stolen.