<?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>Note-Mark/Backend — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/note-mark/backend/</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/products/note-mark/backend/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><item><title>Note Mark JWT Secret Weakness Allows Account Takeover</title><link>https://feed.craftedsignal.io/briefs/2024-01-note-mark-jwt-vuln/</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-note-mark-jwt-vuln/</guid><description>Note Mark is vulnerable to a JWT secret weakness that allows for full account takeover via token forgery by accepting secrets as short as 1 byte, enabling attackers to crack the signing secret offline and forge valid JWTs for any user.</description><content:encoded><![CDATA[<p>Note Mark is vulnerable to a critical security flaw related to the handling of JWT secrets. Specifically, the application does not enforce a minimum length or entropy on the <code>JWT_SECRET</code> configuration value. This means that the application accepts any base64-decodable secret, regardless of its size, even secrets as short as a single byte. According to RFC 7518 Section 3.2, HS256 keys must be at least 256 bits (32 bytes), but this is not enforced in Note Mark. This vulnerability, identified as CVE-2026-44523, allows attackers to compromise user accounts completely.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Deploy a vulnerable instance of Note Mark with a weak <code>JWT_SECRET</code> (less than 32 bytes after base64 decoding).</li>
<li>An attacker registers a new user account on the vulnerable Note Mark instance.</li>
<li>The attacker captures a valid <code>Auth-Session-Token</code> cookie from the registration or login process.</li>
<li>The attacker uses offline brute-force or dictionary attacks to crack the weak signing secret, such as using a Python script to decode the token with different secret values.</li>
<li>Once the secret is recovered, the attacker forges a new JWT for an arbitrary user UUID, potentially including an administrator account, and extends the expiry time.</li>
<li>The attacker sends the forged token in a request to the server.</li>
<li>The server incorrectly validates the forged token due to the compromised secret.</li>
<li>The server returns a 200 OK response, authenticating the attacker as the targeted user, granting unauthorized access to sensitive data and functionality.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows an attacker to perform full account takeover across the entire Note Mark application. The attacker can forge valid JWTs for any user, including administrators, without needing to know any actual user credentials. There is no server-side detection or rate-limiting possible, allowing the attacker to gain complete control over user accounts and data, potentially leading to data breaches, unauthorized modifications, and complete system compromise.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Enforce a minimum length of 32 bytes (256 bits) for JWT secrets after base64 decoding to prevent brute-force attacks. This directly addresses the core vulnerability (CVE-2026-44523).</li>
<li>Reject weak secrets during configuration parsing within the <code>Base64Decoded.UnmarshalText</code> function or during config validation to prevent deployment with insecure secrets.</li>
<li>Deploy the Sigma rule <code>Detect Weak JWT Secret Usage</code> to identify potentially vulnerable Note Mark instances that do not meet the minimum key size requirements.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>jwt</category><category>account-takeover</category><category>vulnerability</category></item></channel></rss>