fix: keep view templates inside the views directory - #729
ambrose5773 wants to merge 2 commits into
Conversation
Reject absolute template paths and any resolved path outside the configured views directory.
Normalize both separators before the containment check, and build the regression next to the views directory so it stays on the same drive.
|
Howdy folks, I saw this come across the Discord channel and thought I'd pop over and toss in my 25 cents (inflation, ya know). This would change
A missing views folder and a disallowed path would give the same message, Pubvana (my cms) overrides Anyway, figured I'd toss that stuff out for consideration. ☮️ |
Summary
View::getTemplate()now rejects absolute template paths and any path that resolves outside the configured views directory.render(),fetch(), andexists()all go through that resolver, so a template that cannot be shown to stay inside the views directory is not included.Reported by Arekkusul.
Test plan