Skip to navigation

Threat reportVulnerabilityTL-2026-3051

CVE-2026-103663: Ollama /api/pull path traversal (digestToPath) enables unauthenticated remote file write and root RCE

highPATCHED

CERT Polska reports that Ollama's /api/pull endpoint is vulnerable to relative path traversal (CWE-23) because the digestToPath function insufficiently validates layer digests. An unauthenticated remote attacker can write a malicious binary outside the model store; if the server can write to /usr/lib/ollama, the file is loaded and executed on the next restart, giving remote code execution as root.

Key facts

IdentifiersTL-2026-3051, CVE-2026-103663, CVE-2026-7020
SeverityHIGH
First disclosed
EPSSCVE-2026-7020: 0.9% (58.4th percentile); CVE-2026-103663: 0.7% (52.3th percentile)
Affected productsOllama Ollama
Weaknesses (CWE)CWE-23
ToolsOllama
MITRE ATT&CK techniquesT1059 Command and Scripting Interpreter, T1190 Exploit Public-Facing Application, T1574 Hijack Execution Flow, T1595.002 Vulnerability Scanning
MotivationUNKNOWN
Target sectorstechnology, research, ai-ml, enterprise
Target regionsGlobal
Detection rules9 (1 shown free)
Sources8 cited sources

Detection coverage

As of 2026-10-08, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-3051 across Splunk SPL, Microsoft KQL and Sigma, covering 9 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.

Free detection: Non-Package-Manager Write to /usr/lib/ollama (Planted Binary in Ollama Load Path)

Detects file create/modify/rename activity under /usr/lib/ollama by any process other than a package manager. CVE-2026-103663 lets a remote attacker place a malicious binary in this directory via /api/pull; it is loaded and executed on the next Ollama restart, giving root code execution. Writes by the ollama process itself are the strongest indicator and are escalated.

  • Languages: Splunk SPL, Microsoft KQL, Sigma
  • ATT&CK: T1574, T1105
  • Data sources: linux:audit, auditd, DeviceFileEvents, sysmon_for_linux
  • Severity: critical
  • Confidence: high

Splunk SPL

index=linux sourcetype="linux:audit" type=SYSCALL key="ollama_lib" success=yes earliest=-24h
```Requires auditd rule: -w /usr/lib/ollama -p wa -k ollama_lib```
| where NOT match(exe, "/(dpkg|apt|apt-get|rpm|dnf|yum|zypper)$")
| eval ollama_process=if(match(exe, "/ollama$"), 1, 0), severity=if(match(exe, "/ollama$"), "critical", "high")
| stats count AS writes min(_time) AS first_seen max(_time) AS last_seen values(syscall) AS syscalls values(comm) AS comm values(auid) AS auid values(uid) AS uid max(ollama_process) AS written_by_ollama BY host exe severity
| convert ctime(first_seen) ctime(last_seen)
| sort - written_by_ollama

Microsoft KQL

DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType in ('FileCreated', 'FileModified', 'FileRenamed')
| where FolderPath startswith '/usr/lib/ollama/'
| where InitiatingProcessFileName !in~ ('dpkg', 'apt', 'apt-get', 'rpm', 'dnf', 'yum', 'zypper')
| extend WrittenByOllama = InitiatingProcessFileName =~ 'ollama'
| project Timestamp, DeviceName, ActionType, FolderPath, FileName, SHA256, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessAccountName, WrittenByOllama
| order by WrittenByOllama desc, Timestamp desc

Sigma

title: Non-Package-Manager File Write Under /usr/lib/ollama
id: 1a8f6c40-92d7-4e53-a0b1-6c7d8e9f0404
status: experimental
description: Detects file creation or modification under /usr/lib/ollama by a process that is not a package manager. CVE-2026-103663 allows a remote attacker to plant a binary in this directory through /api/pull; it is loaded and executed when Ollama next restarts, yielding root code execution.
references:
    - https://cert.pl/en/posts/2026/10/CVE-2026-103663/
author: Threadlinqs Team
date: 2026-10-08
tags:
    - attack.persistence
    - attack.privilege-escalation
    - attack.defense-evasion
    - attack.t1574
    - attack.command-and-control
    - attack.t1105
    - cve.2026-103663
logsource:
    category: file_event
    product: linux
detection:
    selection:
        TargetFilename|startswith: '/usr/lib/ollama/'
    filter_pkg:
        Image|endswith:
            - '/dpkg'
            - '/apt'
            - '/apt-get'
            - '/rpm'
            - '/dnf'
            - '/yum'
            - '/zypper'
    condition: selection and not filter_pkg
falsepositives:
    - Configuration management or image build tooling that deploys Ollama libraries outside the package manager
    - Administrators manually installing GPU runtime libraries
level: high

Known false positives:

  • Ansible, Puppet or image-build tooling that installs Ollama libraries outside the package manager
  • Administrators manually installing GPU runtime libraries

Tuning notes: Deploy the auditd watch rule (-w /usr/lib/ollama -p wa -k ollama_lib). For Docker, audit the container filesystem or use a container runtime sensor, since host auditd sees overlay paths. Add your configuration-management executables to the exclusion list. Treat any write by the ollama process as an incident.

8 more detection rules (Splunk SPL, Microsoft KQL, Sigma) · unlock with TL Creds. Sign up free to unlock the detection rules or query them with the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account)
  • Unauthenticated Ollama [indicator] Request from Non-Internal Source - Exposure and Exploitation Attempt · unlock with TL Creds
  • Ollama Process Writing Files Outside Its Model Store (Out-of-Store File Write) · unlock with TL Creds
  • Ollama Spawning Shell or Download/Reverse-Shell Utility (Post-Exploitation Execution) · unlock with TL Creds
  • External Fingerprinting of Exposed Ollama API (Reconnaissance Before CVE-2026-103663 Exploitation) · unlock with TL Creds
  • Process Executed from [indicator] (Planted Binary Executed After Restart) · unlock with TL Creds
  • Ollama Process Initiating Outbound Connection on Non-Standard Port (Post-Exploitation Callback) · unlock with TL Creds
  • Ollama [indicator] Path Traversal Sequence in Layer Digest (CVE-2026-103663) - Exploitation · unlock with TL Creds
  • Ollama Server Restart Following Non-Package-Manager Write to [indicator] · unlock with TL Creds

Indicators of compromise

As of 2026-10-08, Threadlinqs Intelligence tracks 9 indicators of compromise for TL-2026-3051.

9 indicators of compromise · unlock with TL Creds. Compare plans

Technical analysis

CERT Polska published advisory CVE-2026-103663 on 2026-10-08 for Ollama, the open-source local LLM runtime. The /api/pull endpoint (used to download model layers) passes layer digests to the digestToPath function, which does not sufficiently validate them. An unauthenticated remote attacker can supply a traversal sequence as a layer digest so that a malicious binary is written outside the model store (CWE-23, Relative Path Traversal).

The advisory states that if the Ollama server process can write to /usr/lib/ollama - the default in most Ollama Docker images - the planted file is loaded and executed on the next server restart, yielding remote code execution as root. Exploitation is therefore a two-stage chain: an arbitrary file write via /api/pull, followed by code execution that is triggered by a restart of the service rather than immediately.

Affected versions are stated as 'from 0.34.2 to 0.35.0' with the issue fixed in 0.35.0; the advisory wording overlaps (0.35.0 appears in both), so the fixed version is taken as 0.35.0 and defenders should confirm against vendor release notes. The upstream GitHub release notes for v0.34.x/v0.35.0 (v0.35.0 released 28 Sep) do not mention a security fix. The advisory gives no CVSS score, no in-the-wild exploitation, no public PoC and no IOCs; the HIGH severity here is an analyst estimate from the stated impact (unauthenticated network RCE), not a source-provided score. Credit: Bartlomiej Dmitruk (striga.ai).

Context: the same function name appears in earlier Ollama findings. CVE-2026-7020 (VulDB, disclosed 2026-04-26) describes path traversal via the digest argument of digestToPath in x/imagegen/transfer/transfer.go, affecting versions up to 0.20.2 and fixed in 0.20.3. The older Probllama flaw (CVE-2024-37032, Wiz) was likewise a digest-field traversal reachable through /api/pull that led to RCE, and Wiz noted Ollama ships without built-in authentication and, in Docker, runs as root and listens on 0.0.0.0. These are separate CVEs; no source links CVE-2026-103663 to either.

MITRE ATT&CK techniques by tactic:

Execution

T1059 Command and Scripting Interpreter

Initial Access

T1190 Exploit Public-Facing Application

stealth

T1574 Hijack Execution Flow

Reconnaissance

T1595.002 Vulnerability Scanning

Remediation

Patches

  • Ollama 0.35.0 (fixed version stated by CERT Polska)

Immediate actions

  • Upgrade Ollama to 0.35.0 or later and confirm the fixed version against vendor release notes
  • Do not expose the Ollama API (default port 11434) to untrusted networks; restrict /api/pull to trusted clients or place it behind an authenticating reverse proxy
  • Audit /usr/lib/ollama and the model store for unexpected binaries or files with recent modification times

Workarounds

  • Make /usr/lib/ollama non-writable by the Ollama server process so the planted binary cannot be placed in the loaded path
  • Block or filter requests to /api/pull from untrusted sources at the proxy or firewall

Longer-term hardening

  • Run Ollama as a non-root user and keep /usr/lib/ollama read-only to the service account
  • Add file-integrity monitoring on /usr/lib/ollama and alert on writes by the Ollama process outside the model directory
  • Inventory internet-facing Ollama instances and Docker images that run the server as root

Affected and fixed versions

  • Ollama — Ollama
    Vulnerable versions: 0.34.2 through 0.35.0 (as stated; range overlaps the fixed version)
    Fixed in: 0.35.0

Timeline

  • Related CVE-2026-7020 (VulDB) disclosed: path traversal via the digest argument of digestToPath in locked-ioc-1, Ollama up to 0.20.2, fixed in 0.20.3
  • Ollama v0.34.0 released (GitHub release listing; year inferred from the advisory context)
  • Ollama v0.34.2 released - the first version in the affected range stated by CERT Polska
  • Ollama v0.34.4 released; release notes do not mention a security fix
  • Ollama v0.35.0 released; named by CERT Polska as the fixed version (release notes do not mention the security fix)
  • CERT Polska publishes advisory CVE-2026-103663 (CWE-23), crediting Bartlomiej Dmitruk of striga.ai for the responsible report

Sources cited

Previous and next in vulnerability

Drafted by the Threadlinqs research pipeline from 8 sources; published ; last updated —.

Threadlinqs Intelligence — Real-Time Threat Detection Platform

// threat_feed
$ sort --newest
Showing all threats

Live intelligence console

Threat level

Latest Threats