XSS vulnerability from Sourcecodester QR Code Bookmark System 1.0 (delete-bookmark.php)

CVE-2024-8153

A vulnerability was found in SourceCodester QR Code Bookmark System 1.0. It has been rated as problematic. This issue affects some unknown processing of the file /endpoint/delete-bookmark.php. The manipulation of the argument bookmark leads to cross site scripting. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used.

Affected Project: QR Code Bookmark System 1.0

Official Website: https://www.sourcecodester.com/php/17286/qr-code-bookmark-system-using-php-and-mysql-source-code.html

Version: 1.0

Related Code file: delete-bookmark.php

Injection parameter: bookmark

Vulnerability Description

The bookmark parameter is vulnerable to the tested XSS payload: %3cIMG%20%22%22%22%3e%3cSCRIPT%3ealert(%22XSS%22)%3c%2fSCRIPT%3e%22%3e. This string is encoded and when decoded, it attempts to inject a script into the webpage: <IMG """"><SCRIPT>alert("XSS")</SCRIPT>">

Application does not properly sanitize or validate the input, this script could be executed in the user’s browser, leading to an XSS attack.

Demonstration

Below is how QR Code Bookmark System looks like:

Screenshot from 2024-08-25 10-58-50

We can delete bookmark as such:

Screenshot from 2024-08-25 11-10-55

Intercept the delete(delete-bookmark.php) traffic using Burp Suite and inject the following payload:

Screenshot from 2024-08-25 11-11-20

Payload used above is HTML encoded and decodes as <IMG """><SCRIPT>alert("XSS")</SCRIPT>">

Upon sending the modifying traffic containing XSS payload, we can verify the vulnerability:

Screenshot from 2024-08-25 11-00-50