CVE-2024-26020 Overview
CVE-2024-26020 is an arbitrary script execution vulnerability in the MPV media player functionality of Ankitects Anki 24.04. A specially crafted flashcard can trigger arbitrary code execution when processed by the application. Attackers deliver the malicious flashcard to a victim, who then imports or opens it within Anki. The flaw is classified as [CWE-74] (Improper Neutralization of Special Elements in Output Used by a Downstream Component) and affects the integration between Anki and the embedded MPV player.
Critical Impact
A crafted flashcard can execute arbitrary code on the victim's system with the privileges of the Anki user, enabling full host compromise after a single user interaction.
Affected Products
- Ankitects Anki 24.04
- Installations using the bundled MPV media player component
- Windows, macOS, and Linux desktop builds based on the 24.04 release
Discovery Timeline
- 2024-07-22 - CVE-2024-26020 published to NVD
- 2025-11-04 - Last updated in NVD database
- Vulnerability documented by Cisco Talos in advisory TALOS-2024-1993
Technical Details for CVE-2024-26020
Vulnerability Analysis
The flaw resides in how Anki passes flashcard-derived input to the MPV media player. Anki invokes MPV to render audio and video referenced from flashcards. MPV accepts command-line style options that control playback behavior, including options capable of loading external scripts or executing commands. When flashcard content reaches MPV without sufficient sanitization, attacker-controlled values are interpreted as MPV directives rather than playback parameters. The result is arbitrary script execution within the context of the user running Anki.
Exploitation requires user interaction. The victim must open or review a flashcard delivered through shared decks, AnkiWeb synchronization, email, or other distribution channels. Anki's deck-sharing ecosystem makes flashcard distribution a practical delivery vector.
Root Cause
The root cause is improper neutralization of special characters and option-like tokens before they are handed to MPV. Flashcard fields function as a downstream sink that controls a separate process. Without strict validation of media references and player arguments, untrusted card data influences MPV's command interpretation and can reach script-loading or shell-invocation directives.
Attack Vector
The attack vector is network delivery with required user interaction. An attacker hosts or shares a malicious deck containing crafted flashcards. The victim imports the deck and reviews the affected card. Anki invokes MPV with attacker-influenced arguments, and the embedded payload executes. The execution inherits the victim's user privileges, allowing data theft, persistence, or lateral movement.
Technical details and proof-of-concept analysis are documented in the Talos Intelligence Vulnerability Report.
Detection Methods for CVE-2024-26020
Indicators of Compromise
- Anki process (anki.exe, anki) spawning mpv with unusual command-line arguments referencing scripts, configuration files, or shell commands
- MPV child processes that in turn launch shells (cmd.exe, powershell.exe, /bin/sh, bash) or scripting interpreters
- Imported .apkg deck files from untrusted sources, especially those received shortly before suspicious child process activity
- Outbound network connections initiated by Anki or MPV to previously unseen domains
Detection Strategies
- Hunt for parent-child process chains where anki spawns mpv followed by interpreter or shell processes
- Alert on MPV command lines containing --script, --input-ipc-server, --scripts, or other directives loading external code
- Monitor file write events in user profile and temp directories that originate from the Anki process tree
Monitoring Recommendations
- Enable command-line argument logging on endpoints running Anki to capture MPV invocations
- Forward Anki and MPV process telemetry to a centralized analytics platform for retroactive hunting
- Track imports of .apkg and .colpkg files in user download directories and correlate with subsequent process activity
How to Mitigate CVE-2024-26020
Immediate Actions Required
- Upgrade Anki to a version released after 24.04 that addresses the MPV argument handling flaw
- Block import of flashcard decks sourced from untrusted users or third-party sharing sites
- Restrict execution of mpv invoked from Anki using application control or AppLocker policies until patched
- Review recently imported decks for suspicious media references or embedded directives
Patch Information
Apply the latest Anki release from the Ankitects download page. Refer to the Talos Intelligence Vulnerability Report for vendor coordination details and fixed version information.
Workarounds
- Disable audio and video playback in Anki preferences to prevent MPV invocation
- Remove or rename the bundled mpv binary in environments where media playback is not required
- Limit Anki to decks created in-house and disable AnkiWeb synchronization with untrusted shared decks
- Run Anki under a low-privilege user account isolated from sensitive data and credentials
# Example: restrict execution of mpv launched from Anki on Linux via AppArmor profile snippet
deny /usr/bin/mpv ix,
deny /usr/bin/bash x,
deny /usr/bin/sh x,
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

