Code injection (php://input wrapper)
High Web Application Scanning Plugin ID 98121
SynopsisCode injection (php://input wrapper)
DescriptionA modern web application will be reliant on several different programming languages.
Because all server-side code should be executed by the server, it should only ever come from a trusted source.
Code injection occurs when the server takes untrusted code (ie. from the client) and executes it.
Cyber-criminals will abuse this weakness to execute arbitrary code on the server, which could result in complete server compromise.
Scanner was able to inject specific server-side code via a PHP wrapper (`php://input`) and have the executed output from the code contained within the server response. This indicates that proper input sanitisation is not occurring.
SolutionIt is recommended that untrusted input is never processed as server-side code.
To validate input, the application should ensure that the supplied value contains only the data that are required to perform the relevant action.
For example, where a username is required, then no non-alpha characters should not be accepted.