Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2025-62185

CVE-2025-62185: Ankitects Anki RCE Vulnerability

CVE-2025-62185 is a remote code execution vulnerability in Ankitects Anki where malicious shared decks can deploy YouTube downloader executables that run automatically. This article covers technical details, affected versions, and mitigation.

Published:

CVE-2025-62185 Overview

CVE-2025-62185 affects Ankitects Anki versions prior to 25.02.5. A crafted shared deck can drop a YouTube downloader executable into the media folder. Anki then executes that binary when the user opens a YouTube link contained in the deck. The executable name can be youtube-dl.exe, yt-dlp.exe, or yt-dlp_x86.exe. This behavior stems from mpv's built-in youtube-dl integration, which resolves the downloader binary from the working directory before falling back to PATH. The issue is tracked as an untrusted search path weakness [CWE-427].

Critical Impact

An attacker distributing a malicious shared deck can achieve local code execution in the user's context by planting a downloader binary that Anki launches automatically.

Affected Products

  • Ankitects Anki versions before 25.02.5
  • Windows installations where .exe binaries in the media folder are loadable
  • Users who import shared decks containing YouTube links

Discovery Timeline

  • 2025-10-07 - CVE-2025-62185 published to the National Vulnerability Database (NVD)
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-62185

Vulnerability Analysis

Anki embeds the mpv media player to render audio and video referenced by flashcards. By default, mpv includes a youtube-dl hook that shells out to a youtube-dl or yt-dlp binary when it encounters a streaming URL. mpv locates that binary using an untrusted search path, meaning the current working directory (the Anki media folder) is checked before system paths.

A shared deck is distributed as an .apkg archive that unpacks user-controlled files into the collection's media folder. If the archive contains youtube-dl.exe, yt-dlp.exe, or yt-dlp_x86.exe, that binary lands in the media folder. When the user reviews a card that references a YouTube URL, mpv invokes the downloader and executes the attacker-supplied binary with the user's privileges.

Root Cause

The root cause is that Anki launched mpv without disabling its youtube-dl integration. mpv's binary resolution logic is subject to CWE-427 (Uncontrolled Search Path Element), so any executable named like a supported downloader in the working directory is loaded ahead of trusted system binaries.

Attack Vector

Exploitation requires the victim to import an attacker-crafted shared deck and then review a card containing a YouTube link. Attack complexity is low, but user interaction is required for the initial import and playback. The impact is local code execution in the account context that runs Anki.

python
# Patch: qt/aqt/mpv.py - pass --no-ytdl so mpv never invokes youtube-dl/yt-dlp
         "--keep-open=no",
         "--autoload-files=no",
         "--gapless-audio=no",
+        "--no-ytdl",
     ]
 
     if is_win:
# Source: https://github.com/ankitects/anki/commit/5080451829505842b16d4a50f398ad44560a3e48
python
# Patch: qt/aqt/sound.py - same --no-ytdl flag applied to the sound playback path
             "--keep-open=no",
             "--input-media-keys=no",
             "--autoload-files=no",
+            "--no-ytdl",
         ]
     )
# Source: https://github.com/ankitects/anki/commit/5080451829505842b16d4a50f398ad44560a3e48

Detection Methods for CVE-2025-62185

Indicators of Compromise

  • Presence of youtube-dl.exe, yt-dlp.exe, or yt-dlp_x86.exe inside an Anki collection.media folder
  • mpv.exe spawning any of the above executables as a child process
  • Recently imported .apkg files containing bundled Windows executables

Detection Strategies

  • Alert on process creation events where the parent is anki.exe or mpv.exe and the child image resides under a user profile's Anki media directory
  • Flag archive extraction events that write PE files (MZ header) into collection.media paths
  • Hunt for outbound network activity initiated by binaries executing from Anki media folders

Monitoring Recommendations

  • Enable command-line auditing on Windows endpoints to capture arguments passed to mpv.exe, including any --ytdl or downloader path references
  • Inventory installed Anki versions across the environment and compare against 25.02.5
  • Correlate deck import telemetry with subsequent file writes and process launches in the media folder

How to Mitigate CVE-2025-62185

Immediate Actions Required

  • Upgrade all Anki installations to version 25.02.5 or later
  • Delete any youtube-dl.exe, yt-dlp.exe, or yt-dlp_x86.exe files found in existing collection.media folders
  • Restrict deck imports to trusted sources and review shared decks before distribution to end users

Patch Information

Ankitects addressed the vulnerability in commit 5080451 by adding the --no-ytdl flag to the mpv invocations in qt/aqt/mpv.py and qt/aqt/sound.py. This prevents mpv from resolving or executing any youtube-dl or yt-dlp binary regardless of where it resides. Review the fix in the Anki 25.02.4 to 25.02.5 comparison and the security commit 5080451.

Workarounds

  • Manually inspect and remove downloader binaries from every Anki media folder before opening decks that contain YouTube links
  • Block execution of youtube-dl.exe, yt-dlp.exe, and yt-dlp_x86.exe from user-writable paths using application control policies such as Windows Defender Application Control (WDAC) or AppLocker
  • Prevent Anki from launching child processes located under the user profile by applying an endpoint policy that constrains anki.exe and mpv.exe
bash
# Example AppLocker publisher rule denying yt-dlp/youtube-dl from user paths
New-AppLockerPolicy -RuleType Path -User Everyone -Action Deny \
  -Path "%LOCALAPPDATA%\Anki2\*\collection.media\yt-dlp*.exe"
New-AppLockerPolicy -RuleType Path -User Everyone -Action Deny \
  -Path "%LOCALAPPDATA%\Anki2\*\collection.media\youtube-dl.exe"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.