A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-7811

CVE-2026-7811: code-mcp Path Traversal Vulnerability

CVE-2026-7811 is a path traversal flaw in code-mcp affecting the is_safe_path function in the MCP File Handler component, allowing remote attackers to access unauthorized files. This article covers technical details, impact, and mitigation.

Published: May 7, 2026

CVE-2026-7811 Overview

CVE-2026-7811 is a path traversal vulnerability in the 54yyyu code-mcp project, an MCP (Model Context Protocol) server implementation. The flaw resides in the is_safe_path function within src/code_mcp/server.py, part of the MCP File Handler component. Attackers can manipulate path inputs to escape the intended directory boundary and access files outside the allowed scope. The vulnerability is exploitable remotely without authentication or user interaction. The project follows a rolling release model, so specific affected and fixed version numbers are not published. The maintainer was notified through an issue report but has not yet responded, and a public exploit disclosure exists.

Critical Impact

Remote attackers can read or write files outside the intended working directory by abusing is_safe_path validation in the MCP File Handler, exposing source code, configuration, and secrets accessible to the MCP server process.

Affected Products

  • 54yyyu code-mcp repository up to commit 4cfc4643541a110c906d93635b391bf7e357f4a8
  • MCP File Handler component in src/code_mcp/server.py
  • Rolling-release distributions of code-mcp (no discrete versioning)

Discovery Timeline

  • 2026-05-05 - CVE-2026-7811 published to NVD
  • 2026-05-05 - Last updated in NVD database

Technical Details for CVE-2026-7811

Vulnerability Analysis

The vulnerability is a path traversal weakness classified under [CWE-22]. The is_safe_path function in src/code_mcp/server.py is intended to validate that file operations remain within an allowed root directory. The validation logic fails to fully canonicalize or constrain user-supplied paths before file access. As a result, attackers can submit crafted path strings containing traversal sequences such as ../ or absolute paths to reach files outside the intended sandbox.

Because code-mcp exposes file operations over the Model Context Protocol, an attacker who can reach the MCP endpoint can leverage standard file-handling tool calls to trigger the flaw. The exploit has been publicly disclosed, increasing the likelihood of opportunistic abuse against exposed instances.

Root Cause

The root cause is insufficient path normalization and boundary checking inside is_safe_path. Safe-path checks that rely on string comparison rather than resolved canonical paths are bypassable through symbolic links, mixed separators, or relative traversal segments. The function returns a permissive result for paths that resolve outside the intended base directory, allowing downstream file operations to act on arbitrary locations on the host filesystem.

Attack Vector

The attack vector is network-based and requires no privileges or user interaction. An attacker invokes an MCP file-handling operation with a path argument containing traversal sequences. The vulnerable validator approves the path, and the MCP server reads or manipulates files outside its working directory. Refer to the GitHub Issue #4 Discussion and VulDB Vulnerability #361071 for additional technical context.

No verified exploit code is reproduced here. The vulnerability mechanism is described in prose only, consistent with the public disclosure in the linked references.

Detection Methods for CVE-2026-7811

Indicators of Compromise

  • MCP request logs containing path arguments with ../, ..\, or URL-encoded traversal sequences such as %2e%2e%2f.
  • File access by the code-mcp process to paths outside its configured project root, including /etc/, user home directories, or SSH key locations.
  • Unexpected reads of sensitive files like .env, id_rsa, or config.json correlated with MCP tool invocations.

Detection Strategies

  • Instrument the MCP server to log every resolved absolute path passed to file read and write handlers and alert on paths outside the project root.
  • Apply static analysis to src/code_mcp/server.py to flag uses of is_safe_path that do not call os.path.realpath before comparison.
  • Hunt for process-level file access anomalies originating from the Python interpreter hosting code-mcp.

Monitoring Recommendations

  • Forward code-mcp application logs and host filesystem audit events to a centralized analytics pipeline for correlation.
  • Monitor outbound responses from the MCP server for unexpectedly large file payloads that may indicate exfiltration.
  • Track network connections to the MCP listener and alert on access from non-allowlisted clients.

How to Mitigate CVE-2026-7811

Immediate Actions Required

  • Restrict network exposure of code-mcp to trusted local clients only and place it behind authenticated transport.
  • Run the MCP server under a dedicated low-privilege user account confined to the intended project directory.
  • Audit recent MCP request logs for traversal patterns and suspicious file access.

Patch Information

No official patch has been released. The maintainer of 54yyyu/code-mcp was notified through GitHub Issue #4 but has not yet responded. Because the project uses rolling releases, users should track the GitHub Code MCP Repository for upstream commits that harden is_safe_path and pin to a known-good commit once available.

Workarounds

  • Replace the is_safe_path implementation locally so it resolves both the candidate path and the base directory with os.path.realpath before performing a commonpath containment check.
  • Reject any input path containing .., null bytes, or absolute path prefixes prior to filesystem operations.
  • Operate code-mcp inside a container or chroot with read-only mounts limited to the intended workspace.
bash
# Configuration example: run code-mcp with filesystem confinement
useradd -r -s /usr/sbin/nologin codemcp
install -d -o codemcp -g codemcp -m 0750 /srv/code-mcp/workspace
systemd-run --uid=codemcp --gid=codemcp \
  --property=ProtectSystem=strict \
  --property=ProtectHome=yes \
  --property=ReadWritePaths=/srv/code-mcp/workspace \
  --property=PrivateTmp=yes \
  /usr/bin/python -m code_mcp.server --root /srv/code-mcp/workspace

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/Tech54yyyu

  • SeverityMEDIUM

  • CVSS Score5.5

  • EPSS Probability0.05%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-22
  • Technical References
  • GitHub Code MCP Repository

  • GitHub Issue #4 Discussion

  • VulDB Submission #807751

  • VulDB Vulnerability #361071

  • VulDB CTI for #361071
  • Latest CVEs
  • CVE-2024-8261: Prolizyazilim OBS Auth Bypass Vulnerability

  • CVE-2024-13068: LimonDesk Auth Bypass Vulnerability

  • CVE-2025-53679: Fortinet FortiSandbox RCE Vulnerability

  • CVE-2026-9446: Simple POS Inventory System SQLi Flaw
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English