You Don’t Need to Sanitize User Input Before Casting as an Integer in a WordPress Plugin
A basic rule of security is to not trust user input. Many vulnerabilities exist because software developers assume that only legitimate and valid data will be submitted to the software. So the developers of WordPress plugins should do some combination of sanitization, validation, and escaping with user input. Developers can overdue on those things. We ran across an example while working on a security review of a plugin chosen by our customers.
Here is the relevant code in the plugin (plenty of other plugins, it turns out, have similar code): [Read more]