XSS vulnerability from Sourcecodester Profile Registration without Reload/Refresh 1.0 (add.php)
CVE-2024-9092
A vulnerability was found in SourceCodester Profile Registration without Reload Refresh 1.0. It has been rated as problematic. Affected by this issue is some unknown processing of the file add.php of the component Registration Form. The manipulation of the argument full_name with an unknown input leads to a cross site scripting vulnerability. Using CWE to declare the problem leads to CWE-79. The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. Impacted is integrity.
Affected Project: Profile Registration without Reload/Refresh
Official Website: https://www.sourcecodester.com/php/17587/profile-registration-without-reloadrefresh-using-ajax-php-and-mysql-source-code.html
Version: 1.0
Related Code file: add.php
Injection parameter: full_name
Vulnerability Description
The full_name 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 Profile Registration without Reload/Refresh System looks like:
Below is the admin page:
We can register as such:
Intercept the registration (add.php) traffic using Burp Suite and inject the following payload:
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 from admin.php page: