CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-61431

CVE-2026-61431: Arbitrary Local File Read and Path Traversal in PraisonAI ContextGatherer

Amit Schendel
Amit Schendel
Senior Security Researcher

Oct 8, 2026·6 min read·18 visits

Executive Summary (TL;DR)

A check-after-use path traversal vulnerability in PraisonAI's ContextGatherer allows unauthorized reading of sensitive local host files.

PraisonAI is vulnerable to an arbitrary local file read vulnerability prior to version 4.6.78. The flaw is in the ContextGatherer component, where validation checks are executed only after files are parsed and appended to the context bundle, bypassing security constraints.

Vulnerability Overview

PraisonAI is an open-source framework designed to orchestrate multi-agent artificial intelligence systems and streamline the assembly of codebases for LLM context windows. In versions prior to 4.6.78, the platform exposes an arbitrary local file read vulnerability via its context gathering subsystem. This component is designed to scan directories and bundle codebase files to populate large language model context windows.

The vulnerability is categorized as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory / 'Path Traversal') and CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor). It resides in the ContextGatherer component within src/praisonai/praisonai/ui/context.py. When parsing configuration files such as .praisoncontext or .praisoninclude, the application fails to restrict paths to the designated workspace root.

An attacker can exploit this flaw by submitting malicious configuration files with absolute paths or directory traversal sequences. When the context compilation routine is triggered, these external files are parsed and appended to the context output bundle. This occurs because the safety boundaries are verified only after the files have been successfully read into memory.

Root Cause Analysis

The root cause of CVE-2026-61431 lies in a check-after-use logic flaw within the file collection routine of the ContextGatherer class. When compiling context, the class processes user-specified inclusion lists from configuration files like .praisoncontext. The application relies on Python's os.path.join() function to combine the workspace root directory with user-supplied paths.

In Python, if one of the arguments to os.path.join() is an absolute path, all previous components are discarded, and the absolute path is returned. For example, joining /app with /etc/passwd returns /etc/passwd directly. This behavior allows attackers to completely bypass the intended workspace directory structure.

The helper function add_file_content() executes an immediate read operation using open(file_path, 'r') on the resolved path. Once read, the content is immediately appended to the local context accumulation list. The boundary safety check is only executed after this append operation, via the Path(file_path).relative_to(self.directory) call.

If the path lies outside the root directory, relative_to() throws a ValueError exception. However, because this validation check is wrapped in a broad try-except block designed to catch general reading errors, the resulting exception is caught and logged as a simple warning. The execution flow continues without removing the unauthorized file content that was already appended to the context list, culminating in information disclosure.

Code Analysis

The vulnerability resides in src/praisonai/praisonai/ui/context.py before version 4.6.78. The vulnerable path resolution and inclusion logic allowed unrestricted file reads.

# Vulnerable Code Structure (Prior to v4.6.78)
def add_file_content(file_path):
    """Helper function to add file content to context."""
    try:
        # Step 1: The file is opened and read immediately
        with open(file_path, 'r', encoding='utf-8') as f:
            content = f.read()
            # Step 2: Content is appended to the context list
            context.append(
                f"File: {file_path}\n\n{content}\n\n{'=' * 50}\n"
            )
            # Step 3: Validation occurs AFTER the read and append
            # If file_path is not relative to self.directory, ValueError is raised
            self.included_files.append(
                Path(file_path).relative_to(self.directory)
            )
    except Exception as e:
        # Step 4: The ValueError is caught here, but the appended content is not removed
        logger.error(f"Error reading {file_path}: {e}")

To correct this flaw, the maintainers implemented a safe path resolution helper _resolve_include_path() in commit 393de394087e3badc79acfec490323bcc99638bd. This helper ensures that all target paths are properly sanitized and verified to reside within the designated workspace directory prior to any reading operations.

# Patched Code Structure (v4.6.78)
def _resolve_include_path(self, include_path: str) -> Optional[str]:
    """Resolve an include path and keep it within the project directory."""
    if os.path.isabs(include_path):
        candidate = os.path.expanduser(include_path)
    else:
        candidate = os.path.join(self.directory, include_path)
    
    base = os.path.realpath(self.directory)
    resolved = os.path.realpath(os.path.normpath(candidate))
    
    try:
        # Validate that the resolved path starts with the base path
        if os.path.commonpath([resolved, base]) != base:
            logger.warning("Skipping include outside project root: %s", include_path)
            return None
    except ValueError:
        logger.warning("Skipping include outside project root: %s", include_path)
        return None
    return resolved

Exploitation Methodology

Exploitation of CVE-2026-61431 relies on local or repository-level vectors where an attacker can introduce a malicious configuration file. The primary prerequisite is that the victim must execute the PraisonAI context gathering mechanism on a workspace containing these configuration files.

The attack sequence begins with the placement of a .praisoncontext or .praisoninclude file within the root of a target project directory. Within this configuration file, the attacker defines absolute paths such as /etc/passwd or relative directory traversal sequences such as ../../../../etc/shadow.

When a user runs the context generation tool using commands like praisonai context or triggers UI-based context consolidation, the application processes the configuration. It reads the files specified, appends their content, and generates a final context.txt file or feeds the context directly to an LLM provider. Although error messages will appear in the output console, the resulting file contains the fully exfiltrated contents of the requested local files.

Impact Assessment

The security impact of CVE-2026-61431 is classified as High for Confidentiality. Because the context gathering component executes with the privileges of the running PraisonAI process, any file readable by that system user can be accessed and compiled into the LLM context.

This vulnerability can lead to the disclosure of sensitive host files, including environment variables, API tokens, database credentials, ssh keys, and system files. If PraisonAI is deployed in cloud or containerized environments, exposure of container service tokens or configurations could lead to subsequent privilege escalation or infrastructure compromise.

The CVSS v3.1 vector is rated as 5.5 (Medium): CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N. Under CVSS v4.0, the vulnerability scores 6.8 (Medium): CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N. The requirement for user interaction (loading and compiling a malicious repository) keeps the severity score moderate, though the impact of successful exploitation remains high.

Remediation and Mitigation

The primary remediation strategy for CVE-2026-61431 is upgrading the praisonai and praisonaiagents packages to version 4.6.78 or later. The update introduces robust input validation and path isolation checks that prevent arbitrary file inclusion.

# Upgrade packages using pip
pip install --upgrade praisonai praisonaiagents

For environments where an immediate upgrade is not feasible, administrators and developers must enforce strict workspace hygiene. Avoid running PraisonAI utilities within repositories or directories obtained from untrusted sources, and manually inspect .praisoncontext and .praisoninclude files for unexpected paths prior to execution.

Additionally, running the PraisonAI runtime environment inside a minimally privileged container containerized or sandbox environment is highly recommended. Restricting the container's file system access ensures that even if a path traversal occurs, the impact is isolated from the host operating system.

Fix Analysis (2)

Technical Appendix

CVSS Score
6.8/ 10
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
EPSS Probability
0.35%
Top 73% most exploited

Affected Systems

PraisonAIPraisonAIAgents

Affected Versions Detail

Product
Affected Versions
Fixed Version
praisonai
MervinPraison
< 4.6.784.6.78
praisonaiagents
MervinPraison
< 4.6.784.6.78
AttributeDetail
CWE IDCWE-22 / CWE-200
Attack VectorLocal
CVSS Score6.8
Exploit StatusProof-of-Concept
CISA KEV StatusNo
ImpactInformation Disclosure

MITRE ATT&CK Mapping

T1083File and Directory Discovery
Discovery
T1005Data from Local System
Collection
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The product uses external input to construct a pathname that is intended to identify a file or directory that is located under a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

Known Exploits & Detection

GitHub Security AdvisoryGHSA publication highlighting local path traversal through malicious context configurations.

Vulnerability Timeline

Vulnerability reported and advisory published
2026-02-18
Patched release v4.6.78 pushed to public registries
2026-02-18

References & Sources

  • [1]GitHub Security Advisory GHSA-q7m5-3jmv-vm48
  • [2]Fix Commit 393de394087e3badc79acfec490323bcc99638bd
  • [3]Fix Commit 1620b49f36945d8cc8ee5635b906c960df5097a0
  • [4]VulnCheck Advisory for PraisonAI Path Traversal
  • [5]CVE-2026-61431 Record

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•1 day ago•CVE-2026-58254
6.5

CVE-2026-58254: Authorization Bypass in NATS Server Message Tracing for Leaf Node Connections

NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.

Alon Barad
Alon Barad
6 views•10 min read
•1 day ago•CVE-2026-63341
7.5

CVE-2026-63341: Unauthenticated Denial of Service via Unbounded Topic Depth in Aedes MQTT Broker

CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.

Alon Barad
Alon Barad
14 views•12 min read
•1 day ago•CVE-2026-61725
6.1

CVE-2026-61725: Path Traversal and Arbitrary File Overwrite in sevenz-rust2

CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.

Alon Barad
Alon Barad
6 views•12 min read
•1 day ago•CVE-2026-77309
8.8

CVE-2026-77309: Unauthenticated Remote Code Execution in NASA-AMMOS AIT-GUI via Incomplete File Cleanup and Path Traversal

CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.

Amit Schendel
Amit Schendel
13 views•10 min read
•1 day ago•CVE-2026-77332
2.3

CVE-2026-77332: Surfaced-Memory Envelope Injection and Stored Prompt Injection in memtomem-stm

A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.

Alon Barad
Alon Barad
15 views•10 min read
•1 day ago•CVE-2026-77331
2.0

CVE-2026-77331: Race Condition and Session State Corruption in memtomem-stm

CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.

Amit Schendel
Amit Schendel
8 views•9 min read