GHSA-fg23-3346-88f5: Langroid: Path traversal in the file tools allows read/write outside configured current directory
Langroid's ReadFileTool and WriteFileTool do not properly restrict file operations to the configured current directory (curr_dir). They change the process working directory to curr_dir but do not validate that file paths remain within this directory, allowing path traversal sequences like '../' to read or write files outside the intended boundary. This can lead to unauthorized reading or modification of files outside the sandbox or project directory. The vulnerability affects versions of Langroid prior to 0.64.0.
AI Analysis
Technical Summary
Langroid's file tools (ReadFileTool and WriteFileTool) assume that changing the process working directory to a configured curr_dir is sufficient to restrict file operations. However, they do not resolve or enforce that the user-supplied file_path remains within curr_dir. This allows an attacker or user controlling the tool arguments to supply path traversal sequences (e.g., '../secret.txt') to read or write files outside the intended directory. A proof-of-concept demonstrated successful reading and writing of files outside the sandbox directory. The vulnerability is relevant when Langroid file tools are exposed in workflows where an LLM agent or user can influence file paths, potentially exposing or modifying sensitive files adjacent to the project directory.
Potential Impact
An attacker or user controlling tool inputs can read arbitrary files outside the intended workspace or project directory, potentially exposing secrets, configuration files, or source code. They can also write files outside the sandbox, potentially modifying files outside the intended boundary. The impact depends on how the application exposes these tools and whether curr_dir is relied upon to restrict file access. There is no indication of unauthenticated remote exploitation by default. The vulnerability affects confidentiality and integrity but not availability.
Mitigation Recommendations
No official patch or fix is currently confirmed. Users should implement path validation by resolving both the base directory (curr_dir) and the target file path, then reject any file paths that escape the base directory before performing read or write operations. This can be done by comparing resolved absolute paths and ensuring the target path is within the base directory. Monitor the vendor advisory for official fixes or updates.
GHSA-fg23-3346-88f5: Langroid: Path traversal in the file tools allows read/write outside configured current directory
Description
Langroid's ReadFileTool and WriteFileTool do not properly restrict file operations to the configured current directory (curr_dir). They change the process working directory to curr_dir but do not validate that file paths remain within this directory, allowing path traversal sequences like '../' to read or write files outside the intended boundary. This can lead to unauthorized reading or modification of files outside the sandbox or project directory. The vulnerability affects versions of Langroid prior to 0.64.0.
CVSS v3.1
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Langroid's file tools (ReadFileTool and WriteFileTool) assume that changing the process working directory to a configured curr_dir is sufficient to restrict file operations. However, they do not resolve or enforce that the user-supplied file_path remains within curr_dir. This allows an attacker or user controlling the tool arguments to supply path traversal sequences (e.g., '../secret.txt') to read or write files outside the intended directory. A proof-of-concept demonstrated successful reading and writing of files outside the sandbox directory. The vulnerability is relevant when Langroid file tools are exposed in workflows where an LLM agent or user can influence file paths, potentially exposing or modifying sensitive files adjacent to the project directory.
Potential Impact
An attacker or user controlling tool inputs can read arbitrary files outside the intended workspace or project directory, potentially exposing secrets, configuration files, or source code. They can also write files outside the sandbox, potentially modifying files outside the intended boundary. The impact depends on how the application exposes these tools and whether curr_dir is relied upon to restrict file access. There is no indication of unauthenticated remote exploitation by default. The vulnerability affects confidentiality and integrity but not availability.
Mitigation Recommendations
No official patch or fix is currently confirmed. Users should implement path validation by resolving both the base directory (curr_dir) and the target file path, then reject any file paths that escape the base directory before performing read or write operations. This can be done by comparing resolved absolute paths and ensuring the target path is within the base directory. Monitor the vendor advisory for official fixes or updates.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-fg23-3346-88f5
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-50181"]
- Ecosystems
- ["PyPI"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a46ecc427e9c7971943d7a8
Added to database: 07/02/2026, 22:57:08 UTC
Last enriched: 07/02/2026, 23:17:41 UTC
Last updated: 07/03/2026, 03:28:57 UTC
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.