6.5medium
Anki: User scripts in iframes have access to the internal Anki API
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.17% (higher than 6% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-cw6h-ffmh-x6vh
Description
Anki is a program for creating and reviewing flashcards. Prior to 25.09.4, Anki's webview-based pages communicate with the Rust backend using an internal localhost API, and user scripts included via iframes in the editor can access this API despite protections intended to block reviewer and editor scripts. A malicious imported card package with an embedded iframe can use exposed API methods such as getImageForOcclusion to read arbitrary files accessible to the Anki process and exfiltrate them over the network. This issue is fixed in version 25.09.4.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| ankitects anki | < 25.09.4 | CVE List |
| aqt (PyPI) | before 25.9.4 | GitHub Advisory Database |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N |
| GitHub | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N |
Classification
What each source says
CVE List
Anki is a program for creating and reviewing flashcards. Prior to 25.09.4, Anki's webview-based pages communicate with the Rust backend using an internal localhost API, and user scripts included via iframes in the editor can access this API despite protections intended to block reviewer and editor scripts. A malicious imported card package with an embedded iframe can use exposed API methods such as getImageForOcclusion to read arbitrary files accessible to the Anki process and exfiltrate them over the network. This issue is fixed in version 25.09.4.
GitHub Advisory Database
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
.apkgfiles from untrusted sources. - Inspect
.apkgcontents (it's a ZIP) for.html/.svgfiles 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 - Related prior CVEs: CVE-2024-29073, CVE-2024-32484, CVE-2025-62185, CVE-2025-62187
NVD (es)
Anki es un programa para crear y revisar tarjetas de memoria. Anteriormente a la 25.09.4, las páginas de Anki basadas en webview se comunican con el backend de Rust utilizando una API interna de localhost, y los scripts de usuario incluidos a través de iframes en el editor pueden acceder a esta API a pesar de las protecciones destinadas a bloquear los scripts del revisor y del editor. Un paquete de tarjetas importado malicioso con un iframe incrustado puede usar métodos de API expuestos como getImageForOcclusion para leer archivos arbitrarios accesibles al proceso de Anki y exfiltrarlos a través de la red. Este problema se corrigió en la versión 25.09.4.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-58266 changed 2026-07-08 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-cw6h-ffmh-x6vh changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2026-58266 changed 2026-10-25 | Public domain |