-
Notifications
You must be signed in to change notification settings - Fork 15.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
experimental[major]: CVE-2024-46946 fix #26783
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
"exp": sympy.exp, | ||
"log": sympy.log, | ||
"ln": sympy.log, # natural log (alias) | ||
"log10": sympy.log, # log base 10 (use sympy.log) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both log10 and ln are aliased to sympy.log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed so that log would be a user defined base (default 10), ln will be regular sympy log which defaults to ln. And log 10 to base 10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Would you be able to check the issue with log10 vs. ln?
libs/experimental/langchain_experimental/llm_symbolic_math/base.py
Outdated
Show resolved
Hide resolved
@mercyspirit I'm going to make the fix backwards compatible for users that are using this code for prototyping since this fix will break a lot of functionality otherwise. |
This PR resolves this discussion: #26720. |
Description: Resolve CVE-2024-46946 by switching out sympify with parse_expr with a very specific allowed set of operations. https://nvd.nist.gov/vuln/detail/cve-2024-46946 Sympify uses eval which makes it vulnerable to code execution. parse_expr is limited to specific expressions. Bandit results ![image](https://github.com/user-attachments/assets/170a6376-7028-4e70-a7ef-9acfb49c1d8a) --------- Co-authored-by: aqiu7 <[email protected]> Co-authored-by: Eugene Yurtsev <[email protected]> Co-authored-by: Eugene Yurtsev <[email protected]>
Description: Resolve CVE-2024-46946 by switching out sympify with parse_expr with a very specific allowed set of operations.
https://nvd.nist.gov/vuln/detail/cve-2024-46946
Sympify uses eval which makes it vulnerable to code execution. parse_expr is limited to specific expressions.
Bandit results