Vulnerabilities in pkg:pypi/anki

PACKAGE
Advisory Identifier: GHSA-9gq7-p5w9-w899
Advisory Summary

CVE-2024-26020 is a HIGH (CVSS 9.6) ankitects anki arbitrary script execution vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Anki libraries in the PyPI ecosystem. The issue involves ankitects anki arbitrary script execution vulnerability. Remediation is available by upgrading affected packages to version 24.06.

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/anki

3 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/anki. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-9gq7-p5w9-w899 CVE-2024-26020 HIGH Ankitects Anki arbitrary script execution vulnerability
GHSA-x3r6-ccvq-cf5v CVE-2024-29073 MODERATE Anki Latex Incomplete Blocklist Vulnerability
GHSA-q47p-v5rw-v574 CVE-2024-32152 LOW Ankitects Anki LaTeX Blocklist Bypass vulnerability

CVE-2024-26020 at a Glance

CVE Identifier CVE-2024-26020
GHSA Identifier GHSA-9gq7-p5w9-w899
Severity HIGH
CVSS v3.1 Base Score 9.6
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product Anki
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-26020

To remediate this vulnerability, upgrade all affected Anki dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

anki fixed: 24.06
pip install anki>=24.06
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show anki

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2024-26020, inspect your installed packages using pip:

pip show anki

Analyze the terminal output to locate any version of Anki in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 24.06), your application is affected.

Note: The pip show anki command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Anki, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

An arbitrary script execution vulnerability exists in the MPV functionality of Ankitects Anki 24.04. A specially crafted flashcard can lead to a arbitrary code execution. An attacker can send malicious flashcard to trigger this vulnerability.

CVE-2024-26020 Affected Anki Versions

1 component(s)
Fixed Versions:
24.06
Product / Package Ecosystem Affected Versions Fixed Version
anki
PyPI
< 24.06
24.06

References

Frequently Asked Questions

What is CVE-2024-26020?
CVE-2024-26020 is a security vulnerability in Anki involving Ankitects Anki arbitrary script execution vulnerability under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which Anki versions are affected?
Affected versions include releases prior to 24.06 across affected packages: anki.
What version fixes CVE-2024-26020?
Upgrading to 24.06 (or the latest patched release for your respective branch) resolves the vulnerability.
Is anki affected?
Yes, anki is affected in releases prior to 24.06. Upgrade your dependency to 24.06 or later.
What is the CVSS score of CVE-2024-26020?
CVE-2024-26020 has a CVSS v3.1 base score of 9.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2024-26020?
CVE-2024-26020 is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.).
How can I check PyPI dependencies for CVE-2024-26020?
Run the dependency tree command: 'pip show anki'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9gq7-p5w9-w899",
  "modified" : "2025-11-04T19:49:07Z",
  "published" : "2024-07-22T15:32:41Z",
  "aliases" : [ "CVE-2024-26020" ],
  "summary" : "Ankitects Anki arbitrary script execution vulnerability",
  "details" : "An arbitrary script execution vulnerability exists in the MPV functionality of Ankitects Anki 24.04. A specially crafted flashcard can lead to a arbitrary code execution. An attacker can send malicious flashcard to trigger this vulnerability.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "anki"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "24.06"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-26020"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ankitects/anki/commit/8d2e8b1e4fa3757581f224b1a57057d0455352ce"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ankitects/anki"
  }, {
    "type" : "WEB",
    "url" : "https://skerritt.blog/anki-0day"
  }, {
    "type" : "WEB",
    "url" : "https://skii.dev/anki-0day"
  }, {
    "type" : "WEB",
    "url" : "https://talosintelligence.com/vulnerability_reports/TALOS-2024-1993"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-25T18:27:59Z",
    "nvd_published_at" : "2024-07-22T15:15:02Z"
  }
}