GAIR-NLP factool Code Injection Vulnerability in the Python Executor Class
Vulnerability
A critical code injection vulnerability has been identified in GAIR-NLP factool versions prior to 3f3914bc090b644be044b7e0005113c135d8b20f. The issue arises in the 'run_single' function of 'factool/factool/math/tool.py', where user-provided input is executed without proper validation, allowing for malicious code execution. This vulnerability must be exploited locally.
Impact
Exploitation of this vulnerability allows for arbitrary code execution on the local machine where the vulnerable version of factool is running.
Reproduction
To reproduce this vulnerability, load the affected version of GAIR-NLP factool and navigate to the 'python_executor' class. The 'run_single' method can be called with a 'program' parameter that contains unvalidated Python code. This code will be executed by the 'exec()' function, leading to code injection. The same 'program' can be executed again in the 'run_single' method, amplifying the impact.
Vulnerability Rating
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.
