Skip to content
XSS Advisory Intermediate CVE-2024-32484

Ankitects Anki Flask Invalid Path Reflected Cross-Site Scripting (XSS) vulnerability

A reflected cross-site scripting vulnerability in Anki's Flask server allows a malicious flashcard to execute JavaScript in an authorised context, bypassing API access controls. This enables an attacker to read arbitrary files from the victim's system and exfiltrate them.

Autumn Bee Skerritt Follow

Originally disclosed on Cisco Talos

High 7.4 View original

An reflected XSS vulnerability exists in the handling of invalid paths in the Flask server in Ankitects Anki 24.04. A specially crafted flashcard can lead to JavaScript code execution and result in an arbitrary file read.

Autumn Bee Skerritt, on Cisco Talos

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 report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The Flask server reflects the requested path into an error page without sanitising it, allowing script injection.

Impact

An attacker could read arbitrary files from the victim's system and exfiltrate them, but the exploit requires the victim to review a malicious card.

What the attacker needed

Victim imports and reviews a malicious flashcard

The fix

The vulnerability was fixed in a vendor patch release.

How it was found

  1. Create a flashcard containing JavaScript that adds a hidden iframe pointing to a crafted URL.
  2. The URL path begins with /_anki/pages/ and includes an XSS payload.
  3. When the card is reviewed, the iframe loads and the reflected XSS executes in an authorised context.
  4. Use the API to call addImageOcclusionNote with a path to a sensitive file, which copies it to the media folder.
  5. Read the file via the media server and send its contents to the attacker.

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 report has not been written yet. The Original tab links to the source.

Anki is a flashcard app that runs a small web server on your computer. A malicious flashcard can trick that server into running harmful JavaScript code, which can then read files on your computer and send them to an attacker.

What is XSS?

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

More by Autumn Bee Skerritt

View all

3 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

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.