Severity:

HIGH RISK

(7.3)

Path Traversal in mcp-bases research_server search_papers

CVE-2026-7384

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 research_server.py in the mcp-bases project allows user-controlled input in the topic parameter to influence filesystem paths.

When exposed remotely, an attacker can craft requests that traverse directories on the server, potentially accessing files outside the intended data folder.

Affected context

This vulnerability occurs in deployments of the mcp-bases research server where the search_papers function is reachable over a network interface and uses the topic argument to build file paths.

It is most relevant when:

  • The application reads from or writes to the filesystem based on client-supplied topics
  • There is no strict validation or normalization of the topic path segment
  • The process has read access to sensitive directories or configuration files

Exploit preconditions

  • Attack surface: Remote, via the research server endpoint exposing search_papers
  • Required access: Ability to send requests to the service (typically unauthenticated or low-privilege HTTP/API access)
  • Trigger point: Supplying a crafted topic value containing directory traversal sequences (e.g., ../) or absolute-path-like segments
  • Why exploitation is possible: The code uses user-controlled topic content directly (or after insufficient checks) when constructing filesystem paths, without enforcing a fixed root, canonicalization, or a strict allowlist of valid topics

Why this happens

The root cause aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

The search_papers function appears to concatenate or interpolate the topic value into a path used for file operations without:

  • Normalizing and canonicalizing the path to ensure it remains under an expected base directory
  • Rejecting traversal metacharacters such as ../, ..\, or URL-encoded equivalents
  • Constraining topic to a fixed set of known-safe identifiers rather than free-form paths

This insecure pattern allows user input to escape the intended directory boundary and target arbitrary locations accessible by the application process.

Potential impact

  • Read access to files outside the intended document/data directory
  • Exposure of configuration files, access tokens, or API keys stored on disk
  • Discovery of application source code, internal scripts, or infrastructure details that could aid further attacks
  • Potential overwrite or deletion of files (if corresponding write operations are possible in the affected code paths)
  • Indirect escalation to other vulnerabilities by accessing logs or temporary files containing sensitive data

General mitigation guidance

Effective mitigation focuses on constraining filesystem access and removing direct path control from clients:

  • Use a fixed base directory for all search_papers file operations and enforce that all resolved paths remain within that directory after canonicalization
  • Treat topic as a logical identifier (e.g., a key or slug) mapped to known directories or files via a lookup table or database, rather than as a path fragment
  • Implement strict allowlists (e.g., regex or enumeration) for topic values, rejecting input containing path separators, traversal sequences, or control characters
  • Use platform-safe path-joining utilities that operate on canonicalized paths and explicitly check for directory escape attempts
  • Run the service under a dedicated, least-privileged account whose filesystem permissions are limited to non-sensitive directories required by the application
  • Segment sensitive configuration and credentials away from application data directories to minimize exposure if traversal occurs

How teams detect issues like this

Detection typically combines code-level and runtime approaches:

  • Static analysis: Configure rules to flag string concatenation or interpolation involving user input and filesystem APIs (e.g., open, os.path.join, Path operations) without validation or canonicalization
  • Code review cues: Look for functions like search_papers where request parameters directly influence file paths; verify that traversals are rejected and paths are anchored to a base directory
  • Logging and monitoring: Instrument the application to log suspicious topic values containing ../, unusual encodings, or unexpected separators, and alert on repeated or automated attempts
  • Security testing: Incorporate path traversal test cases into automated security tests and CI pipelines, including URL-encoded traversal patterns and platform-specific path syntaxes

Sources

SourceLink
github.comgithub.com/ezequiroga/mcp-bases/
github.comgithub.com/ezequiroga/mcp-bases/issues/2
vuldb.comvuldb.com/submit/803095
vuldb.comvuldb.com/vuln/360106
vuldb.comvuldb.com/vuln/360106/cti

Frequently asked

questions

Yes. The description indicates that exploitation is remotely possible when the search_papers function is exposed through a network-accessible service, allowing attackers to send crafted topic values.

Typically, the attacker only needs the ability to interact with the research server endpoint that accepts the topic parameter. If the endpoint is unauthenticated or available to low-privilege users, no special credentials are required.

Anchor all file operations to a fixed base directory and treat topic as a logical key rather than a raw path. Use a lookup or mapping from topic to allowed directories or files, and reject any input containing path traversal sequences, separators, or characters outside a strict allowlist.

Establish coding patterns that prohibit direct use of user input in filesystem paths, enforce centralized path-building utilities with canonicalization and boundary checks, and integrate static analysis and security testing focused on file access APIs into the development workflow.

Find out what's already
exploitable in your codebase.