{"id":26,"date":"2023-01-13T19:42:38","date_gmt":"2023-01-13T19:42:38","guid":{"rendered":"http:\/\/thered0ne.com\/?p=26"},"modified":"2023-01-14T15:04:11","modified_gmt":"2023-01-14T15:04:11","slug":"bug-bounty-strange-stored-xss","status":"publish","type":"post","link":"https:\/\/thered0ne.com\/?p=26","title":{"rendered":"Bug Bounty &#8211; Strange Stored XSS"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/thered0ne.com\/wp-content\/uploads\/2023\/01\/favpng_software-bug-computer-programming-programmer-software-testing-error.png\" alt=\"\" class=\"wp-image-27\" width=\"489\" height=\"523\" srcset=\"https:\/\/thered0ne.com\/wp-content\/uploads\/2023\/01\/favpng_software-bug-computer-programming-programmer-software-testing-error.png 826w, https:\/\/thered0ne.com\/wp-content\/uploads\/2023\/01\/favpng_software-bug-computer-programming-programmer-software-testing-error-281x300.png 281w, https:\/\/thered0ne.com\/wp-content\/uploads\/2023\/01\/favpng_software-bug-computer-programming-programmer-software-testing-error-768x821.png 768w\" sizes=\"auto, (max-width: 489px) 100vw, 489px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">I found a stored XSS in a private program (I can&#8217;t mention it). A user can add a favorite article to his\/her watch list to keep track of them for future use.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As an attacker, the request was interecepted, and a malicious javascript is inserted in its parameters. This makes the website to add an article to the watchlist which contain a javascript payload.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since everyone can see or share his\/her watchlist, an attacker could send the malicious watchlist to a victim and this will result in manipulation of his\/her browser.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The watchlist is stored in the database, thus whenever an attacker think of victim that can be tricked, the attacker could use the same URL to trick more victims.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The strange thing is this vulnerability was found at first by someone else, and the team fixed it &nbsp;but luckily for me, I tried a different method to reproduce the same vulnerability without knowing that another guy found it and it worked.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s why we should always try to think out of the box, and keep searching for a way how to exploit the same vulnerability even if it&#8217;s fixed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I saw first that the API endpoint that add articles is&nbsp;<strong>\/api\/v2\/add\/&nbsp;<\/strong>and I sent this payload:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"346\" height=\"66\" src=\"http:\/\/thered0ne.com\/wp-content\/uploads\/2023\/01\/image-4.png\" alt=\"\" class=\"wp-image-28\" srcset=\"https:\/\/thered0ne.com\/wp-content\/uploads\/2023\/01\/image-4.png 346w, https:\/\/thered0ne.com\/wp-content\/uploads\/2023\/01\/image-4-300x57.png 300w\" sizes=\"auto, (max-width: 346px) 100vw, 346px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">But nothing happened &#8230; Hmm why not ? I could see the&nbsp;<strong>Javascript&nbsp;<\/strong>payload inserted in article title, but couldn&#8217;t be executed. Strange &#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Suddenly, I asked myself the endpoint &#8220;Add&#8221; does contain a slash next to it, I removed the slash from add ?&nbsp;<strong>\/api\/v2\/add\/ -&gt;&nbsp;\/api\/v2\/add<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Think what ? It worked !! I removed the slash and tried again the same method, and booom !! Popup fired !! A big one though !&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"263\" height=\"164\" src=\"http:\/\/thered0ne.com\/wp-content\/uploads\/2023\/01\/image-5.png\" alt=\"\" class=\"wp-image-29\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s weird right ? The only logical explanation to this is there are two endpoints with the same name but the trailing slash is missing on one. Maybe they fixed it by adding a new endpoint but they kept the old one which resulted in a bug.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In fact, I found two ways to produce the same vulnerability. I reported&nbsp; this to the company and rewarded me with a bounty.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><strong>Today&#8217;s lesson is:&nbsp;<\/strong><\/em>Try different things, with the same request.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">More to come stay tuned.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I found a stored XSS in a private program (I can&#8217;t mention it). A user can add a favorite article to his\/her watch list to keep track of them for future use.&nbsp; As an attacker, the request was interecepted, and a malicious javascript is inserted in its parameters. This makes [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":148,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-26","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bug-bounty"],"_links":{"self":[{"href":"https:\/\/thered0ne.com\/index.php?rest_route=\/wp\/v2\/posts\/26","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thered0ne.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thered0ne.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thered0ne.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thered0ne.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=26"}],"version-history":[{"count":2,"href":"https:\/\/thered0ne.com\/index.php?rest_route=\/wp\/v2\/posts\/26\/revisions"}],"predecessor-version":[{"id":149,"href":"https:\/\/thered0ne.com\/index.php?rest_route=\/wp\/v2\/posts\/26\/revisions\/149"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thered0ne.com\/index.php?rest_route=\/wp\/v2\/media\/148"}],"wp:attachment":[{"href":"https:\/\/thered0ne.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thered0ne.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thered0ne.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}