Defog-AI Introspect Code Injection Vulnerability in Analysis Execution Function

Vulnerability

A critical code injection vulnerability has been identified in Defog-AI Introspect versions through 0.1.4. The issue arises in the 'execute_analysis_code_safely' function within 'introspect/backend/tools/analysis_tools.py'. This function executes user-provided code using the 'exec' function, which can be exploited by crafting malicious input. The vulnerability allows attackers to manipulate libraries included in the execution namespace, potentially leading to unauthorized actions such as reading sensitive files or modifying system configurations.

Impact

Exploitation of this vulnerability allows for arbitrary code execution within the context of the application's execution environment, potentially leading to unauthorized access to sensitive information or system resources.

Reproduction

To reproduce this vulnerability, call the 'execute_analysis_code_safely' function and pass a string of malicious code as the 'code' argument. The injected code will be executed in a namespace that includes access to several libraries, such as 'pandas', 'numpy', and 'json'. For example, code could be crafted to use 'pandas' to read sensitive files like '/etc/passwd'.

Remediation

Users are advised to update to the patched version of Defog-AI Introspect, which is available in the GitHub repository.

Added: Jun 9, 2025, 7:46 PM
Updated: Jun 9, 2025, 7:46 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
7.5
exploitability
6.6
remediation
0.0
relevance
0.0
threat
6.4
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.