cmsimple-xh / xhshop

A simple shop for CMSimple_XH
GNU General Public License v3.0
4 stars 3 forks source link

Shop templates are not protected from direct access #198

Open cmb69 opened 6 years ago

cmb69 commented 6 years ago

All shop templates (in templates/ as well as theme/) can be directly accessed via HTTP(S). Since the templates contain PHP code, this is actually a information leakage vulnerability.

The clean solution would be to rename the file extension from .tpl to .php, and to add a leading line preventing direct access. This would, however, constitute a minor BC break (custom templates in theme/ would have to be adapted accordingly). So an alternative work-around could be to ship respective .htaccess files, and to explicitly document that the folders have to be protected by other means, if the server does not support respective .htaccess files. Adding a respective system check would also appropriate in this case.

I would prefer renaming the file extensions, though, and to prominently document the resulting BC break, and how to handle it.

frase-git commented 6 years ago

Ich verstehe deine Überlegungen. Dennoch neige ich eher zur .htaccess-Lösung. Ich denke, die tpl-Endung zeigt schön, um was es sich handelt. Möglicherweise gibt es auch Proteste.

Wie gesagt, das ist nur eine "Neigung" meinerseits. Ich lasse mich gerne überstimmen.

cmb69 commented 6 years ago

Dennoch neige ich eher zur .htaccess-Lösung.

Die hat halt zwei Nachteile:

Mit einer System-Prüfung kann beides deutlich entschärft werden, aber etwas wie XH_isAccessProtected ist leider nicht unproblematisch.

Ich denke, die tpl-Endung zeigt schön, um was es sich handelt.

Die sauberste Lösung wäre wohl .phtml, aber das wird wohl zumindest auf manchen Servern nicht als PHP interpretiert, so dass es nicht wirklich hülfe – jedenfalls nicht, solange nicht der Core (und ggf. reqcheck.php entsprechende Prüfungen durchführt und Probleme meldet.

frase-git commented 6 years ago

Ich vertraue darauf, dass du das besser einschätzen kannst. Ich lasse mich gerne überstimmen.

cmb69 commented 6 years ago

Wie denken andere darüber?

XHalbert commented 6 years ago

rename the file extension from .tpl to .php, and to add a leading line preventing direct access

wären es nur diese Änderungen oder käme noch mehr hinzu? (Ich habe bereits einige tpl meinen Bedürfnissen angepasst)

Ich denke, die tpl-Endung zeigt schön, um was es sich handelt

solange die Dateien im template-Ordner bleiben wäre das wohl immer noch übersichtlich oder? Vllt. könnten die auch beispiel.tpl.php heißen?

Ich vertraue darauf, dass du das besser einschätzen kannst.

ich auch

cmb69 commented 6 years ago

wären es nur diese Änderungen oder käme noch mehr hinzu?

Zumindest bezüglich dieses Problems wären das die einzigen Änderungen. Irgendwann später mal würde ich die Templates umarbeiten wollen, aber das hat Zeit.

Vllt. könnten die auch beispiel.tpl.php heißen?

Gegen .tpl.php hätte ich nichts einzuwenden.

frase-git commented 6 years ago

i a net