Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

langchain-ai/langchain
master @ 57c83d4
76
Fixes
45
CVEs
CRITICAL
Peak severity
43.8%
Coverage
Highlights
SSRF: 15 prior fixes. Scrutinize any change in this area.
libs/experimental/langchain_experimental/pal_chain/base.py: most-fixed (4 issues). Treat as high-risk during review.
51 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Remote Code Execution: The PALChain engine repeatedly suffered from sandbox escapes because attackers used hidden python attributes and AST-walking bypasses to execute arbitrary code via python's executive pathways. Multiple fixes iteratively blocked access to compilation and inner-method structures.
Insecure Deserialization: Overly broad dynamic load validation permitted attackers to bypass serialization escape rules, allowing them to construct unauthorized namespaces and classes that led to arbitrary code execution during parsing.
Server-Side Request Forgery: Connecting LLM-driven requests to local networks and cloud metadata IP ranges led to several SSRF bypasses, requiring complex address validation normalization (e.g., handling IPv6-mapped IPv4, specific local subnets, and modern cloud ranges).