Skip to content
Business logic Write-up Intermediate

AliExpress Captcha Reuse

AliExpress login captchas were drawn from a small set of pre-generated images, and each image was made unique only by appending random bytes after the JPEG end marker. An attacker could index captchas by image size and solve them without OCR, enabling automated login or registration.

Unicorn Security Follow

Published on therealunicornsecurity.github.io

I recently noticed (thanks to Chrome’s form cache) that AliExpress login captcha’s were not random. Instead, it seems they are using a set of pre-generated images and sending users a random one from this set.

Unicorn Security, on therealunicornsecurity.github.io

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the captcha system reused a small set of pre-generated images and tried to make each file unique by appending random bytes after the JPEG end marker, which does not change the visible image or its size predictability.

Impact

The weakness could allow automated solving of captchas, which could be used in a full register/login automation process, although the author did not demonstrate a complete attack and noted other protections such as a captchaToken parameter.

What the attacker needed

Access to the captcha endpoint; ability to send HTTP requests

The fix

The captcha system should generate a fresh, unpredictable image for each challenge instead of reusing a small set and appending random bytes.

How it was found

  1. Send a request to the captcha endpoint with arbitrary values for sessionid, identity, and style to receive a captcha image.
  2. Observe that captchas always contain four capital alphanumeric characters.
  3. Notice that images with the same visible captcha have different checksums because random bytes are appended after the JPEG end marker.
  4. Index captcha images by their byte length, since different captchas have different sizes.
  5. Use the image length to look up the correct captcha answer without solving it.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A captcha is a puzzle meant to prove a human is filling in a form. Here the same few puzzle pictures were reused, and the only thing that changed was a couple of invisible bytes added to the end of each image file. Because each picture had a fixed file size, someone could tell which puzzle it was just by looking at the size, without solving it.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.