VAITP Dataset

← Back to the dataset

CVE-2026-113731

Path traversal in djust MCP tool allows local file existence oracle.

  • CVSS 3.3
  • CWE-22
  • Information Leakage
  • Local

djust provides Phoenix LiveView-style reactive server-side rendering for Django with Rust-powered performance. From 0.9.0 until 1.0.10, 1.1.7, 1.2.4, and 1.3.0rc8, the find_handlers_for_template MCP tool in python/djust/mcp/server.py accepts an existing absolute template_path and reads it without restricting the resolved path to the project or configured template directories. A local MCP client can use the tool as a file existence and readability oracle and can obtain substrings that match the tool's dj-click, dj-submit, dj-change, dj-input, dj-keydown, or dj-keyup attribute pattern from files readable by the djust process. The maintainer assessment states that the MCP server communicates over local stdio as the same operating-system user and has no network listener, and the tool does not return arbitrary raw file contents. This issue is fixed in versions 1.0.10, 1.1.7, 1.2.4, and 1.3.0rc8.

CVSS base score
3.3
Published
2026-10-20
OWASP
A04 Insecure Design
Orthogonal defect classification
Interface
Code defect classification
Missing Check
Category
Information Leakage
Subcategory
Information Disclosure
Accessibility scope
Local
Impact
Information Disclosure
Affected component
djust
Fixed by upgrading
Yes

Solution

Upgrade djust to version 1.3.0rc8 or any later release that includes the fix.

Vulnerable code sample

import os

class MCPServer:
    def __init__(self, template_root):
        self.template_root = os.path.abspath(template_root)

    def find_handlers_for_template(self, template_path):
        # VULNERABLE: reads arbitrary absolute path without restriction
        abs_path = os.path.abspath(template_path)
        with open(abs_path, 'r', encoding='utf-8') as f:
            content = f.read()
        return self._extract_dj_attrs(content)

    def _extract_dj_attrs(self, content):
        # Simplified regex extraction placeholder
        return []  # implementation omitted

Patched code sample

import os

class MCPServer:
    def __init__(self, template_root):
        self.template_root = os.path.abspath(template_root)

    def find_handlers_for_template(self, template_path):
        # FIX: restrict path to the configured template root
        abs_path = os.path.abspath(template_path)
        if not os.path.commonpath([self.template_root, abs_path]) == self.template_root:
            raise ValueError("Template path outside allowed directory")
        with open(abs_path, 'r', encoding='utf-8') as f:
            content = f.read()
        return self._extract_dj_attrs(content)

    def _extract_dj_attrs(self, content):
        # Simplified regex extraction placeholder
        return []  # implementation omitted

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

Cite this entry

@misc{vaitp:cve2026113731,
  title        = {{Path traversal in djust MCP tool allows local file existence oracle.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-113731},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-113731/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.