PyPI: anki

CVE-2024-26020

Safety vulnerability ID: SFTY-20240722-53191

Safety legacy ID: pyup.io-78749

Affected versions of the Anki package are vulnerable to Code Injection due to improper handling of MPV functionality in flashcards. The MPV component processes user-supplied flashcard content without sufficient sanitization, enabling crafted inputs to execute arbitrary scripts. An attacker can exploit this by distributing a specially crafted flashcard to a user—which the Anki application renders via MPV—resulting in arbitrary code execution within the user's context, potentially leading to full system compromise.

Created at: Jul 5, 2026Updated at: Jul 5, 2026

Overview

Ankitects Anki arbitrary script execution vulnerability

Advisory

Affected versions of the Anki package are vulnerable to Code Injection due to improper handling of MPV functionality in flashcards. The MPV component processes user-supplied flashcard content without sufficient sanitization, enabling crafted inputs to execute arbitrary scripts. An attacker can exploit this by distributing a specially crafted flashcard to a user—which the Anki application renders via MPV—resulting in arbitrary code execution within the user's context, potentially leading to full system compromise.

Affected Package

Affecting anki package, versions<24.06

Also affects

---

How to Fix

Upgradeankito24.6or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more