Flight has path traversal in `make:controller` CLI that creates arbitrary directories outside project root
Description
Published to the GitHub Advisory Database
May 6, 2026
Reviewed
May 6, 2026
Published by the National Vulnerability Database
May 13, 2026
Last updated
May 14, 2026
Summary
The
make:controllerCLI command callsmkdir(..., recursive: true)on a path built from the user-supplied controller name, before Nette's class-name validation runs. The class-file write is correctly rejected by Nette when the name contains/, but the recursive directory creation side effect is already committed — including directories located outside the project root through../traversal.Affected code
flight/commands/ControllerCommand.php(≈ 63-66):Proof of concept
Impact
.phpfile to be included via a distinct template-include weakness).\separator opens additional traversal surface.Patch (fixed in
3.18.1, commitb8dd23a)The controller name is now normalized with
basename()and validated against^[A-Za-z_][A-Za-z0-9_]*$before anymkdirside effect runs.Credit
Discovered by @Rootingg.
References