Skip to content
XSS Write-up Intermediate

Missing Bricks: Finding Security Holes in LEGO APIs

The BrickLink website had a cross-site scripting (XSS) vulnerability in a coupon search field and an XML External Entity (XXE) vulnerability in the wanted list upload. An attacker could exploit these to take over user accounts, read arbitrary files on the server, and access AWS EC2 credentials.

Shiran Yodev Follow

Published on salt.security

Modern business sectors with rapid growth are often a very fertile ground for finding security issues. Companies that are growing very quickly often release software rapidly and sometimes prioritize business functionality over security.

Shiran Yodev, Security Researcher, on salt.security

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 application failed to properly sanitise user input in the coupon search field and did not disable external entities in its XML parser.

Impact

An attacker could take over user accounts, read arbitrary files on the server, and obtain AWS EC2 credentials, potentially leading to full compromise of internal servers.

What the attacker needed

Victim clicks a link (for XSS); ability to upload XML (for XXE)

The fix

The vulnerabilities were fixed according to the researcher's tests, though LEGO's policy prevented official confirmation.

How it was found

  1. Navigate to the 'Find Username' dialog box in the coupon search functionality.
  2. Enter a payload containing HTML characters and observe that they are not sanitised.
  3. Use a payload with an event handler to trigger JavaScript execution, confirming XSS.
  4. Upload an XML file with an external entity referencing /etc/passwd in the 'Upload to Wanted List' feature.
  5. Observe that part of /etc/passwd is returned in an error message.
  6. Modify the XML to include the file content in the Remarks field to retrieve the entire file.

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.

This report describes two security holes in the BrickLink website. One let an attacker insert malicious code into a web page that would run in another user's browser (cross-site scripting), and the other let an attacker trick the server into revealing files and cloud credentials by uploading a specially crafted XML file (XXE). These flaws could allow an attacker to take over accounts and access sensitive data.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.