{"id":148,"date":"2022-08-14T12:49:19","date_gmt":"2022-08-14T10:49:19","guid":{"rendered":"https:\/\/bergee.it\/blog\/?p=148"},"modified":"2022-09-07T09:09:00","modified_gmt":"2022-09-07T07:09:00","slug":"the-forgotten-api-and-xss-filter-bypass","status":"publish","type":"post","link":"https:\/\/bergee.it\/blog\/the-forgotten-api-and-xss-filter-bypass\/","title":{"rendered":"The forgotten API and XSS filter bypass"},"content":{"rendered":"<p>On one site I found the forum section. There was an option to join some groups and then create posts in the group. I created an account, joined some opened group, and then created the post with the payload:<\/p>\n<blockquote><p>&lt;img src=x onerror=alert(1)&gt;<\/p><\/blockquote>\n<p>Nothing happened the user input was properly sanitized. I tried URL encoding, double URL encoding, and HTML entity encoding however nothing worked :(. The group URL was like:<\/p>\n<blockquote><p>https:\/\/www.redacted.com\/members\/modules\/groupsV3\/<\/p><\/blockquote>\n<p>I thought\u00a0 &#8211; what if I change the <em>groupsV3<\/em> to <em>groupsV2<\/em> or <em>groupsV1?<\/em> I didn&#8217;t expect much, however, I changed V3 to V2, and&#8230; it worked, the URL was valid but no alert box :(. There was some other filter in action &#8211; quotes, double quotes, and parenthesis were cut. Hmmm, there must be a way to bypass it. By googling for some time I found this payload:<\/p>\n<blockquote><p>&lt;img src=x onerror=setTimeout`alert\\x28document.domain\\x29`&gt;<\/p><\/blockquote>\n<p>It is based on template literal expressions.\u00a0 You can read about it <a href=\"https:\/\/css-tricks.com\/template-literals\/\" target=\"_blank\" rel=\"noopener\">here<\/a>. I used it in a forum post and.. it worked like a charm :). The alert box popped up.<\/p>\n<p>See you next bug :).<\/p>\n<p>Reward: \ud83d\udc55<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On one site I found the forum section. There was an option to join some groups and then create posts in the group. I created an account, joined some opened group, and then created the post with the payload: &lt;img src=x onerror=alert(1)&gt; Nothing happened the user input was properly sanitized. I tried URL encoding, double&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,33,29],"tags":[],"class_list":["post-148","post","type-post","status-publish","format-standard","hentry","category-bez-kategorii","category-vdp","category-write-up"],"_links":{"self":[{"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/posts\/148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/comments?post=148"}],"version-history":[{"count":8,"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/posts\/148\/revisions"}],"predecessor-version":[{"id":177,"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/posts\/148\/revisions\/177"}],"wp:attachment":[{"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/media?parent=148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/categories?post=148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/tags?post=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}