← PHP / Laravel · Contents

PHP-019 / Beginner

Concatenating user input into shell commands

A03:2021 Injection · CWE-78 OS Command Injection

Why is this a problem?

Syntax such as ; rm -rf is executed.

How to fix it

php
Process::run(['convert', $path, 'thumb.png']);  // Array arguments, no shell

Further reading