PulseAugur
实时 09:35:08
English(EN) sympy.parse_expr will run os.system if you let it. Here's the AST gate that stopped me from shipping the RCE.

开发者发现 SymPy 的 parse_expr 函数存在 RCE 漏洞

一位开发者在 `sympy.parse_expr` 函数中发现了一个关键的安全漏洞,如果未得到妥善保护,可能允许任意代码执行。该函数默认使用 Python 的 `eval()`,继承了 `os.system` 等内置函数,这些函数可以通过伪装成数学公式的恶意输入来触发。为了缓解此问题,开发者实现了一个抽象语法树 (AST) 验证层,在 `sympy` 处理输入之前预先过滤掉潜在的危险构造,确保只允许安全的数学运算。 AI

影响 强调了在将 LLM 与代码执行环境集成时,安全输入解析的至关重要性。

排序理由 发现特定软件函数中的安全漏洞。

在 dev.to — MCP tag 阅读 →

AI 生成摘要 · Google Gemini · 来自 1 个来源。 我们如何撰写摘要 →

开发者发现 SymPy 的 parse_expr 函数存在 RCE 漏洞

报道来源 [1]

  1. dev.to — MCP tag TIER_1 English(EN) · kyb8801 ·

    sympy.parse_expr will run os.system if you let it. Here's the AST gate that stopped me from shipping the RCE.

    <h1> sympy.parse_expr will run os.system if you let it. Here's the AST gate that stopped me from shipping the RCE. </h1> <p>I was building an MCP server that accepts a measurement formula as a string from an LLM, parses it with sympy, and evaluates it via Monte Carlo. Five minute…