Summary
FaceFusion does not properly normalize job identifiers before constructing job file paths, allowing path traversal through its unauthenticated HTTP API. An attacker may use this flaw to create or overwrite files outside the intended jobs directory when the API processes a malicious job identifier.
Affected context
The vulnerability may affect FaceFusion deployments that expose the HTTP API and use attacker-controlled job identifiers when generating job file names. Risk is higher when the service runs with write access to sensitive directories or when API requests are reachable without authentication.
Exploit preconditions
- Attack surface: FaceFusion's HTTP API
- Required access: Ability to send requests to the unauthenticated API
- Trigger point: Processing a job identifier by
get_job_file_name - Why exploitation is possible: The identifier is incorporated into a filesystem path without sufficient normalization or confinement to the intended jobs directory
Why this happens
The underlying bug is improper neutralization of path elements used in a dynamically constructed filesystem path. When user-controlled job identifiers are treated as trusted path components without canonicalization and directory-boundary enforcement, traversal sequences can cause file operations to resolve outside the intended directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.
Potential impact
- An attacker may create files outside the designated jobs directory
- Existing files may be overwritten if the process has suitable permissions
- Application behavior or configuration may be disrupted
- Sensitive files could be modified, depending on filesystem permissions and path resolution
- The service may be used as a stepping stone for broader compromise if written content is later executed or loaded
General mitigation guidance
Mitigation generally focuses on treating job identifiers as untrusted data and enforcing filesystem confinement.
Common defensive patterns include:
- Allowing only a narrowly defined identifier format, such as opaque server-generated values
- Resolving candidate paths canonically and verifying that they remain beneath the intended jobs directory
- Rejecting path separators, traversal components, absolute paths, and other filesystem-specific special forms
- Using safe file-creation APIs that do not follow unexpected links where appropriate
- Reducing service filesystem permissions and separating writable job storage from sensitive application paths
- Requiring authentication and authorization for API operations that create or modify files
How teams detect issues like this
Organizations commonly identify path traversal risks through:
- Static analysis rules for concatenating request-derived values with filesystem paths
- Code review checks for missing canonicalization and directory-boundary validation
- Tests using encoded, platform-specific, and separator-based path variants
- Runtime monitoring for file creation outside approved application directories
- Policy enforcement that restricts API access and service write permissions to required locations
Automated application-security review tools may help flag filesystem operations that consume unsanitized request parameters.

