fix(security): resolve @FILE and @INCLUDE paths before trusting them - #2446
Open
elcreator wants to merge 1 commit into
Open
fix(security): resolve @FILE and @INCLUDE paths before trusting them#2446elcreator wants to merge 1 commit into
elcreator wants to merge 1 commit into
Conversation
Four bindings turned a string into a path and only one of them checked the resolved path. atBindInclude() compared the string as typed against EVO_MANAGER_PATH, which a `..` segment walked straight past - and it includes the file rather than reading it. The custom_widget output format and the custom_tv form element, both duplicated in functions/tv.php and functions/actions/mutate_content.php, concatenated EVO_BASE_PATH with the binding and used the result with no check at all; custom_tv:<widget> did the same with a name out of the TV's type column. Containment now lives in one place, Core::atBindFilePath(), built on the resolver @file was hardened with in 3.5.8. Search paths and legitimate syntax are unchanged, including a traversal that normalises back inside the tree. A refused binding no longer echoes the absolute path it tried, and a TV with no output option no longer reads a missing array key. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P9k7KBwVFZ6PSWH27ePZuJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four bindings turned a string into a path and only one of them checked the resolved path. atBindInclude() compared the string as typed against EVO_MANAGER_PATH, which a
..segment walked straight past - and it includes the file rather than reading it. The custom_widget output format and the custom_tv form element, both duplicated in functions/tv.php and functions/actions/mutate_content.php, concatenated EVO_BASE_PATH with the binding and used the result with no check at all; custom_tv: did the same with a name out of the TV's type column.Containment now lives in one place, Core::atBindFilePath(), built on the resolver @file was hardened with in 3.5.8. Search paths and legitimate syntax are unchanged, including a traversal that normalises back inside the tree.
A refused binding no longer echoes the absolute path it tried, and a TV with no output option no longer reads a missing array key.