Studying 0days: How we hacked Anki, the world's most popular flashcard app
Anki versions below 24.06 are vulnerable to multiple exploits via shared decks, including arbitrary file read, cross-site scripting, and remote code execution. An attacker could compromise a user's computer by crafting a malicious deck.
It took us 10 days to go from “We think this might be vulnerable” to full-blown remote code execution, including the 7 days we were both on holiday.
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 insufficient isolation and sanitisation of user-supplied content (JavaScript, LaTeX, and media) in shared decks, allowing code execution outside the intended sandbox.
Impact
An attacker could achieve remote code execution on the victim's machine, potentially leading to full system compromise.
What the attacker needed
Victim uses Anki below 24.06; Victim imports a malicious shared deck; Victim reviews the card
The fix
Upgrade to Anki version 24.06 or later.
How it was found
- Create a malicious flashcard deck containing crafted content (e.g., JavaScript, LaTeX, or media).
- Share the deck with a victim (e.g., via the official sharing site or direct file).
- Victim imports the deck into Anki.
- Victim reviews the card, triggering the exploit.
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.
Anki is a flashcard app where users can share decks of cards. The researchers found that a maliciously crafted deck could run harmful code on the victim's computer when imported or reviewed, because the app did not properly isolate the content of shared decks.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.