{"id":122,"date":"2022-11-27T12:31:00","date_gmt":"2022-11-27T05:31:00","guid":{"rendered":"https:\/\/n45ht.or.id\/blog\/?p=122"},"modified":"2024-12-14T13:41:37","modified_gmt":"2024-12-14T06:41:37","slug":"post-based-xss-on-domainesia","status":"publish","type":"post","link":"https:\/\/n45ht.or.id\/blog\/post-based-xss-on-domainesia\/","title":{"rendered":"POST-based XSS on DomaiNesia"},"content":{"rendered":"\n<p><strong>DomaiNesia<\/strong> is a company that offers domain registration, web hosting, VPS, and other related services. In this report, I\u2019ll be sharing the details of a <strong>POST-based XSS<\/strong> vulnerability I discovered on their website.<\/p>\n\n\n\n<p>I spent a few minutes thoroughly browsing the website, checking different pages, URLs, and parameters, and testing various inputs in forms. Eventually, I came across a potential vulnerability on the following page:<\/p>\n\n\n\n<p><strong>Page URL:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"HTML\" class=\"language-HTML\">https:\/\/www.domainesia.com\/konfirmasi\/<\/code><\/pre>\n\n\n\n<p>On this page, there were input fields for <strong>&#8220;Payment Confirmation&#8221;<\/strong> as well as a file upload field. I decided to focus on the file upload functionality.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 1: File Upload Test<\/h4>\n\n\n\n<p>I uploaded a file named <code>img.jpg<\/code> and received the following response:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"&lt;img id='previewImage' src='https:\/\/files.domainesia.com\/bukti-pembayaran\/2019-10-14-94638-img.jpg' alt='Payment Proof' width='100'&gt;\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">&lt;img<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">id<\/span><span style=\"color: #ECEFF4\">=<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">previewImage<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">src<\/span><span style=\"color: #ECEFF4\">=<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">https:\/\/files.domainesia.com\/bukti-pembayaran\/2019-10-14-94638-img.jpg<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">alt<\/span><span style=\"color: #ECEFF4\">=<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Payment Proof<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">width<\/span><span style=\"color: #ECEFF4\">=<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">100<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #81A1C1\">&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>At this point, I decided to test the behavior when adding special characters in the filename. Specifically, I tried inserting a single quote (<code>'<\/code>) in the filename to see if it could break or close the <code>src<\/code> attribute in the image tag.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 2: File Name Manipulation<\/h4>\n\n\n\n<p>I renamed the file to <code>img'.jpg<\/code> and received the following response:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"&lt;img id='previewImage' src='https:\/\/files.domainesia.com\/bukti-pembayaran\/2019-10-14-94638-img' .jpg' alt='Payment Proof' width='100'&gt;\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">&lt;img<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">id<\/span><span style=\"color: #ECEFF4\">=<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">previewImage<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">src<\/span><span style=\"color: #ECEFF4\">=<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">https:\/\/files.domainesia.com\/bukti-pembayaran\/2019-10-14-94638-img<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">.jpg<\/span><span style=\"color: #D8DEE9\">&#39;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">alt<\/span><span style=\"color: #ECEFF4\">=<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Payment Proof<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">width<\/span><span style=\"color: #ECEFF4\">=<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">100<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #81A1C1\">&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>As you can see, the single quote in the filename disrupted the <code>src<\/code> attribute, which gave me an opportunity to inject a malicious payload.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 3: XSS Payload Injection<\/h4>\n\n\n\n<p>Taking advantage of this, I tried injecting some <strong>XSS payloads<\/strong> in the filename. Here are the two payloads I used:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code>img'onerror='alert(document.domain)'.jpg<\/code><\/li>\n\n\n\n<li><code>img'onerror='alert(document.cookie)'.jpg<\/code><\/li>\n<\/ol>\n\n\n\n<p>When I uploaded these files, the payloads were executed as part of the <code>onerror<\/code> event handler for the image. The server responded with a <strong>POST-based XSS<\/strong>, successfully triggering the JavaScript alerts.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"611\" src=\"https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/domainesia3-1024x611.png\" alt=\"\" class=\"wp-image-124\" style=\"width:487px;height:auto\" srcset=\"https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/domainesia3-1024x611.png 1024w, https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/domainesia3-300x179.png 300w, https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/domainesia3-768x459.png 768w, https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/domainesia3.png 1077w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"731\" height=\"354\" src=\"https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/domainesia1.png\" alt=\"\" class=\"wp-image-123\" style=\"width:485px;height:auto\" srcset=\"https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/domainesia1.png 731w, https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/domainesia1-300x145.png 300w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Timeline:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>October 14, 2019:<\/strong> Reported the bug to DomaiNesia<\/li>\n\n\n\n<li><strong>October 14, 2019:<\/strong> DomaiNesia acknowledged and accepted the bug report<\/li>\n\n\n\n<li><strong>October 14, 2019:<\/strong> DomaiNesia confirmed that the bug had been fixed<\/li>\n\n\n\n<li><strong>October 14, 2019:<\/strong> DomaiNesia requested my account information<\/li>\n\n\n\n<li><strong>October 16, 2019:<\/strong> A reward was sent<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"654\" height=\"350\" src=\"https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/domainesia-bounty1.png\" alt=\"\" class=\"wp-image-125\" style=\"width:510px;height:auto\" srcset=\"https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/domainesia-bounty1.png 654w, https:\/\/n45ht.or.id\/blog\/wp-content\/uploads\/2024\/12\/domainesia-bounty1-300x161.png 300w\" sizes=\"auto, (max-width: 654px) 100vw, 654px\" \/><\/figure>\n\n\n\n<p>I\u2019m grateful to DomaiNesia for their prompt response and for rewarding me for reporting this issue.<\/p>\n\n\n\n<p>#HappyHacking<\/p>\n","protected":false},"excerpt":{"rendered":"<p>DomaiNesia is a company that offers domain registration, web hosting, VPS, and other related services. In this report, I\u2019ll be sharing the details of a POST-based XSS vulnerability I discovered on their website. I spent a few minutes thoroughly browsing the website, checking different pages, URLs, and parameters, and testing various inputs in forms. Eventually, [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":150,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[23,9,8],"class_list":["post-122","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-research","tag-bug-bounty","tag-cross-site-scripting","tag-xss"],"_links":{"self":[{"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/posts\/122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/comments?post=122"}],"version-history":[{"count":1,"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/posts\/122\/revisions"}],"predecessor-version":[{"id":126,"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/posts\/122\/revisions\/126"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/media\/150"}],"wp:attachment":[{"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/media?parent=122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/categories?post=122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/n45ht.or.id\/blog\/wp-json\/wp\/v2\/tags?post=122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}