Severity:

HIGH RISK

(7.3)

Path Traversal in duartium papers-mcp-server search_papers

CVE-2026-7205

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized File System Access

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal vulnerability in the search_papers function of duartium papers-mcp-server allows attacker-controlled input in the topic argument to influence filesystem paths.

When reachable over the network, this can enable remote attackers to traverse directories and potentially access or manipulate files outside the intended application scope.

Affected context

The vulnerability occurs in the search_papers function in src/main.py, where the topic parameter is used to construct file paths without sufficient validation or normalization.

It is relevant in deployments where papers-mcp-server is exposed over a network interface and accepts user-supplied topics that are used to read from or interact with the server's filesystem.

The risk is higher when the application runs with broad filesystem permissions or has access to sensitive configuration, source, or data directories.

Exploit preconditions

  • Attack surface: Remote, via the application interface that accepts the topic parameter (e.g., HTTP or MCP-style request).
  • Required access: Ability to send crafted requests to the papers-mcp-server endpoint using the topic argument.
  • Trigger point: Invocation of search_papers where topic is interpolated into a filesystem path (e.g., open/read/list operations) without robust sanitization.
  • Why exploitation is possible: The application likely concatenates topic directly into a relative or absolute path and does not properly reject path traversal sequences such as ../, allowing the resulting path to escape the intended directory.

Why this happens

This issue is rooted in improper neutralization of path sequences when constructing filesystem paths from user-controlled input.

The search_papers function appears to trust the topic value and incorporates it directly into filesystem operations without canonicalization, whitelisting, or restricting the root directory.

This matches CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where lack of normalization and validation allows an attacker to reference files outside the intended directory boundary.

Potential impact

  • Unauthorized reading of files located outside the intended data or documents directory
  • Disclosure of sensitive information such as configuration files, tokens, or logs
  • Potential modification or deletion of files if write operations are performed on attacker-influenced paths
  • Facilitation of further attacks (e.g., information gathering for privilege escalation or lateral movement)

General mitigation guidance

Effective mitigation focuses on constraining how user input is translated into filesystem paths and reducing the privileges of the running process.

Pattern-based mitigation strategies include:

  • Treating all incoming topic values as untrusted and validating them against a strict whitelist (e.g., known topic IDs, patterns, or enumerated names) rather than using raw strings as paths.
  • Constructing paths using a fixed, server-side base directory and rejecting any computed path that resolves outside that directory after canonicalization.
  • Normalizing paths before use and explicitly disallowing traversal sequences such as ../, absolute paths, or embedded path separators where not expected.
  • Decoupling user identifiers from filesystem layout, for example mapping topic to stored metadata that references safe internal paths instead of direct path interpolation.
  • Running the service under a dedicated low-privilege account and ensuring filesystem permissions limit access only to non-sensitive data directories required for normal operation.

How teams detect issues like this

Detection efforts can combine code-level inspection with behavioral monitoring:

  • Static analysis rules that flag direct concatenation of user-controlled variables (such as request parameters) into filesystem paths used by APIs like open, os.listdir, os.path.join, or similar functions.
  • Code review checklists emphasizing directory traversal risks whenever path construction involves request parameters, query strings, or user-controlled identifiers.
  • Centralized security policies or linters that enforce the use of safe path-building utilities and mandatory checks that computed paths remain within an approved root directory.
  • Runtime logging and monitoring of file access patterns, alerting on unexpected directory access or file reads outside the normal data directory tree.

Sources

SourceLink
github.comgithub.com/duartium/papers-mcp-server/
github.comgithub.com/duartium/papers-mcp-server/issues/1
vuldb.comvuldb.com/submit/802080
vuldb.comvuldb.com/vuln/359805
vuldb.comvuldb.com/vuln/359805/cti

Frequently asked

questions

Yes. As described, the attack may be launched remotely when an attacker can send requests that control the topic parameter exposed by papers-mcp-server.

The attacker generally needs only network access to the service endpoint that triggers search_papers. No local shell access is required, though any existing authentication or access control around that endpoint will influence practical exploitability.

The most robust fix is to avoid using raw user input as a filesystem path. Instead, validate topic against a whitelist or map it to internal identifiers and ensure all derived paths are built from a fixed base directory, rejecting any path that resolves outside that directory.

Adopt development guidelines that prohibit direct concatenation of user input into filesystem paths, use canonicalization and directory-bound checks for any path derived from external data, and add automated tests and static checks specifically targeting traversal sequences and unsafe path handling.

Find out what's already
exploitable in your codebase.