Path TraversalWeakness · CWE-22

CVE-2026-7811

HIGH · 7.3 CVSS v3.1 Published 2026-05-05
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
82/100
Remediation priority · High
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
A vulnerability has been found in 54yyyu code-mcp up to 4cfc4643541a110c906d93635b391bf7e357f4a8. The affected element is the function is_safe_path of the file src/code_mcp/server.py of the component MCP File Handler. Such manipulation leads to path traversal. It is possible to launch the attack remotely. The exploit has been disclosed to the public and may be used. This product takes the approach of rolling releases to provide continious delivery. Therefore, version details for affected and updated releases are not available. The project was informed of the problem early through an issue report but has not responded yet.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · moderate confidence

A path traversal vulnerability exists in the is_safe_path function within src/code_mcp/server.py of the MCP File Handler component. The function fails to properly validate or sanitize file paths, allowing attackers to use path traversal sequences (e.g., '../') to access files outside the intended directory boundaries.

MitigationImplement strict path canonicalization in is_safe_path that resolves paths to absolute form and verifies the resolved path remains within the intended base directory. Consider using os.path.realpath() combined with prefix checking, or implement allowlist-based file access controls.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Locate the MCP File Handler component
    Search for src/code_mcp/server.py file in your installation directory. Check if the 'code_mcp' package or 'MCP File Handler' component is installed in your environment using: pip show code_mcp or find . -path '*/code_mcp/server.py'
    Affected if The file src/code_mcp/server.py exists and contains an is_safe_path function
  2. Verify the is_safe_path function implementation
    Open src/code_mcp/server.py and locate the is_safe_path function. Examine whether it performs path canonicalization using os.path.realpath() or os.path.abspath() and validates the resolved path stays within the intended base directory
    Affected if The is_safe_path function exists but lacks proper path canonicalization and prefix checking (e.g., no os.path.realpath() with base directory validation)
  3. Check for path traversal sequences in file access logic
    Review the is_safe_path function and any related file access code for use of '../' or '..\' sequences. Verify whether the code checks for or strips these sequences before path resolution
    Affected if The function does not sanitize or block path traversal sequences like '../' before processing file paths
  4. Identify if file access allows arbitrary paths
    Search for functions that call is_safe_path and determine if user-supplied paths are passed to file operations (open, os.listdir, etc.) without additional validation
    Affected if File operations accept paths that are only validated by is_safe_path without further restrictions
  5. Confirm the MCP server exposes file handler endpoints
    Check if the MCP server configuration enables file handler functionality. Look for routes or handlers that process file path requests from clients
    Affected if The MCP server has active file handler endpoints that accept path parameters from untrusted sources

You are affected if the MCP File Handler component is installed with the vulnerable is_safe_path function that lacks proper path canonicalization and does not validate resolved paths remain within intended directories.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Implement strict path canonicalization in is_safe_path that resolves paths to absolute form and verifies the resolved path remains within the intended base directory. Consider using os.path.realpath() combined with prefix checking, or implement allowlist-based file access controls.

Recommended fix Moderate confidence
  1. Audit the current implementation of the is_safe_path function in src/code_mcp/server.py to identify the specific path traversal vulnerability
  2. Implement additional path normalization using os.path.realpath() to resolve symlinks and absolute paths
  3. Add validation to ensure the resolved path stays within an allowed base directory
  4. Consider using pathlib.Path with strict resolution to prevent directory escape sequences like ../
  5. Add checks for null bytes and other path injection techniques
  6. Restrict file operations to explicitly allowed directories using allowlist-based validation
  7. If the MCP File Handler is not required, consider disabling or restricting it until a vendor fix is available

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing4.0 h
  • Review / QA2.0 h
18.0 hours of engineering $3,200
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $5,120.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-7811 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-7811 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data