This section talks about the prevention of vulnerabilities. A lot of vulnerabilities exist because of the functionalities that they provide.
For example, in the first section, File upload vulnerabilities, we talked about allowing the upload of any file extension. The ideal case is to check the file type, if a user is uploading a file; it should be an MP3 or a media file, not a PHP file or some executable code. We should never allow users to upload executables. Filters can be used to check the extension. The best way to do this is to check the file instead of just checking the extension, because files can bypass the extension check. Check the picture or the media instead of relying on the extension.
In the second section, Code execution vulnerabilities, we explored how we can run any code on a target computer. We should avoid allowing users to run code on the server...