Online retailer AliExpress fixed an open redirect vulnerability in its online shopping portal last October that could have been exploited to display a fake coupon designed to phish sensitive information from those who viewed it.

Researchers at Check Point Software Technologies devised an exploit technique for the vulnerability, whereby an attacker could send shoppers a link to a legit AliExpress page that has been compromised with malicious Javascript code. That code would then be executed in the user's web browser, redirecting the victim to a second link that would open the evil coupon.

Using this technique, malicious actors would be able to bypass AliExpress's protections against cross-site scripting, explains Check Point in both a blog post and corresponding report authored by researchers Dikla Barda, Roman Zaikin and Oded Vanunu, head of product vulnerability research.

A fake AliExpress coupon would have a strong chance of fooling a victim because the retailer – a subsidiary of Alibaba – commonly uses coupons to entice shoppers, even asking recipients to enter their credit card details for easier online payment and checkout. In the fake version, however, the customer's details would be sent directly back to the attacker's server.

During their investigation, Check Point researchers learned that they could manipulate a parameter found within an AliExpress subdomain in order to execute JavaScript code from that subdomain. But the payload would not run, because AliExpress' protections against cross-site scripting attacks prevented the researchers from sending the payload directly to a victim.

However, "AliExpress uses only a simple method to thwart these kind of attacks... The method involved checking the referer header of the request and if the referer was not set or was incorrect then the request would be denied by the server," Check Point explains in its blog post, noting that a referer "is an HTTP header that identifies the URL of the webpage where the request was requested from."

To get around this, the researchers knew they needed to send their malicious link from an approved, trusted AliExpress URL instead. "In order to achieve that, we looked for links in AliExpress that redirected to a second link in AliExpress, a link that we could replace with our own malicious link," the blog post explains.

Researchers found such a link, and shortened its URL so it wouldn't look suspicious. Clicking on this link would send a user to the AliExpress login screen, which would subsequently inject the JavaScript to the page and issue the fake coupon.