CVE-2026-42551: Arbitrary File Write Via Upload Move

Moving an uploaded file to an unvalidated destination path can allow attackers to write arbitrary files (e.g., web shells) to the server via directory traversal sequences ('..') or absolute paths. Validate the destination path using 'basename()', 'realpath()', or strict string checks before moving the file.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0PHP
greprules fetch cve-2026-42551-arbitrary-file-write-via-upload-move --engine opengrep

Description

Moving an uploaded file to an unvalidated destination path can allow attackers to write arbitrary files (e.g., web shells) to the server via directory traversal sequences ('..') or absolute paths. Validate the destination path using 'basename()', 'realpath()', or strict string checks before moving the file.