<?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>Esm.sh — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/esm.sh/</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, 12 May 2026 22:25:25 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/esm.sh/feed.xml" rel="self" type="application/rss+xml"/><item><title>esm.sh Path Traversal Vulnerability via package.json Browser Field</title><link>https://feed.craftedsignal.io/briefs/2026-05-esmsh-path-traversal/</link><pubDate>Tue, 12 May 2026 22:25:25 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-05-esmsh-path-traversal/</guid><description>A local file inclusion (LFI) vulnerability exists in the esbuild plugin's handling of the `browser` field in `package.json` within esm.sh, allowing an attacker to publish a malicious npm package that causes the server to read arbitrary files from the host filesystem.</description><content:encoded><![CDATA[<p>A local file inclusion (LFI) vulnerability, tracked as CVE-2026-44594, has been identified in esm.sh, specifically in the esbuild plugin&rsquo;s handling of the <code>browser</code> field within <code>package.json</code> files. An attacker can exploit this flaw by publishing a malicious npm package. This package, when processed by the esm.sh server during a build, allows the attacker to read arbitrary files from the server&rsquo;s filesystem. The vulnerability arises because the <code>browser</code> field remaps module paths to attacker-controlled values with <code>../</code> sequences, bypassing validation checks. The issue affects versions prior to commit 0593516c4cfa. Successful exploitation can lead to the exposure of sensitive information such as npm registry authentication tokens and S3 storage credentials stored in the esm.sh <code>config.json</code> file.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker crafts a malicious npm package containing a <code>package.json</code> file.</li>
<li>The <code>package.json</code> includes a <code>browser</code> field that remaps local module paths to paths outside the intended package directory using <code>../</code> sequences.</li>
<li>The attacker publishes the malicious package to the npm registry. The package name is chess-sec-utils1, version 1.0.6.</li>
<li>A user (or automated system) requests the malicious package (e.g., <code>chess-sec-utils1@1.0.6</code>) from an esm.sh instance.</li>
<li>The esm.sh server&rsquo;s esbuild plugin resolves module paths during the build process.</li>
<li>The plugin uses the <code>browser</code> field remapping, which replaces the validated module path with the attacker-controlled path.</li>
<li>The server reads the file specified in the remapped path from its filesystem, subject to esbuild&rsquo;s loader selection (e.g., <code>.json</code>, <code>.txt</code>, <code>.js</code>).</li>
<li>The contents of the file are included in the generated JavaScript bundle and/or the source map (<code>sourcesContent</code> array), which is then served to the user.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows an attacker to read arbitrary files from the esm.sh server. This includes the <code>config.json</code> file, which may contain sensitive data such as npm registry authentication tokens and S3 storage credentials. The exposure of these credentials could allow the attacker to compromise the esm.sh infrastructure or gain unauthorized access to other resources. The proof of concept shows reading /etc/hostname, /etc/os-release and /etc/environment.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Apply the patch suggested by the advisory to add a path validation check after the <code>browser</code> field remapping to prevent path traversal (reference: advisory content).</li>
<li>Monitor npm package installations for packages with suspicious <code>browser</code> field entries containing <code>../</code> sequences (reference: advisory content).</li>
<li>Deploy the Sigma rule to detect requests to esm.sh for packages that attempt path traversal (reference: the Sigma rule).</li>
<li>Update <code>go/github.com/esm-dev/esm.sh</code> to a version &gt;= 0.0.0-20250616164159-0593516c4cfa.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>path traversal</category><category>local file inclusion</category><category>npm</category><category>esbuild</category></item></channel></rss>