-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Labels
ChecksAudit/test of the particular part of the pluginAudit/test of the particular part of the plugin[Team] PluginsIssues owned by Plugins TeamIssues owned by Plugins Team
Description
This check consists to avoid direct file access if someone directly queries a file.
For files that only contain a PHP class the risk of something funky happening when directly accessed is pretty small. For files that contain procedural code, functions and function calls, the chance of security risks is a lot bigger.
We can avoid this by putting this code at the top of all PHP files that could potentially execute code if accessed directly :
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
What we do actually in the internal scanner:
- Check that is not an uninstall file.
- Check that is valid for direct access.
- Look for ABPATH or WPINC, otherwise it's wrong.
Finally in results we say all files that does not contain this header.
Metadata
Metadata
Assignees
Labels
ChecksAudit/test of the particular part of the pluginAudit/test of the particular part of the plugin[Team] PluginsIssues owned by Plugins TeamIssues owned by Plugins Team