<?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>Nodejs — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/nodejs/</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>Fri, 03 Apr 2026 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/nodejs/feed.xml" rel="self" type="application/rss+xml"/><item><title>fast-jwt Library JWT Algorithm Confusion Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2026-04-fast-jwt-bypass/</link><pubDate>Fri, 03 Apr 2026 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-04-fast-jwt-bypass/</guid><description>The fast-jwt library is vulnerable to JWT Algorithm Confusion via Whitespace-Prefixed RSA Public Key due to an incomplete fix for CVE-2023-48223, allowing attackers to bypass intended security measures by exploiting leading whitespace in the RSA public key, enabling attackers to sign arbitrary payloads that will be accepted by the verifier, potentially leading to privilege escalation.</description><content:encoded><![CDATA[<p>The fast-jwt library, a popular Node.js package for handling JSON Web Tokens (JWTs), contains a vulnerability related to algorithm confusion. An incomplete fix for CVE-2023-48223 (GHSA-c2ff-88x2-x9pg) allows attackers to bypass intended security measures by exploiting leading whitespace in the RSA public key. Specifically, the <code>publicKeyPemMatcher</code> regex in <code>fast-jwt/src/crypto.js</code> does not account for leading whitespace, causing RSA public keys to be misclassified as HMAC secrets. This allows attackers to forge HS256 tokens using the RSA public key, leading to unauthorized access and privilege escalation. The vulnerability affects fast-jwt versions &lt;= 6.1.0. This issue is a direct bypass of the fix for CVE-2023-48223.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The attacker identifies a server using the vulnerable fast-jwt library for JWT verification.</li>
<li>The attacker retrieves the server&rsquo;s RSA public key, which is often publicly available.</li>
<li>The attacker adds leading whitespace (e.g., a newline character) to the RSA public key.</li>
<li>The attacker crafts a malicious JWT with the header specifying the HS256 algorithm (<code>alg: 'HS256'</code>).</li>
<li>The attacker sets the payload of the JWT to contain desired claims, such as <code>admin: true</code>.</li>
<li>The attacker uses the whitespace-prefixed RSA public key as the HMAC secret to sign the JWT.</li>
<li>The attacker presents the forged HS256 token to the vulnerable server.</li>
<li>The server, due to the algorithm confusion vulnerability, incorrectly verifies the token using the RSA public key as an HMAC secret and grants unauthorized access based on the claims in the forged token.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows attackers to bypass authentication and authorization controls, potentially gaining administrative privileges or access to sensitive data. This could lead to data breaches, system compromise, and reputational damage. The impact is significant due to the widespread use of the fast-jwt library in various applications. This is a direct bypass of the fix for CVE-2023-48223.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to a patched version of the <code>fast-jwt</code> library that addresses this vulnerability. This will require updating the <code>fast-jwt</code> package in your <code>package.json</code> file and redeploying your application.</li>
<li>As an immediate mitigation, sanitize RSA public keys by trimming leading whitespace before using them with the <code>fast-jwt</code> library. This can be done using the <code>.trim()</code> method in JavaScript before passing the key to the <code>createVerifier</code> function.</li>
<li>Deploy the Sigma rule that detects HS256 tokens being verified with RSA keys based on process creation logs to identify potential exploitation attempts.</li>
<li>Implement logging and monitoring for JWT verification processes to detect anomalies and suspicious activity. Specifically, monitor for instances where HS256 is used with keys that appear to be RSA public keys.</li>
<li>Review and update any existing security controls related to JWT handling to ensure they are effective against this type of algorithm confusion attack.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>jwt</category><category>algorithm-confusion</category><category>vulnerability</category><category>fast-jwt</category><category>nodejs</category></item><item><title>node-tesseract-ocr OS Command Injection Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2026-03-node-tesseract-ocr-command-injection/</link><pubDate>Thu, 26 Mar 2026 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-03-node-tesseract-ocr-command-injection/</guid><description>The node-tesseract-ocr npm package through version 2.2.1 is vulnerable to OS command injection due to improper sanitization of the file path parameter in the recognize() function, potentially allowing for arbitrary command execution.</description><content:encoded><![CDATA[<p>The node-tesseract-ocr npm package, a Node.js wrapper for Tesseract OCR, is vulnerable to OS command injection (CVE-2026-26832) in versions 2.2.1 and earlier. The vulnerability exists within the <code>recognize()</code> function located in <code>src/index.js</code>. The <code>file path</code> parameter, used to specify the image for OCR processing, is directly concatenated into a shell command string without proper sanitization. This unsanitized string is then passed to <code>child_process.exec()</code>, enabling attackers to inject arbitrary commands that are executed by the system. Exploitation can lead to complete system compromise, data exfiltration, or denial of service.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker crafts a malicious file path containing OS commands.</li>
<li>The attacker passes the malicious file path to the <code>recognize()</code> function within the <code>node-tesseract-ocr</code> package.</li>
<li>The <code>recognize()</code> function concatenates the attacker-controlled file path into a command string.</li>
<li>The command string, now containing injected OS commands, is passed to <code>child_process.exec()</code>.</li>
<li><code>child_process.exec()</code> executes the command string.</li>
<li>The injected OS commands are executed by the system with the privileges of the Node.js process.</li>
<li>The attacker gains arbitrary code execution on the target system.</li>
<li>The attacker can then perform actions such as installing malware, creating new user accounts, or exfiltrating sensitive data.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows an attacker to execute arbitrary commands on the server hosting the Node.js application. This can lead to complete system compromise, potentially impacting all data and services hosted on the compromised server. The severity is heightened because the vulnerability is remotely exploitable and requires no user interaction. Systems using affected versions of <code>node-tesseract-ocr</code> are at high risk.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade the <code>node-tesseract-ocr</code> package to a patched version that addresses CVE-2026-26832 if available.</li>
<li>Implement strict input validation and sanitization for the file path parameter passed to the <code>recognize()</code> function, mitigating command injection attempts.</li>
<li>Monitor process creation events for unusual processes spawned by Node.js (<code>node.exe</code> or <code>node</code>) to detect potential exploitation using the provided Sigma rule.</li>
<li>Review and audit all uses of <code>child_process.exec()</code> within Node.js applications to identify and remediate other potential command injection vulnerabilities.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>command-injection</category><category>nodejs</category><category>tesseract-ocr</category><category>cve-2026-26832</category></item></channel></rss>