Skip to content

Security: Dynamic import and callable selection from config allows attacker-controlled code execution#732

Open
tuanaiseo wants to merge 1 commit intoalan-turing-institute:mainfrom
tuanaiseo:contribai/fix/security/dynamic-import-and-callable-selection-fr
Open

Security: Dynamic import and callable selection from config allows attacker-controlled code execution#732
tuanaiseo wants to merge 1 commit intoalan-turing-institute:mainfrom
tuanaiseo:contribai/fix/security/dynamic-import-and-callable-selection-fr

Conversation

@tuanaiseo
Copy link
Copy Markdown

Problem

AutoPlumber/DataPlumber import modules and resolve classes/functions from config fields (import, model, class, func.call) and invoke them. A malicious config can point to dangerous modules or attacker-installed code, resulting in arbitrary code execution.

Severity: high
File: src/scivision/io/autoplumber.py

Solution

Validate config against a strict schema and allowlist of permitted modules/classes/functions; disallow arbitrary import paths; isolate plugin execution in a sandboxed process with least privilege.

Changes

  • src/scivision/io/autoplumber.py (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

…config

`AutoPlumber`/`DataPlumber` import modules and resolve classes/functions from config fields (`import`, `model`, `class`, `func.call`) and invoke them. A malicious config can point to dangerous modules or attacker-installed code, resulting in arbitrary code execution.

Affected files: autoplumber.py

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant