Categories
CVE-2026-50181 high CVSS 7.1

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.py
  • langroid/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.

❓ What is the problem

Path traversal (CWE-22) exists in langroid. Attackers reach the vulnerable code path via ReadFileTool.

📍 Affected scope

Check the vendor advisory for the affected versions of langroid. Attack surface: ReadFileTool / WriteFileTool / curr_dir / file_path.

🔥 Severity

Severity: High (CVSS 7.1/10). Confidential information can be exposed externally.

🔧 How to fix

Update to 0.64.0.

🛡️ Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

🔍 Detection

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

  1. 1
    Identify exposure identify
    grep -r 'langroid' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で langroid を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply patch patch
    Upgrade langroid to 0.64.0

    ステージング環境で 0.64.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

pip langroid
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.64.0"}]}]
PyPI langroid
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.64.0"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details