/

CVE-2025-55988

Severity:

HIGH RISK

(7.2)

Directory Traversal in DreamFactory Core RestController

CVE-2025-55988

Analyzed

Vulnerability type

Category:

Directory Traversal

CWE:

CWE-22

Impact:

Unauthorized File System Access

Severity:

HIGH RISK

(7.2)

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 directory traversal vulnerability in the RestController component of DreamFactory Core v1.0.3 allows attackers to manipulate unsanitized URI paths to access unintended files or directories on the server.

When user-controlled path segments are not normalized or constrained to an allowed base directory, an attacker can potentially read or interact with files outside the intended web-accessible area.

Affected context

The vulnerability occurs in DreamFactory Core v1.0.3 within /Controllers/RestController.php, where incoming URI paths are used to construct file system paths.

It is relevant in deployments where:

  • The application maps request URIs to local resources
  • Path parameters or segments are accepted directly from user input
  • File system operations (such as inclusion, reading, or listing) rely on those paths without robust normalization and validation

The risk materializes when insufficient checks allow traversal sequences (like ../) to influence the resulting path.

Exploit preconditions

  • Attack surface: HTTP(S) REST endpoints handled by RestController
  • Required access: Network access to the DreamFactory Core instance (typically unauthenticated or low-privilege HTTP access, depending on endpoint configuration)
  • Trigger point: A crafted request whose URI path includes traversal sequences or unexpected directory components
  • Why exploitation is possible: The RestController uses an unsanitized URI path to build or reference file system locations without fully canonicalizing, restricting, or validating the requested path against an allowed root directory.

Why this happens

This issue stems from improper input validation when constructing file system paths from user-supplied data, mapping directly to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

The RestController relies on the incoming URI path as a trusted component, failing to:

  • Normalize the path and collapse traversal sequences
  • Enforce that the resolved path remains within an intended base directory
  • Reject or sanitize dangerous characters and patterns

As a result, attackers can introduce ../ or similar constructs to escape the intended directory scope and target arbitrary locations accessible to the application's process.

Potential impact

  • May allow reading of sensitive configuration files or application source code
  • Could expose credentials, API keys, or internal secrets stored on disk
  • Can facilitate information disclosure that supports further attacks (e.g., RCE through separate vulnerabilities)
  • Might enable limited file manipulation if the underlying operation permits writing or deletion

General mitigation guidance

Effective mitigation focuses on strictly constraining file paths derived from user input and reducing trust in URI components:

  • Resolve and normalize paths (e.g., using realpath or equivalent) and verify that the resulting path remains under a predefined application-controlled root directory.
  • Avoid using raw URI segments directly in file operations; instead, map user requests to whitelisted resource identifiers or logical names.
  • Implement robust validation and rejection of path traversal sequences, absolute paths, and disallowed characters before any file system interaction.
  • Run the application under least-privilege accounts with minimal file system permissions, so even a traversal is limited in what it can access.
  • Centralize path handling logic to ensure consistent enforcement of directory boundaries across controllers.

How teams detect issues like this

Detection can combine code-centric and behavior-centric approaches:

  • Static analysis: Search for file system APIs (e.g., file_get_contents, include, require, fopen, directory listing functions) that consume request-derived paths without intermediate validation or normalization.
  • Code review signals: Look for controllers that build paths using $_SERVER['REQUEST_URI'], route parameters, or raw path segments, especially where concatenation with base directories happens without canonicalization checks.
  • Dynamic testing: Use security testing tools or fuzzers to send requests with traversal patterns (../, ..\\, URL-encoded equivalents) and monitor responses for unexpected file contents or error messages referencing external paths.
  • Policy enforcement: Introduce CI/CD rules requiring a centralized file-path utility and prohibiting direct concatenation of user input into file system paths.

Sources

SourceLink
github.comgithub.com/dreamfactorysoftware/df-core/commit/54354605b2ec9afe6ee96756a5a22f6f56828950#diff-e57a7c0af25166ac8f02695307c6c413ca4ba0a48a20b2202ad910654528aab1
pentest-tools.compentest-tools.com/PTT-2025-001-RemoteCodeExecution-via-URL-Path-Traversal.pdf

Frequently asked

questions

Yes. As long as the affected REST endpoints are reachable over the network, attackers can exploit the issue by sending crafted HTTP requests with malicious URI paths.

Typically, only network access to the DreamFactory Core service is required. Authentication requirements, if any, depend on how the specific endpoints handled by RestController are configured.

Centralize path handling so that all user-influenced paths are canonicalized and then checked against a fixed, application-controlled base directory. Reject any request where the resolved path falls outside this directory, and favor whitelisting logical resource IDs instead of using raw file system paths.

Adopt defensive patterns where user input is never directly treated as a file path. Use strict validation, path normalization, and whitelisting, and enforce these rules through shared utilities, code review checklists, and automated static analysis integrated into the development workflow.

Find out what's already
exploitable in your codebase.