Eiceblue Spire PDF MCP Server Path Traversal Vulnerability in PDF File Handler
Vulnerability
A path traversal vulnerability has been identified in Eiceblue Spire PDF MCP Server version 0.1.1. The issue arises in the PDF File Handler component, specifically within the 'get_pdf_path' function of 'src/spire_pdf_mcp/server.py'. The vulnerability allows remote attackers to manipulate the 'filepath' argument, escaping the intended PDF directory and accessing arbitrary files. This exploitation can lead to unauthorized PDF creation, conversion, and access to existing PDF files on the host system.
Impact
Exploitation of this vulnerability allows for path traversal, enabling access to files outside the intended directory. This could lead to unauthorized reading of PDF files or overwriting files with PDF content, disrupting normal workflows.
Reproduction
To reproduce this vulnerability, upload a PDF file to the server's default PDF directory. Then, send a request to the 'create_pdfdocument' tool via the MCP interface, including a 'filepath' argument that uses a traversal payload to escape the 'PDF_FILES_PATH' directory. The server will create the PDF file at the specified location outside the intended directory, demonstrating the path traversal vulnerability.
Remediation
It is recommended to update the 'get_pdf_path' function to include path normalization and containment checks, ensuring that user-supplied paths cannot escape the designated PDF directory. Additionally, all tools that accept 'filepath' or similar parameters should be audited and tested for path traversal vulnerabilities.
Vulnerability Rating
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.
