Skip to content

CVE-2026-42249: Ollama Windows Auto-Updater HTTP Header Path Traversal RCE

HERMES

HERMES THREAT SCORE & LOCAL AI RUNTIME TAKEOVER

Target: Ollama for Windows — Background Auto-Update Service & Desktop Staging Engine
Confidence: 96%
92 / 100
CRITICAL

Measures real-world operational relevance, exploit weaponization, and active threat posture.

Dimension Breakdown
Exploitability 18 / 20
Threat Activity 18 / 20
Weaponization 19 / 20
Exposure 19 / 20
Prevalence 19 / 20
Impact 19 / 20
Exploit Maturity 19 / 20
Attack Chain Potential 19 / 20
⚖️ Divergence & Operational Rationale

While NVD rates CVE-2026-42249 in isolation at 7.7 (High), Hermes Threat Score elevates it to 92 (CRITICAL). In operational environments, this vulnerability chains seamlessly with CVE-2026-42248 (complete absence of binary signature verification in the Windows updater). Ollama is installed on millions of developer workstations, data science nodes, and enterprise AI testing systems. By manipulating update headers, attackers drop malicious executables directly into the Windows Startup directory, establishing silent, reboot-persistent execution with developer privileges.

HASS

HASS AGENTIC SEVERITY & AI WORKSTATION PERSISTENCE

Target: Local LLM Inference Engine, Proprietary Weight Repositories & Developer Secrets
Confidence: 92%
72 / 100
HIGH

Measures specific systemic risk arising from autonomy, tool authority, and cascading execution.

Dimension Breakdown
Autonomy 14 / 20
Tool Access 15 / 20
Privilege 16 / 15
Persistence 15 / 15
External Impact 12 / 15
Propagation 14 / 15
⚖️ Divergence & Operational Rationale

Compromising the foundational local inference runtime gives adversaries access to internal model weights, unredacted prompts, and agentic workflows operating on developer endpoints. Attackers can hijack local inference APIs, exfiltrate fine-tuning datasets, and pivot across enterprise source code repositories.

🕸️ Connected Knowledge Graph & Provenance

CVE-2026-42249: Ollama Windows Auto-Updater HTTP Header Path Traversal RCEVULNERABILITY

Connected Nodes: 1
Active Relationships (Outgoing)
→ affectsPRODUCTMicrosoft Windows & Windows Server
98% VERY_HIGH

Software platform affected by security vulnerabilities and agentic attack patterns.

🔍 Why is this related? (Evidence & Provenance)

“Confirmed security vulnerability in Microsoft Windows & Windows Server documented in Hermes dossier.”

Supporting Verified Evidence:

1. Technical Architecture & Exploit Anatomy

Section titled “1. Technical Architecture & Exploit Anatomy”

The Ollama for Windows client runs a background tray monitor (ollama app.exe) that periodically checks the update API endpoint (https://ollama.com/api/update).

┌─────────────────────────┐ ┌─────────────────────────┐
│ Ollama Client │ ──── GET /api/update ─────────> │ Upstream Server / │
│ (Windows Tray App) │ │ Adversary in the Mid │
└────────────┬────────────┘ <─── Malicious HTTP Headers ─── └─────────────────────────┘
│ ETag: "../../../Startup/payload.exe"
│ (Or forged Content-Disposition)
▼
┌─────────────────────────┐
│ File Path Construction │ ──> Constructs path without sanitization:
│ │ C:\Users\<user>\AppData\Local\Ollama\Updates\..\..\
└────────────┬────────────┘ ..\Microsoft\Windows\Start Menu\Programs\Startup\payload.exe
│
│ Drops arbitrary PE executable directly into Startup folder
▼
┌─────────────────────────┐
│ Signature Check Bypass │ ──> CVE-2026-42248: VerifySignature() returns TRUE unconditionally
└────────────┬────────────┘
│
│ User logs on / System reboot occurs
▼
┌─────────────────────────┐
│ Arbitrary Code Exec │ ──> payload.exe runs with interactive user privileges
│ (Persistent RCE) │ Steals API keys, SSH keys, git credentials, model weights
└─────────────────────────┘
ParameterTechnical SpecificationOperational Detail
CVE IdentifierCVE-2026-42249Chained with CVE-2026-42248
Vulnerability ClassPath Traversal (CWE-22) / Insecure Code Download (CWE-494)Directory escape in file write destination
Affected PlatformWindows (x64 / ARM64 builds)macOS & Linux use native isolated updaters
Trigger MechanismBackground HTTP update poll or manual update checkPeriodic check triggered automatically
Exploit VectorMan-in-the-Middle (MitM), poisoned CDN, malicious corporate proxyInjected ETag / Content-Disposition header
Target LocationC:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUpWindows user / system persistence locations
Affected Releases0.12.10 through 0.17.5Confirmed vulnerable by independent researchers
Remediated Release0.17.6+Enforces filepath.Base() and Authenticode verification

2. Root Cause Analysis: Unsanitized Header Concatenation

Section titled “2. Root Cause Analysis: Unsanitized Header Concatenation”

During update staging, Ollama’s Go backend on Windows retrieved the remote file identifier from the HTTP headers and joined it directly with the temporary updates directory:

// Vulnerable path construction in Ollama Windows updater (Go runtime)
// app/lifecycle/updater_windows.go (prior to v0.17.6)
func stageUpdate(resp *http.Response) (string, error) {
// Extract ETag header used as unique cache/file identifier
etag := resp.Header.Get("ETag")
if etag == "" {
etag = "ollama_update.exe"
}
// Strip optional quotes
etag = strings.Trim(etag, "\"")
// CRITICAL FLAW: Direct filepath.Join without verifying that etag does not contain ".."
updateDir := filepath.Join(os.Getenv("LOCALAPPDATA"), "Ollama", "Updates")
destPath := filepath.Join(updateDir, etag)
out, err := os.OpenFile(destPath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0755)
if err != nil {
return "", err
}
defer out.Close()
_, err = io.Copy(out, resp.Body)
return destPath, err
}

Because filepath.Join evaluates .. segments, providing an ETag such as: "../../../../Microsoft/Windows/Start Menu/Programs/Startup/ollama_helper.exe" causes destPath to resolve out of LOCALAPPDATA\Ollama\Updates\ directly into the user’s active startup folder.

The Chained Failure: CVE-2026-42248 (No Authenticode Verification)

Section titled “The Chained Failure: CVE-2026-42248 (No Authenticode Verification)”

Once staged, the client attempted to verify the executable’s Authenticode digital signature before execution. However, in the Windows code path, the verification stub was either commented out during cross-compilation or always returned a success status:

// Stubbed verification in updater_windows.go
func verifySignature(filePath string) error {
// TODO: implement full WinVerifyTrust API bindings
return nil // Insecure bypass: always returns success
}

The updater marked the file as verified and ready for invocation, completing the zero-click RCE chain.


Attack Vector: Compromised Egress / Rogue Local Proxy

Section titled “Attack Vector: Compromised Egress / Rogue Local Proxy”
  1. Network Position: An adversary compromises a local Wi-Fi router (e.g., in a coffee shop, hotel, or corporate guest network) or poisons DNS resolution for ollama.com.
  2. Traffic Interception: The adversary intercepts the plain or TLS-stripped HTTP update check from Ollama for Windows.
  3. Response Crafting: The attacker returns an HTTP 200 response with a forged header:
    HTTP/1.1 200 OK
    Content-Type: application/octet-stream
    ETag: "../../../Microsoft/Windows/Start Menu/Programs/Startup/SecurityHealthSystray.exe"
    Content-Length: 45056
    <Malicious PE Binary Payload>
  4. File Drop: The Ollama background process writes the PE binary into the victim’s Startup folder.
  5. Persistence & Execution: The next time the developer logs in or reboots, Windows Explorer automatically launches SecurityHealthSystray.exe, executing the attacker’s payload.

Forensic analysts investigating potential exploitation of CVE-2026-42249 on Windows developer workstations should analyze the following core artifacts:

Check for unexpected binaries created in the user and system startup folders:

  • %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\
  • %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup\
  • Look for creation timestamps matching Ollama network update activity.
  • Check for prefetch files corresponding to dropped binaries in C:\Windows\Prefetch\. Refer to our Prefetch Forensic Analysis Guide to confirm execution counts and timestamps.
  • Inspect the Windows AppCompatCache (Shimcache) to confirm if the dropped binary executed prior to remediation. See our Shimcache Deep Dive.
  • Event ID 4688 (Process Creation): Search for processes created with ollama app.exe as the parent, or suspicious executables originating from the Startup folder. Refer to our Process Lineage Analysis Guide.
  • Event ID 7045 (Service Creation): If the attacker leveraged access to install a persistent service. See Event 7045 & 4698 Forensics.

title: Ollama Process Dropping Executable into Windows Startup Folder
id: 4f5a6b7c-8d9e-0f1a-2b3c-4d5e6f7a8b9c
status: experimental
description: Detects the Ollama for Windows process writing or dropping PE executables directly into Startup directories, indicative of CVE-2026-42249 exploitation.
references:
- https://hermes-codex.vercel.app/cve/2026/cve-2026-42249/
- https://nvd.nist.gov/vuln/detail/CVE-2026-42249
author: Hermes Codex Tactical Forensics
date: 2026-09-18
logsource:
category: file_event
product: windows
detection:
selection_initiator:
Image|endswith:
- '\ollama app.exe'
- '\ollama.exe'
selection_target:
TargetFilename|contains:
- '\Start Menu\Programs\StartUp\'
- '\Start Menu\Programs\Startup\'
TargetFilename|endswith:
- '.exe'
- '.dll'
- '.bat'
- '.vbs'
- '.ps1'
condition: selection_initiator and selection_target
level: critical
tags:
- attack.persistence
- attack.t1547.001
- cve.2026-42249

  1. Upgrade to Ollama 0.17.6+: Download the latest verified Windows installer from the official repository:
    Terminal window
    winget upgrade Ollama.Ollama
  2. Verify Startup Items: Inspect shell:startup and shell:common startup and remove any unrecognized binaries dropped during recent update checks.
  3. Disable Automatic Updates (Interim Workaround): If upgrading cannot be immediately performed, disable automatic updates in the Ollama configuration or block outbound connections to ollama.com/api/update via Windows Defender Firewall.
  • AppLocker / Windows Defender Application Control (WDAC): Prevent execution of unsigned binaries located in user-writable directories (%LOCALAPPDATA%, StartUp).
  • TLS Inspection & Certificate Pinning: Ensure network inspection tools enforce valid TLS certificates for all developer tooling update endpoints.


  • NVD Vulnerability Record: CVE-2026-42249 Detail
  • Ollama Official Releases: Ollama GitHub Releases
  • Help Net Security: Ollama for Windows Vulnerabilities Enable Remote Code Execution (May 2026)
  • CERT Polska Technical Advisory: Path Traversal in Desktop Client Auto-Updaters (2026)