Summary
A path traversal vulnerability in Symfony UX's ux:install console command allows crafted recipe kits to copy files to or read files from arbitrary locations on the filesystem.
When a kit's copy-files map includes specially formed relative paths, attacker-controlled content can escape the recipe directory and interact with sensitive local files wherever the command is executed.
Affected context
This vulnerability appears in Symfony projects that use Symfony UX and invoke the ux:install console command to install recipe kits.
It becomes relevant when applications consume kits that may be untrusted, compromised, or pulled from external sources, especially in environments where the console command is run with elevated privileges.
The issue is tied to the handling of relative paths in the copy-files map, which can be abused to escape the intended recipe directory and affect arbitrary locations on the host filesystem.
Exploit preconditions
- Attack surface: The
ux:installconsole command for Symfony UX recipe installation. - Required access: Ability to supply, modify, or influence the recipe kit or its copy-files map (for example, controlling a package or repository that provides the kit).
- Trigger point: Execution of
ux:install, which processes the copy-files map and writes or reads files based on the provided paths. - Why exploitation is possible: The path validation relies on
Path::isRelative(), which accepts traversal patterns such as../../../etc, enabling paths that escape the recipe directory and reach arbitrary filesystem locations.
Why this happens
The root cause is improper validation of filesystem paths before file operations are performed, aligning with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ("Path Traversal").
Symfony UX's installer treats paths that are technically "relative" as safe, without enforcing that they remain inside a designated base directory or normalizing and checking for traversal sequences like ../.
This insecure pattern allows user-controlled input (from the recipe kit) to influence the destination and source paths for file copying, resulting in file reads or writes outside the intended recipe directory.
Potential impact
- Attacker-controlled content may be written to arbitrary locations on the filesystem accessible to the Symfony project.
- Critical configuration or application files could be overwritten, potentially leading to code execution or application compromise.
- Sensitive local files, such as environment configuration or credentials, may be read via recipe processing and exfiltrated during installation.
- Development and CI environments that automate
ux:installcan be silently poisoned by malicious or compromised kits.
General mitigation guidance
Mitigation generally focuses on enforcing strict directory boundaries and reducing trust in external recipe kits.
Useful defensive patterns include:
- Normalizing and canonicalizing paths, then rejecting any path that resolves outside a defined base directory.
- Implementing allowlists for copy targets and prohibiting traversal segments (
..) or absolute paths in kit definitions. - Treating recipe kits as untrusted input and applying integrity checks or signatures before installation.
- Running installation commands with least privilege, avoiding elevated permissions that would widen the consequences of file writes.
- Segregating build and deployment environments so that compromised kits cannot directly impact production systems.
How teams detect issues like this
Organizations can look for this class of issue through a combination of code and process checks:
- Static analysis rules or linters that flag the use of path manipulation functions without canonicalization and directory boundary checks.
- Code review practices that focus on any logic performing filesystem operations based on external or kit-supplied input, especially in installers or scaffolding tools.
- Policy enforcement to restrict or audit the sources of recipe kits, including checksums, signatures, or repository whitelists.
- Monitoring CI and build logs for anomalous file copy destinations (e.g., paths that traverse upward or touch sensitive directories) when running
ux:install.

