HTTP access to template.htm

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

HTTP access to template.htm

Post by cmb » Sun Jan 18, 2015 6:38 pm

Hello Community,

Ludwig mentioned this issue in a German thread: usually all files in the template folder can be accessed via HTTP. The particular problem are the template.htm files which actually shouldn't be accessible -- even though I really appreciate to be able to access them for support requests, it is an Information Exposure vulnerability.

It seems to me the cleanest solution would be to rename template.htm to template.php[1], but besides that would be an obvious BC break, it could lead to worse vulnerabilites[2]. Therefore it seems more appropriate to handle this like the protection of content.htm, i.e. by delivering a .htaccess directly in templates/ which denies access to template.htm for everybody, and to document the issue for other webservers.

In the long run we may consider the renaming to .php, which has been done in CMSimple 4.5 for content.htm. As content.php can be modified from the backend, we would have to take care for OPcache.

BTW: the same issue exists for several plugins, amongst them the standard filebrowser where the template files are .html files.

[1] Actually, template.htm is a PHP file (as well as CMSimple_XH's content.htm is one).
[2] Actually, this is rather unlikely, as template.php would error when calling head() or even earlier, there might be rare cases which would have to be prevented.
Christoph M. Becker – Plugins for CMSimple_XH

manu
Posts: 1090
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: HTTP access to template.htm

Post by manu » Mon Jan 19, 2015 7:43 am

secure by .htaccess (and add a notice in the wiki) might be appropriate.

svasti
Posts: 1659
Joined: Wed Dec 17, 2008 5:08 pm

Re: HTTP access to template.htm

Post by svasti » Mon Jan 19, 2015 4:02 pm

manu wrote:secure by .htaccess (and add a notice in the wiki) might be appropriate.
+1

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: HTTP access to template.htm

Post by cmb » Sat Jan 24, 2015 1:59 pm

I thought it would be reasonable to add a system check for the protection of template.htm. While testing this, I found a bug.

The check is implemented with r1474. If anybody has objections, I'll revert the commit.
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply