<?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 — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/note-mark/</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>Wed, 03 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/note-mark/feed.xml" rel="self" type="application/rss+xml"/><item><title>Note Mark OIDC Authentication Bypass via Hardcoded Password</title><link>https://feed.craftedsignal.io/briefs/2024-01-03-note-mark-auth-bypass/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-03-note-mark-auth-bypass/</guid><description>A critical authentication bypass vulnerability in note-mark allows attackers to authenticate as any OIDC-registered user by submitting the password 'null' to the internal login endpoint due to a hardcoded bcrypt hash fallback, potentially leading to account takeover and persistent access.</description><content:encoded><![CDATA[<p>A critical authentication bypass vulnerability affects note-mark deployments configured with OIDC authentication. The vulnerability stems from the <code>IsPasswordMatch</code> function in <code>backend/db/models.go</code>, which falls back to a hardcoded <code>bcrypt(&quot;null&quot;)</code> hash when a user has no stored password. This occurs because OIDC-registered users are created with an empty password. As a result, any attacker can authenticate as an OIDC user by submitting the password &ldquo;null&rdquo; to the internal login endpoint (<code>POST /api/auth/token</code>). This issue affects note-mark version 0.19.2 and potentially earlier versions. The default configuration ships with both authentication paths side-by-side, so any site that turns on OIDC is affected, allowing for potential account takeover and data exfiltration.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker identifies a note-mark instance with OIDC enabled and internal login enabled (default configuration). The attacker can confirm this by accessing <code>/api/info</code>.</li>
<li>The attacker enumerates valid usernames via the <code>/api/users/search</code> endpoint (anonymous user search enabled by default).</li>
<li>The attacker sends a POST request to <code>/api/auth/token</code> with the target username and password &ldquo;null&rdquo;.</li>
<li>The <code>IsPasswordMatch</code> function in <code>backend/db/models.go</code> is called. Since OIDC-registered users have an empty password, the function uses the <code>nullPasswordHash</code>.</li>
<li>The <code>bcrypt.CompareHashAndPassword</code> function compares <code>nullPasswordHash</code> with the provided password &ldquo;null&rdquo;, resulting in a successful match.</li>
<li>The server issues an <code>Auth-Session-Token</code> cookie to the attacker.</li>
<li>The attacker uses the valid session cookie to access the target user&rsquo;s account via <code>/api/users/me</code> or other authenticated endpoints.</li>
<li>The attacker persists access by updating the target user&rsquo;s password via <code>PUT /api/users/me/password</code> using &ldquo;null&rdquo; as the existing password, locking out the legitimate user and gaining persistent access.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows an attacker to fully take over OIDC-only user accounts on affected note-mark deployments. This includes reading private notebooks, note markdown, and uploaded assets. An attacker can also write, edit, or delete anything the compromised user owns, leading to significant data loss and confidentiality breaches. The vulnerability is especially severe due to the default configuration enabling both OIDC and internal login paths, making it easy for attackers to exploit.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Apply the recommended fix by rejecting the login path for users with no stored password in <code>backend/services/auth.go</code> and <code>backend/services/users.go</code> as detailed in the advisory. This directly addresses the vulnerability by preventing authentication with the &ldquo;null&rdquo; password.</li>
<li>Monitor network traffic for POST requests to <code>/api/auth/token</code> with a request body containing <code>&quot;password&quot;:&quot;null&quot;</code> to identify potential exploitation attempts using the provided Sigma rule.</li>
<li>Consider disabling internal logins (<code>EnableInternalLogin</code>) if OIDC is the sole authentication method used, mitigating the risk by removing the vulnerable login path.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>authentication-bypass</category><category>credential-access</category><category>note-mark</category><category>ghsa</category></item></channel></rss>