Ensemble found real bugs in LangChain and Next.js
Verified by follow-up PRs. Click through to check.
Security
langchain-ai/langchain
+337 / -37
6 files
libs/core/langchain_core/prompts/loading.py
+def _validate_path(path: Path) -> None: + if path.is_absolute(): + raise ValueError(f"Path '{path}' is absolute...") + if ".." in path.parts: + raise ValueError(f"Path '{path}' contains '..' ...")
Security Engineer
-
Path validation checks for
..and absolute paths, but does not resolve symlinks viaos.path.realpath(). An attacker can create a symlink pointing outside the allowed directory to bypass both checks.
Confirmed: Fixed in follow-up PR #36585, which added
Path.resolve() before validation.
Confidence Score Breakdown
Finding: "Missing symlink resolution in path validation"
Senior Code Reviewer
→
not flagged (focused on code clarity)
Security Engineer
→
Flagged
"No realpath() — symlink bypass possible"
Architecture Reviewer
→
Flagged
"Path.resolve() should be called first"
2 of 3 reviewers independently flagged this issue
High Confidence
Why this matters
Single agent
"Path validation looks good" → ships with bug
Ensemble
2/3 flagged symlink bypass → blocked before merge
Why 3 reviewers beat 1
Same PR. Same code. Different coverage.
Single Agent
One reviewer runs general-purpose analysis
Finds: "Path validation added for
.. and absolute paths"
Misses: symlink bypass — no
realpath() check
Result
"Looks good to me" ✓ ApprovedConfidence: unknown
Ensemble — 3 Reviewers
Senior: "Code structure looks correct" ✓
Security: "Missing symlink resolution — bypass possible" ⚠
Architecture: "Validation should use
Path.resolve()" ⚠
Result
2/3 flagged an issue → HIGH confidence findingConfidence: HIGH — 67%
Disagreement = signal
Get this on your PRs — install free
Read-only access · Uninstall in one click
Architecture Reviewer
-
When adding the
Actionsuffix heuristic, the existing exception for theresetprop inerror.tsxwas removed. This will cause false TypeScript errors for valid code.
Confirmed: Fixed in #69777, which restored the
reset prop allowlist.
Get this on every PR
Install in 30 seconds. Free for public repos.
Read-only access · Code deleted after review · Uninstall in one click
What you'll see on every PR
Ensemble posts a single comment with findings and confidence scores.
Ensemble Review
3 reviewers · 2 findings · Confidence: HIGH
loading.py:25pathlibconsistentlyloading.py:30Confidence breakdown
Path.resolve()before validation