langgraph-agent-patterns
Warn
Audited by Socket on Feb 14, 2026
1 alert found:
SecuritySecurityscripts/visualize_graph.py
MEDIUMSecurityMEDIUM
scripts/visualize_graph.py
The file itself is a non-malicious utility for generating Mermaid diagrams from Python graph objects, but it intentionally performs in-process execution of an arbitrary Python file via importlib.spec.loader.exec_module. That behavior makes the tool capable of executing arbitrary code contained in the target module (and any code run during graph.get_graph() or attribute access), which is a severe supply-chain / code-execution risk if the module is untrusted. Use only with trusted modules or run within a sandbox. The code is not obfuscated and contains no direct hardcoded malicious payloads, but the design enables powerful malicious actions when paired with a malicious target module.
Confidence: 90%Severity: 80%
Audit Metadata