alleyinteractive / apple-news

The Publish to Apple News plugin enables your WordPress blog content to be published to your Apple News channel.
https://wordpress.org/plugins/publish-to-apple-news/
GNU General Public License v3.0
152 stars 70 forks source link

Convert all require/include statements to use __DIR__ and dirname() #1121

Closed kevinfodness closed 1 month ago

kevinfodness commented 1 month ago

Summary

Fixes #1002 - Addressing the Path Traversal issue in apple-news.php on line 43, as reported.

Overview

Addresses the issue found in #1002 by going a step further and standardizing path computation across the codebase. Where files exist in the same folder or below the current file, __DIR__ is used. Where they exist in part of the tree that branches above the current directory, dirname is used to traverse upwards rather than ...

Background

Protection rules on the server do not allow for the plugin activation because of Path Traversal issue discovered in apple-news.php file on line 43. Warning: require_once(/var/www/wp-content/plugins/publish-to-apple-news/./includes/meta.php): Failed to open stream: No such file or directory in /var/www/wp-content/plugins/publish-to-apple-news/apple-news.php on line 43 Fatal error: Uncaught Error: Failed opening required '/var/www/wp-content/plugins/publish-to-apple-news/./includes/meta.php' (include_path='.') in /var/www/wp-content/plugins/publish-to-apple-news/apple-news.php on line 43

Steps To Reproduce

Plugin activation action.