CVE-2026-42249
JSON

7.7high

Remote Code Execution in Ollama via Update Mechanism

Severity
7.7high CVSS:4.0 by CERT-PL
Exploit likelihood
1.10% (higher than 66% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
CERT-PL

Description

Ollama for Windows contains a Remote Code Execution vulnerability in its update mechanism due to improper handling of attacker‑controlled HTTP response headers. When downloading updates, the application constructs local file paths using values derived from HTTP headers without validation. These values are passed directly to filepath.Join, allowing path traversal sequences (../) to be resolved and enabling files to be written outside the intended update staging directory. An attacker who can influence update responses can exploit this flaw to write arbitrary executables to attacker‑chosen locations accessible to the current user, including the Windows Startup directory. This allows execution of arbitrary executables. Critically, when chained with CVE‑2026‑42248 (Missing Signature Verification for Updates), an attacker can deliver malicious payloads that are written to sensitive locations and executed automatically. Because Ollama for Windows performs silent automatic updates and executes staged binaries without user interaction, this results in automatic and persistent code execution without user awareness. Maintainers of this project were notified early about this vulnerability, but didn't respond with the details of vulnerability or vulnerable version range. Versions from 0.12.10 to 0.17.5 were tested and confirmed as vulnerable, other versions were not tested but might also be vulnerable.

Affected

Product or packageVersionsReported by
Ollama Ollamafrom 0.12.10 up to 0.17.5CVE List, NVD

All scores

CERT-PL7.7high CVSS:4.0CVSS:4.0/AV:A/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:L/SI:L/SA:L
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-22CWE-494

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

Ollama for Windows contains a Remote Code Execution vulnerability in its update mechanism due to improper handling of attacker‑controlled HTTP response headers. When downloading updates, the application constructs local file paths using values derived from HTTP headers without validation. These values are passed directly to filepath.Join, allowing path traversal sequences (../) to be resolved and enabling files to be written outside the intended update staging directory. An attacker who can influence update responses can exploit this flaw to write arbitrary executables to attacker‑chosen locations accessible to the current user, including the Windows Startup directory. This allows execution of arbitrary executables. Critically, when chained with CVE‑2026‑42248 (Missing Signature Verification for Updates), an attacker can deliver malicious payloads that are written to sensitive locations and executed automatically. Because Ollama for Windows performs silent automatic updates and executes staged binaries without user interaction, this results in automatic and persistent code execution without user awareness. Maintainers of this project were notified early about this vulnerability, but didn't respond with the details of vulnerability or vulnerable version range. Versions from 0.12.10 to 0.17.5 were tested and confirmed as vulnerable, other versions were not tested but might also be vulnerable.

NVD (es)

Ollama para Windows contiene una vulnerabilidad de ejecución remota de código en su mecanismo de actualización debido a un manejo inadecuado de los encabezados de respuesta HTTP controlados por el atacante. Al descargar actualizaciones, la aplicación construye rutas de archivo locales utilizando valores derivados de los encabezados HTTP sin validación. Estos valores se pasan directamente a filepath.Join, permitiendo que las secuencias de salto de ruta (.. / ) se resuelvan y permitiendo que los archivos se escriban fuera del directorio de preparación de actualizaciones previsto. Un atacante que puede influir en las respuestas de actualización puede explotar esta falla para escribir ejecutables arbitrarios en ubicaciones elegidas por el atacante accesibles para el usuario actual, incluyendo el directorio de Inicio de Windows. Esto permite la ejecución de ejecutables arbitrarios. Críticamente, cuando se encadena con CVE?2026?42248 (Verificación de Firma Faltante para Actualizaciones), un atacante puede entregar cargas útiles maliciosas que se escriben en ubicaciones sensibles y se ejecutan automáticamente. Debido a que Ollama para Windows realiza actualizaciones automáticas silenciosas y ejecuta binarios preparados sin interacción del usuario, esto resulta en una ejecución de código automática y persistente sin el conocimiento del usuario. Los mantenedores de este proyecto fueron notificados con antelación sobre esta vulnerabilidad, pero no respondieron con los detalles de la vulnerabilidad o el rango de versiones vulnerables. Las versiones de 0.12.10 a 0.17.5 fueron probadas y confirmadas como vulnerables, otras versiones no fueron probadas pero también podrían ser vulnerables.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-42249 changed 2026-04-29CVE Terms of Use
NVDCVE-2026-42249 changed 2026-11-11Public domain