<?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>Enchant97 — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/vendors/enchant97/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 09 Jan 2024 15:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/vendors/enchant97/feed.xml" rel="self" type="application/rss+xml"/><item><title>Note Mark Arbitrary File Write via Path Traversal Leads to Remote Code Execution</title><link>https://feed.craftedsignal.io/briefs/2024-01-note-mark-rce/</link><pubDate>Tue, 09 Jan 2024 15:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-note-mark-rce/</guid><description>Note Mark is vulnerable to arbitrary file write via path traversal in asset names, leading to remote code execution by overwriting system binaries such as /bin/bash.</description><content:encoded><![CDATA[<p>Note Mark versions 0.19.2 and earlier contain an arbitrary file write vulnerability that leads to remote code execution. Authenticated users can upload assets to notes via <code>POST /api/notes/{noteID}/assets</code>, with the asset filename taken directly from the <code>X-Name</code> HTTP header. The application fails to sanitize this filename, storing it directly in the database. When an administrator subsequently runs the data export CLI commands (<code>note-mark migrate export-v1</code> or <code>note-mark migrate export</code>), the stored asset name is passed into <code>filepath.Join()</code> calls. An attacker-controlled asset name containing directory traversal sequences (e.g., <code>../</code>) allows writing files to arbitrary locations, which can be escalated to RCE by overwriting system binaries, such as <code>/bin/bash</code>. The vulnerability is present in Note Mark&rsquo;s backend component.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker registers an account and authenticates to the Note Mark application.</li>
<li>Attacker creates a notebook using a <code>POST</code> request to <code>/api/books</code>.</li>
<li>Attacker creates a note within the notebook using a <code>POST</code> request to <code>/api/books/&lt;BOOK_ID&gt;/notes</code>.</li>
<li>Attacker uploads an asset with a malicious payload and a path traversal filename in the <code>X-Name</code> header to <code>/api/notes/&lt;NOTE_ID&gt;/assets</code>. The <code>X-Name</code> header contains a path traversal sequence targeting a sensitive file like <code>/bin/bash</code>.</li>
<li>The application stores the unsanitized filename (including the path traversal) in the database.</li>
<li>An administrator triggers a data export using <code>note-mark migrate export-v1 --export-dir /data/backup</code> or <code>note-mark migrate export</code>.</li>
<li>The export process uses the unsanitized filename in <code>filepath.Join()</code>, causing a file to be written to the attacker-specified location (e.g., overwriting <code>/bin/bash</code>).</li>
<li>The next time <code>bash</code> is invoked, the attacker&rsquo;s payload executes, resulting in code execution as root.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows an attacker to overwrite arbitrary files on the system with root privileges, leading to complete system compromise. Overwriting <code>/bin/bash</code> results in RCE the next time any user invokes <code>bash</code>. The number of affected installations is unknown, but the vulnerability exists in version 0.19.2 and earlier.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule to detect asset uploads with path traversal sequences in the <code>X-Name</code> header.</li>
<li>Apply <code>filepath.Base()</code> to the <code>X-Name</code> header value in <code>backend/handlers/assets.go</code> before storing it in the database, as described in the advisory.</li>
<li>Apply <code>filepath.Base()</code> to <code>asset.Name</code> in <code>backend/cli/migrate.go</code> at lines 328 and 223 before using it in file path construction.</li>
<li>Upgrade to a patched version of Note Mark which addresses CVE-2026-44522.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>path-traversal</category><category>rce</category><category>web-application</category></item></channel></rss>