CVE-2026-26030
InMemoryVectorStore 中不受信任的过滤器表达式允许不安全的属性解析,通过 __builtins__ / globals 遍历导致任意 Python 代码执行。
Mohammed Idrees Banyamer
安全研究员
flowchart TD
A[User-controlled filter string] --> B[Passed to VectorStore query/filter]
B --> C[InMemoryVectorStore evaluates filter expression unsafely]
C --> D[Unsafe attribute resolution via __class__ / __base__ / __subclasses__]
D --> E[Access to __init__.__globals__ containing os and __builtins__]
E --> F[Arbitrary code execution e.g. os.system]
F --> G[Remote Code Execution in application context]
style G fill:#ff6666,stroke:#333,stroke-width:2px
描述
传递给 InMemoryVectorStore 的不受信任/用户控制的过滤器表达式会被不安全地求值,允许属性遍历到达 __builtins__、globals,最终访问 os 模块——从而导致任意 Python 代码执行。
重要说明
漏洞利用演示在单独的文件中提供:
exploit.py
# 1. 安装受影响版本(仅用于测试/研究目的!)
pip install semantic-kernel==1.39.0
# 2. 运行 PoC
python3 exploit.py
立即升级至 semantic-kernel >= 1.39.4
使用 InMemoryVectorStore 的应用程序应:
MIT 许可证
版权所有 © 2026 Mohammed Idrees Banyamer