Skip to content

[HIGH] ValidatePath does not resolve symlink targets before allowing project-root file access #141

Description

@Daliys

Problem

ValidatePath uses Path.GetFullPath and claims it handles symlinks, but GetFullPath only normalizes path syntax. It does not resolve filesystem symlink/junction targets.

Evidence

  • Editor/MCPServerMethods.Utils.cs:40-46 calls Path.GetFullPath(cleanPath) and checks the resulting string starts with the project root.
  • The comment says this handles symlinks, but .NET path normalization does not resolve symlink targets.
  • File tools then operate on the returned path.

Impact

A symlink inside the project can point outside the project root. A path such as Assets/link_to_home/.ssh/id_rsa can pass the lexical project-root check while file I/O follows the symlink outside the project.

Suggested fix

Resolve real filesystem targets before allowing read/write, or explicitly reject symlink/junction traversal under project roots for file operations. Update the misleading comment either way.

Source report

Imported from audit report item: security (15) / Editor/MCPServerMethods.Utils.cs:24.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageImported or reported issue awaiting owner reviewpriority: highMajor broken workflow or broad compatibility failuresurface: assetAssetDatabase, asset paths, imports, moves, and deletessurface: json-rpcRaw JSON-RPC methods, schemas, or dispatch surfacetype: securitySecurity vulnerability or unsafe trust boundary

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions