Summary
firecrawl-mcp-server contains a path traversal vulnerability in the firecrawl_parse tool because supplied file paths are not restricted to an approved directory. An attacker who can invoke the tool may read sensitive local files, which can then be uploaded and exposed in the model context.
Affected context
The vulnerability occurs in deployments that expose the firecrawl_parse tool and allow attacker-controlled or insufficiently trusted filePath values. Risk is present when the tool accepts absolute paths or traversal sequences without resolving the requested path and verifying that it remains within an intended base directory.
Exploit preconditions
- Attack surface: The
firecrawl_parsetool's file-reading functionality - Required access: Ability to invoke the tool or influence its
filePathargument - Trigger point: Processing a file path supplied to the parsing operation
- Why exploitation is possible: The application does not enforce directory containment before reading the requested file
Why this happens
The underlying bug is improper restriction of filesystem path resolution. A user-controlled path is treated as an acceptable local file reference without canonicalizing it and checking that the resulting location belongs to an authorized directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), because absolute paths and traversal components can escape the intended filesystem boundary.
Potential impact
- Sensitive credentials, tokens, or environment variables may be disclosed
- Local configuration and application source files could be exposed
- Retrieved file contents may be uploaded to external services or returned to model context
- An attacker could use disclosed secrets to access connected systems
- Confidentiality of the host or surrounding application environment could be reduced
General mitigation guidance
Mitigation generally focuses on reducing trust in file path input and enforcing a narrow filesystem access policy.
Common defensive patterns include:
- Resolve paths canonically and require them to remain within an explicitly approved directory
- Prefer opaque file identifiers or allowlisted resources over raw filesystem paths
- Reject absolute paths, traversal components, symbolic-link escapes, and unexpected path formats
- Apply strict schema and policy validation before any file access occurs
- Run the service with least-privilege filesystem permissions and isolated service accounts
- Minimize the content permitted to leave the local environment or enter model context
- Avoid storing credentials and sensitive environment data in locations readable by the service
How teams detect issues like this
Detection approaches can include:
- Static analysis for direct filesystem APIs that consume request-derived path values
- Code review checks for missing canonicalization and directory-containment validation
- Runtime policies that alert on absolute paths, traversal sequences, or access outside approved directories
- File-access telemetry correlated with tool invocations and unusual sensitive-file reads
- Automated security review tools that identify path construction and authorization gaps

