Path Traversal in langroid (CVE-2026-50181)
Summary
Path traversal in langroid (CVE-2026-50181). Confidential information can be exposed externally. Exploitable via ReadFileTool. Mitigation: upgrade to 0.64.0 or later.
Original description
The description as published by the source.
Summary
Langroid's ReadFileTool and WriteFileTool appear to treat curr_dir as the intended working-directory boundary for file operations. However, the tools only change the process working directory to curr_dir and then operate on the user-supplied file_path without resolving and enforcing that the final path remains inside curr_dir.
As a result, a tool caller can supply path traversal sequences such as ../secret.txt to read files outside the configured current directory, or ../written_by_tool.txt to write files outside that directory.
This can impact applications that expose Langroid file tools to an LLM agent, user-controlled tool call, or delegated coding/documentation agent while relying on curr_dir to restrict file access to a project/workspace directory.
Details
Affected components:
langroid/agent/tools/file_tools.pylangroid/utils/system.py
Relevant behavior observed:
ReadFileTool contains a comment indicating the intended assumption:
# ASSUME: file_path should be relative to the curr_dir
The tool then changes into the configured current directory and calls read_file(self.file_path).
WriteFileTool similarly resolves curr_dir, changes into that directory, and calls create_file(self.file_path, self.content).
The issue is that changing the process working directory does not prevent traversal. A path such as ../secret.txt is still valid and resolves outside the configured curr_dir.
In local testing, ReadFileTool suc…
Source: GitHub Security Advisories (Global) NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-50181 has been found in langroid.
Attackers can target a specific entry point like ReadFileTool over the network to misuse the product.
Confidential information can be exposed externally. CVSS score: 7.1/10.
What to do: upgrade langroid to 0.64.0 or later.
If unsure, ask your IT team or search "langroid CVE-2026-50181" on the vendor's site.
CVE-2026-50181 (langroid) — CWE-22 / CVSS v3 7.1
Attack vector: local / no user interaction
Attack surface: ReadFileTool / WriteFileTool / curr_dir / file_path
Patched: 0.64.0 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
Path traversal (CWE-22) exists in langroid. Attackers reach the vulnerable code path via ReadFileTool.
Check the vendor advisory for the affected versions of langroid. Attack surface: ReadFileTool / WriteFileTool / curr_dir / file_path.
Severity: High (CVSS 7.1/10). Confidential information can be exposed externally.
Update to 0.64.0.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'langroid' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'langroid' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
langroidを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade langroid to 0.64.0ステージング環境で 0.64.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- package github.com
- web github.com
- web github.com
- web github.com