GHSA-cw6h-ffmh-x6vh: Anki User Scripts Vulnerability

MODERATE
CVSS 6.5
CWE-22
Published
Advisory Summary

GHSA-cw6h-ffmh-x6vh is a MODERATE (CVSS 6.5) user scripts vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Anki libraries in the PyPI ecosystem. The issue involves user scripts in iframes have access to the internal anki api. Remediation is available by upgrading affected packages to version 25.9.4.

GHSA-cw6h-ffmh-x6vh at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-cw6h-ffmh-x6vh
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Anki
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.5

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:U/C:H/I:N/A:N).

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

How to Fix GHSA-cw6h-ffmh-x6vh

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.

aqt fixed: 25.9.4
pip install aqt>=25.9.4
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 aqt

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-cw6h-ffmh-x6vh, inspect your installed packages using pip:

pip show aqt

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 25.9.4), your application is affected.

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. 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

## Summary Anki's webview-based pages communicate with the Rust backend using an internal localhost API. Anki implements measures to prevent user scripts run in the reviewer/editor from accessing this API (https://github.com/ankitects/anki/pull/3925) but it inadvertently allows access to scripts included via iframes in the editor. While overall only a limited set of API methods are exposed, some such as `getImageForOcclusion` can read arbitrary files. **CWE:** CWE-22 (Path Traversal) **Reporter:** Bankde (Eakasit) ## Affected Products | Ecosystem | Package | Affected Versions | | --------- | ------- | ----------------- | | PyPI | `aqt` | `<= 25.09.3` | ## Impact Any desktop Anki user (Windows, macOS, Linux) who imports an untrusted `.apkg` and views card with an embedded iframe is vulnerable. No special configuration is required. The attacker can read any file accessible to the Anki process and exfiltrate its contents over the network. ## Patches A patch is available in 25.09.4 ## Workarounds - Do not import `.apkg` files from untrusted sources. - Inspect `.apkg` contents (it's a ZIP) for `.html`/`.svg` files with `<script>` tags before importing. - Block unexpected outbound network requests from the Anki process at the firewall level. ## References - Vulnerability report: _Anki arbitrary file read vulnerability (with exfiltration)_ — Bankde (Eakasit) - Affected source: [`qt/aqt/mediasrv.py::_handle_local_file_request`](https://github.com/ankitects/anki/blob/5a9b54e9380c66e26391f0827867d2a728107836/qt/aqt/mediasrv.py#L223) - Related prior CVEs: [CVE-2024-29073](https://nvd.nist.gov/vuln/detail/CVE-2024-29073), [CVE-2024-32484](https://nvd.nist.gov/vuln/detail/CVE-2024-32484), [CVE-2025-62185](https://nvd.nist.gov/vuln/detail/CVE-2025-62185), [CVE-2025-62187](https://nvd.nist.gov/vuln/detail/CVE-2025-62187)

GHSA-cw6h-ffmh-x6vh Affected Anki Versions

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

References

Frequently Asked Questions

What is GHSA-cw6h-ffmh-x6vh?
GHSA-cw6h-ffmh-x6vh is a security vulnerability in Anki involving User scripts in iframes have access to the internal Anki API under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Anki versions are affected?
Affected versions include releases prior to 25.9.4 across affected packages: aqt.
What version fixes GHSA-cw6h-ffmh-x6vh?
Upgrading to 25.9.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is aqt affected?
Yes, aqt is affected in releases prior to 25.9.4. Upgrade your dependency to 25.9.4 or later.
What is the CVSS score of GHSA-cw6h-ffmh-x6vh?
GHSA-cw6h-ffmh-x6vh has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N.
What CWE is associated with GHSA-cw6h-ffmh-x6vh?
GHSA-cw6h-ffmh-x6vh is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check PyPI dependencies for GHSA-cw6h-ffmh-x6vh?
Run the dependency tree command: 'pip show aqt'. 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-cw6h-ffmh-x6vh",
  "modified" : "2026-06-19T22:10:19Z",
  "published" : "2026-06-19T22:10:19Z",
  "aliases" : [ ],
  "summary" : "Anki: User scripts in iframes have access to the internal Anki API",
  "details" : "## Summary\n\nAnki's webview-based pages communicate with the Rust backend using an internal localhost API. Anki implements measures to prevent user scripts run in the reviewer/editor from accessing this API (https://github.com/ankitects/anki/pull/3925) but it inadvertently allows access to scripts included via iframes in the editor. While overall only a limited set of API methods are exposed, some such as `getImageForOcclusion` can read arbitrary files.\n\n**CWE:** CWE-22 (Path Traversal)\n**Reporter:** Bankde (Eakasit)\n\n## Affected Products\n\n| Ecosystem | Package | Affected Versions |\n| --------- | ------- | ----------------- |\n| PyPI      | `aqt`   | `<= 25.09.3`      |\n\n## Impact\n\nAny desktop Anki user (Windows, macOS, Linux) who imports an untrusted `.apkg` and views card with an embedded iframe is vulnerable. No special configuration is required. The attacker can read any file accessible to the Anki process and exfiltrate its contents over the network.\n\n## Patches\n\nA patch is available in 25.09.4\n\n## Workarounds\n\n- Do not import `.apkg` files from untrusted sources.\n- Inspect `.apkg` contents (it's a ZIP) for `.html`/`.svg` files with `<script>` tags before importing.\n- Block unexpected outbound network requests from the Anki process at the firewall level.\n\n## References\n\n- Vulnerability report: _Anki arbitrary file read vulnerability (with exfiltration)_ — Bankde (Eakasit)\n- Affected source: [`qt/aqt/mediasrv.py::_handle_local_file_request`](https://github.com/ankitects/anki/blob/5a9b54e9380c66e26391f0827867d2a728107836/qt/aqt/mediasrv.py#L223)\n- Related prior CVEs: [CVE-2024-29073](https://nvd.nist.gov/vuln/detail/CVE-2024-29073), [CVE-2024-32484](https://nvd.nist.gov/vuln/detail/CVE-2024-32484), [CVE-2025-62185](https://nvd.nist.gov/vuln/detail/CVE-2025-62185), [CVE-2025-62187](https://nvd.nist.gov/vuln/detail/CVE-2025-62187)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "aqt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "25.9.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 25.9.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ankitects/anki/security/advisories/GHSA-cw6h-ffmh-x6vh"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ankitects/anki"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-19T22:10:19Z",
    "nvd_published_at" : null
  }
}