An injection attack occurs when data is treated as code, possibly due to improper escaping.
It can occur in SQL statements.
It can occur in shell command lines.
It can occur in evaled strings.
It can occur in HTML (known as Cross-Site Scripting)
etc.
What if $file holds "| rm -rf /"? It's even a perfectly valid path, so it's not a validation issue.
Update: Added links. Refined definition.
In reply to Re^7: Question using system.
by ikegami
in thread Question using system.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |