Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smarty Security: not trusted file path #10936

Open
Dannymx opened this issue Sep 1, 2020 · 3 comments
Open

Smarty Security: not trusted file path #10936

Dannymx opened this issue Sep 1, 2020 · 3 comments

Comments

@Dannymx
Copy link

Dannymx commented Sep 1, 2020

Describe the bug
Did a fresh install of the latest release from the master branch 4.0-2020.015-SNAPSHOT. All the main pages discussions/categories/dashboard seem to be working fine except when you visit any thread.

ie. going to https://redacted.test/discussion/1/welcome-to-awesome#latest throws the following 500 error.

PHP Fatal error:  Uncaught  --> Smarty: Smarty Security: not trusted file path 'C:\Users\Danny\Code\redacted\vanilla\plugins\rich-editor\views\rich-editor.tpl'  <-- 
  thrown in C:\Users\Danny\Code\redacted\vanilla\vendor\smarty\smarty\libs\sysplugins\smarty_security.php on line 654

To Reproduce
Steps to reproduce the behavior:

  1. Fresh install of 4.0-2020.015-SNAPSHOT
  2. Run setup
  3. Open any of the sample threads
  4. See error

Expected behavior
Open thread without errors.

Screenshots
image

@ghost
Copy link

ghost commented May 18, 2021

Can confirm on Build: vanilla-core-2021-009

Reproduce Steps

  • Windows 10
  • Install XAMPP PHP 7.4 (Enable php-intl in php.ini otherwise your setup will not complete \Locale:: errors)
  • New Discussion > HTTP 500

http500

[Web Server ] May 18 13:49:55 |ERROR  | SERVER GET  (500) /index.php?p=/post/discussion
[Web Server ] C:\xampp\htdocs\vanilla\vendor\smarty\smarty\libs\sysplugins\smarty_security.php on line 661

Commenting the line fixes it

        // give up
       // throw new SmartyException(sprintf('Smarty Security: not trusted file path \'%s\' ', $filepath));

@TheEternalNoob
Copy link

TheEternalNoob commented Aug 31, 2021

This issue for me was caused by loading the rich-editor plugin, which was not listed in the trusted dirs of smarty. A solution that worked for me was setting
/* $folder_to_plugins is the path to the plugins directory (didn't check if there were any other plugins using this)*/ $security->secure_dir =$folder_to_plugins;

in the enableSecurity function in library/core/class.smarty.php

@todosrc
Copy link

todosrc commented Jan 5, 2022

i have the same issue vanilla-2021012 run localhost@xampp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants