CVE-2026-42552: Insecure File Move Uploaded File

Moving an uploaded file to an unvalidated path derived from a function parameter can lead to path traversal and arbitrary file write vulnerabilities. Adversaries might write or overwrite files on the server. Validate the target path to prevent directory traversal (`..`) or use `basename()` to secure the filename.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0PHP
greprules fetch cve-2026-42552-insecure-file-move-uploaded-file --engine opengrep

Description

Moving an uploaded file to an unvalidated path derived from a function parameter can lead to path traversal and arbitrary file write vulnerabilities. Adversaries might write or overwrite files on the server. Validate the target path to prevent directory traversal (`..`) or use `basename()` to secure the filename.