Skip to content

Instantly share code, notes, and snippets.

@Ro1ME
Last active September 26, 2026 04:40
Show Gist options
  • Select an option

  • Save Ro1ME/6cc410b487a2374fdd9e8749621f3135 to your computer and use it in GitHub Desktop.

Select an option

Save Ro1ME/6cc410b487a2374fdd9e8749621f3135 to your computer and use it in GitHub Desktop.
CVE-2026-51898 - Code Injection in pandas-ai (code_executor.py:CodeExecutor.execute)

CVE-2026-51898

Type: Code Injection Product: pandas-ai Affected versions: 3.0.0 Affected component: pandasai/core/code_execution/code_executor.py:CodeExecutor.execute Suggested CWE: CWE-94 (Code Injection) Reference: sinaptik-ai/pandas-ai#1893

Description

sinaptik-ai pandas-ai 3.0.0 is vulnerable to Code Injection in CodeExecutor.execute.

Reproduction Notes (condensed, sanitized)

Condensed from the authorized local validation used for the original report; local filesystem paths are replaced with <local-path>.

EXPECTED SUCCESSFUL RESULT:

  • A marker file (poc_marker.txt) is created on the host file system
  • The file contains the expected marker content
  • This demonstrates that LLM-generated code executed with full host access ROOT CAUSE:
  • Source anchor: pandasai/core/code_execution/code_executor.py:27 (CodeExecutor.execute)
  • LLM-generated code is executed directly using Python's exec() without sandbox isolation
  • Default configuration (sandbox=None) provides no protection against arbitrary code execution
  • No validation or sanitization of generated code before execution SECURITY IMPACT:
  • Arbitrary file system access (read/write/delete)
  • Command execution via subprocess or os.system
  • Network access and data exfiltration …

Discoverer

Ro1ME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment