Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

GHSA-fg23-3346-88f5: Langroid: Path traversal in the file tools allows read/write outside configured current directory

0
High
Published: 07/02/2026 (07/02/2026, 17:38:03 UTC)
Source: GCVE Database
Product: langroid

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

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N

Affected software

PyPIghsa
langroid
Affected versions
<0.64.0

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

AILast updated: 07/02/2026, 23:17:41 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses