<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Cloudflare R2 — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/cloudflare-r2/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 02 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/cloudflare-r2/feed.xml" rel="self" type="application/rss+xml"/><item><title>livewire-markdown-editor Arbitrary File Upload Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2024-01-02-livewire-markdown-editor-upload/</link><pubDate>Tue, 02 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-02-livewire-markdown-editor-upload/</guid><description>The livewire-markdown-editor versions before v1.3 contain an arbitrary file upload vulnerability in the MarkdownEditor::updatedAttachments() Livewire handler, allowing authenticated users to upload any file type, potentially leading to stored XSS, phishing, malware distribution, and markdown injection.</description><content:encoded><![CDATA[<p>Versions of <code>mckenziearts/livewire-markdown-editor</code> prior to v1.3 are vulnerable to arbitrary file upload via the <code>MarkdownEditor::updatedAttachments()</code> Livewire handler. This handler lacks server-side validation for file types, extensions, and content. An authenticated user with access to a page embedding the markdown editor can upload malicious files (e.g., <code>.html</code>, <code>.svg</code>, <code>.js</code>) to the disk configured by <code>livewire-markdown-editor.disk</code>. If this disk is a public cloud storage bucket (S3, DigitalOcean Spaces, Cloudflare R2, Scaleway Object Storage), the uploaded files are publicly accessible with a guessed <code>Content-Type</code> header. This vulnerability allows attackers to perform stored XSS, host phishing pages, distribute malware, and inject malicious markdown. A real-world exploitation was observed in production.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains access to an application using a vulnerable version of <code>mckenziearts/livewire-markdown-editor</code>.</li>
<li>The attacker navigates to a page embedding the <code>&lt;livewire:markdown-editor&gt;</code> component.</li>
<li>The attacker uses the file upload functionality of the editor to upload a malicious file, such as a <code>.html</code> or <code>.svg</code> file containing XSS payloads.</li>
<li>The <code>MarkdownEditor::updatedAttachments()</code> Livewire handler processes the uploaded file without proper validation.</li>
<li>The handler stores the file on the disk configured by <code>livewire-markdown-editor.disk</code> (e.g., a public cloud bucket like S3, DigitalOcean Spaces, Cloudflare R2, Scaleway Object Storage).</li>
<li>The uploaded file becomes publicly accessible on the storage domain.</li>
<li>A user visits the URL of the uploaded malicious file, triggering the XSS payload or accessing the phishing page.</li>
<li>The attacker achieves their objective, such as stealing user credentials, redirecting users to malicious websites, or compromising the application&rsquo;s integrity.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability can lead to several critical impacts. Stored XSS on the storage domain can allow attackers to steal user credentials or perform other malicious actions in the context of the application. Phishing pages hosted on the application&rsquo;s storage domain can trick users into revealing sensitive information. Malware distribution from a domain users trust can lead to widespread infections. Additionally, markdown injection via crafted filenames can compromise the integrity of the editor&rsquo;s output. A real-world exploitation of this vulnerability was observed in production on a community platform using this package.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to <code>mckenziearts/livewire-markdown-editor</code> v1.3 or later to patch the vulnerability.</li>
<li>If immediate upgrading is not feasible, disable the upload UI on every instance of the editor by passing <code>:show-upload=&quot;false&quot;</code>. This prevents the vulnerable code path from being reached.</li>
<li>Monitor web server logs (category <code>webserver</code>, product <code>linux</code>) for requests to the storage domain for unusual file extensions like <code>.html</code>, <code>.svg</code>, <code>.js</code>, <code>.php</code>, or <code>.exe</code>, which could indicate attempted exploitation.</li>
<li>Implement the file upload detection rule to identify potentially malicious file uploads to the storage domain.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>arbitrary-file-upload</category><category>stored-xss</category><category>vulnerability</category></item></channel></rss>