Ankitects Anki LaTeX Blocklist Bypass vulnerability
Anki's LaTeX blocklist can be bypassed using hex character encoding to call blocked commands, allowing an attacker to create a file with arbitrary content in a fixed temporary directory. A malicious shared flashcard can trigger this file creation.
Originally disclosed on Cisco Talos
A blocklist bypass vulnerability exists in the LaTeX functionality of Ankitects Anki 24.04. A specially crafted malicious flashcard can lead to an arbitrary file creation at a fixed path.
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 blocklist checks for literal command names but does not account for TeX's hex character encoding, so blocked commands can be written using hex escapes.
Impact
An attacker could create a file with arbitrary content at a fixed path in the application's temporary directory, but only if the victim opens a malicious flashcard and has MiKTeX installed.
What the attacker needed
Victim has MiKTeX installed; victim opens a malicious flashcard
The fix
The blocklist should be improved to detect hex-encoded commands, and the vendor released a patch.
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 can display LaTeX, a typesetting system. It tries to block dangerous LaTeX commands with a list, but you can write those commands using hexadecimal codes to sneak past the list. This lets someone create a file on your computer when you open a shared flashcard.
What is File upload?
An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.