Remediation Steps
Follow the steps below to remediate this finding on WordPress.
Avoid building file paths from user input in custom themes and plugins.
Use WordPress file API functions (get_template_directory(), WP_Filesystem) rather than raw PHP filesystem functions.
Sanitise any path components with sanitize_file_name() before use.
Review plugin settings that allow file path configuration and restrict them to expected directories.