Skip to content
XSS Write-up Intermediate

Privilege Escalation via SVG Injection in Silverpeas 6.4.2

A user could attach an SVG file containing a script to a public calendar event, and when an administrator opened the attachment the script ran in the application's origin. The script read the anti-CSRF token from a publicly reachable JavaScript file and used it to submit a forged request that created a new account with administrator rights.

medium.com

Published on medium.com

Create a stealthy client-side XSS-based privilege escalation by abusing SVG scripting capabilities to forge a new Admin account, leveraging a stolen anti-CSRF token (X-STKN).

Mingihongkim, on medium.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 application allowed uploaded SVG files to be served and rendered with scripting enabled, and exposed the anti-CSRF token in a publicly readable JavaScript file, so a script running in the same origin could forge an authenticated admin-creation request.

Impact

An attacker could gain full administrative access by creating a new admin-level account, though the author notes that browser protections such as CORS or Referrer Policy may block the forged request in some configurations.

What the attacker needed

Attacker has a user account; victim is an administrator; victim opens the SVG attachment; SVG uploads are allowed unsanitised

The fix

The application should enforce a strict Content Security Policy that blocks inline scripts, sanitise or disallow SVG uploads, stop exposing anti-CSRF tokens in client-side JavaScript, and validate Origin and Referer server-side on sensitive actions.

How it was found

  1. The attacker creates a new calendar event in the My Diaries section.
  2. The attacker gives the event a clickbait title, sets visibility to Public and severity to High, and adds the admin as an attendee.
  3. The attacker attaches an SVG file containing a script to the event.
  4. The admin logs in, sees the event on the welcome page and opens it.
  5. The admin clicks the SVG attachment, which opens in a new tab and runs the script.
  6. The script steals the anti-CSRF token and posts a forged request that creates a new administrator account.

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.

The application lets people upload pictures in a format called SVG, which can secretly contain small programs. When the administrator opened the picture, that hidden program ran with the administrator's logged-in session and quietly created a second administrator account for the attacker. The site also handed out its anti-forgery secret in a file anyone could read, so the fake request looked legitimate.

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.