Skip to content
XSS Write-up Intermediate

SmartStoreNET - Malicious Message leading to E-Commerce Takeover

Two stored cross-site scripting bugs in SmartStoreNET's BBCode processing allowed an attacker to inject attributes into an anchor tag via a crafted private message or forum post. When an administrator viewed the message, the injected script could create a new admin account and upload a malicious plugin, leading to arbitrary code execution.

blog.sonarsource.com

Published on blog.sonarsource.com

SmartStoreNET is the leading open-source e-commerce platform for .NET, which makes it suitable for companies running Windows Server. Next to the operation of an online business, it offers advanced features, such as CRM tools, a blog and a forum.

The author, on blog.sonarsource.com

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 BBCode helper first HTML-encodes user input but then applies regular-expression replacements that insert unencoded quotes, allowing an attacker to break out of an attribute and add new ones.

Impact

A successful attack against an administrator could lead to compromise of the e-commerce store and interception of financial transactions and personal data, with arbitrary code execution under the IIS user.

What the attacker needed

A registered forum account; victim is an administrator; victim opens the message or post

The fix

The vulnerabilities were fixed by adding a final HTML sanitisation step using the HtmlSanitizer library on the rendered message and post text.

How it was found

  1. Register on the SmartStoreNET forum and open the private message or forum post composer.
  2. Craft a message using tangled [url] BBCode tags that inject a style attribute and an event handler into the generated anchor tag.
  3. Send the message to an administrator.
  4. When the administrator opens the message, the injected event handler runs and fetches a larger script from an attacker-controlled server.
  5. The fetched script creates a new administrator account via a POST request to /admin/customer/create.
  6. The attacker logs in as the new administrator and uploads a malicious NuGet plugin to execute arbitrary code.

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.

Cross-site scripting (XSS) is a bug where a website shows user-supplied text as if it were part of the page's code, so an attacker can make the victim's browser run their script. Here, the site tried to clean up forum messages but then transformed them again, which undid the cleaning. An admin who simply opened a private message could have their browser silently create a new admin account for the attacker.

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.