<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Typosquatting on K-Life Hack | Systems Architecture &amp; DevOps</title><link>https://klifehack.com/en/tags/typosquatting/</link><description>Recent content in Typosquatting on K-Life Hack | Systems Architecture &amp; DevOps</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Sat, 30 May 2026 10:33:07 +0900</lastBuildDate><atom:link href="https://klifehack.com/en/tags/typosquatting/index.xml" rel="self" type="application/rss+xml"/><item><title>Technical Analysis of the 'Mini Shai-Hulud' npm Ecosystem Supply Chain Attack</title><link>https://klifehack.com/en/p/npm-typosquatting-mini-shai-hulud-analysis/</link><pubDate>Sat, 30 May 2026 10:33:07 +0900</pubDate><guid>https://klifehack.com/en/p/npm-typosquatting-mini-shai-hulud-analysis/</guid><description>&lt;h1 id="analysis-report-of-the-mini-shai-hulud-npm-supply-chain-attack-advanced-credential-theft-methods-exploiting-the-bun-runtime"&gt;Analysis Report of the &amp;ldquo;Mini Shai-Hulud&amp;rdquo; npm Supply Chain Attack: Advanced Credential Theft Methods Exploiting the Bun Runtime
&lt;/h1&gt;&lt;p&gt;On May 28, 2026, an advanced supply chain attack campaign named &amp;ldquo;Mini Shai-Hulud&amp;rdquo; was identified in the npm ecosystem. This attack distributed 14 malicious packages within a 4-hour window, aiming to immediately extract high-value credentials from cloud environments and CI/CD pipelines. This report analyzes the technical execution flow, evolution for increased stealth, and defense measures required for infrastructure security.&lt;/p&gt;
&lt;h2 id="1-attack-origin-typosquatting-and-metadata-impersonation"&gt;1. Attack Origin: Typosquatting and Metadata Impersonation
&lt;/h2&gt;&lt;p&gt;The attacker targeted ecosystems related to OpenSearch and ElasticSearch, which are widely utilized in corporate environments. A maintainer account with the identifier &lt;b&gt;vpmdhaj&lt;/b&gt; employed the following sophisticated methods:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Typosquatting&lt;/b&gt;: Adopted names such as &lt;code&gt;opensearch-setup&lt;/code&gt; and &lt;code&gt;env-config-manager&lt;/code&gt;, which are easily mistaken for official utility packages. This exploits developer typos or the assumption of official status.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Metadata Manipulation&lt;/b&gt;: The repository URL in the &lt;code&gt;package.json&lt;/code&gt; was modified to point to the actual official OpenSearch GitHub repository to deceive automated audit tools and manual developer inspections.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="2-execution-mechanism-exploitation-of-npm-lifecycle-hooks"&gt;2. Execution Mechanism: Exploitation of npm Lifecycle Hooks
&lt;/h2&gt;&lt;p&gt;A critical risk of this attack is that developers do not need to explicitly call the package via &lt;code&gt;require()&lt;/code&gt; or &lt;code&gt;import&lt;/code&gt;. The attack code is executed using the &lt;code&gt;preinstall&lt;/code&gt; hook, a standard npm feature.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#34;opensearch-setup&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#34;1.0.0&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;&amp;#34;scripts&amp;#34;&lt;/span&gt;: {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;&amp;#34;preinstall&amp;#34;&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#34;node ./scripts/setup.js&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The moment a developer executes &lt;code&gt;npm install &amp;lt;package-name&amp;gt;&lt;/code&gt; in the terminal, the npm client automatically triggers the &lt;code&gt;preinstall&lt;/code&gt; script. This causes the malicious payload to execute immediately on the local environment or build server before static analysis or code reviews can occur.&lt;/package-name&gt;&lt;/p&gt;
&lt;h2 id="3-evolution-of-stealth-analysis-of-second-generation-gen-2-stagers"&gt;3. Evolution of Stealth: Analysis of Second-Generation (Gen-2) Stagers
&lt;/h2&gt;&lt;p&gt;In the &amp;ldquo;Mini Shai-Hulud&amp;rdquo; campaign, detection evasion techniques evolved rapidly. The transition to &amp;ldquo;Living off the Land (LotL)&amp;rdquo; in the second generation is particularly noteworthy.&lt;/p&gt;
&lt;h3 id="generation-1-gen-1"&gt;Generation 1 (Gen-1)
&lt;/h3&gt;&lt;p&gt;Initial payloads connected directly to the attacker&amp;rsquo;s C2 (Command and Control) server to download secondary binaries. This method is relatively easy to detect through network egress monitoring.&lt;/p&gt;
&lt;h3 id="generation-2-gen-2-living-off-the-land-lotl"&gt;Generation 2 (Gen-2): Living off the Land (LotL)
&lt;/h3&gt;&lt;p&gt;To evade detection, the attacker shifted to methods exploiting legitimate binaries.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Acquisition of Legitimate Runtime&lt;/b&gt;: The script downloads the signed, legitimate &lt;b&gt;Bun runtime (v1.3.13)&lt;/b&gt; directly from the official GitHub release page (&lt;code&gt;github.com/oven-sh/bun/releases/download&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Payload Execution&lt;/b&gt;: A hidden malicious script of approximately 195KB within the package is executed using the downloaded legitimate Bun runtime. Consequently, EDR (Endpoint Detection and Response) systems process it as a standard process by a trusted binary, bypassing anomaly detection.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="4-target-assets-and-post-exploitation-impact"&gt;4. Target Assets and Post-Exploitation Impact
&lt;/h2&gt;&lt;p&gt;The executed payload begins scanning the core components of cloud-native environments. AWS environments and CI/CD pipelines are the primary targets.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;AWS Infrastructure Credential Theft&lt;/b&gt;: Attempts to access EC2 Instance Metadata Service (IMDSv2) and ECS task metadata to obtain temporary IAM role information. It automatically scans AWS Secrets Manager across &lt;b&gt;more than 16 AWS regions&lt;/b&gt; to extract API keys, database credentials, and encryption keys.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;CI/CD Pipeline Hijacking&lt;/b&gt;: Identifies if the execution environment is GitHub Actions and targets &lt;code&gt;GITHUB_TOKEN&lt;/code&gt; and other secrets stored in environment variables. This enables repository manipulation or backdoor injection into build artifacts.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Cascading Supply Chain Compromise&lt;/b&gt;: Uses stolen npm deployment tokens to publish unauthorized updates to other legitimate open-source packages managed by the victim, expanding the scope of damage.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="5-recommended-defense-and-mitigation-measures"&gt;5. Recommended Defense and Mitigation Measures
&lt;/h2&gt;&lt;p&gt;To protect environments from fluid supply chain attacks, the following technical controls are recommended.&lt;/p&gt;
&lt;h3 id="i-disabling-automatic-script-execution"&gt;I. Disabling Automatic Script Execution
&lt;/h3&gt;&lt;p&gt;The most effective way to prevent exploitation of lifecycle hooks is to explicitly prohibit script execution during installation.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;npm install --ignore-scripts
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;npm config set ignore-scripts true
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="ii-immediate-credential-rotation"&gt;II. Immediate Credential Rotation
&lt;/h3&gt;&lt;p&gt;If there is evidence of suspicious package installation or if build environments were active after May 28, 2026, immediately update the following information:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;AWS IAM users and STS temporary credentials&lt;/li&gt;
&lt;li&gt;HashiCorp Vault access tokens&lt;/li&gt;
&lt;li&gt;GitHub Actions Personal Access Tokens (PAT) and repository secrets&lt;/li&gt;
&lt;li&gt;npm registry publishing tokens&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="iii-enhanced-network-and-process-monitoring"&gt;III. Enhanced Network and Process Monitoring
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Egress Filtering&lt;/b&gt;: Monitor for unexpected binary downloads from Node.js or pnpm processes to the release section of &lt;code&gt;github.com&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Process Auditing&lt;/b&gt;: Check for the presence of processes initialized with the environment variable &lt;code&gt;__DAEMONIZED=1&lt;/code&gt;. This is a signature used by &amp;ldquo;Mini Shai-Hulud&amp;rdquo; when attempting background persistence.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="6-conclusion"&gt;6. Conclusion
&lt;/h2&gt;&lt;p&gt;&amp;ldquo;Mini Shai-Hulud&amp;rdquo; is a typical example of a modern supply chain attack that evades security products by exploiting legitimate runtimes. Based on Zero Trust principles, it is essential to strictly manage dependency locking and restrict script execution.&lt;/p&gt;
&lt;h2 id="summary"&gt;Summary
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Attack Method&lt;/b&gt;: Typosquatting, immediate execution via &lt;code&gt;preinstall&lt;/code&gt; hooks, LotL attacks using the Bun runtime.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Primary Targets&lt;/b&gt;: AWS Secrets Manager, GitHub Actions tokens, npm deployment tokens.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Countermeasures&lt;/b&gt;: Strict enforcement of &lt;code&gt;--ignore-scripts&lt;/code&gt;, monitoring for suspicious binary downloads, and rapid token rotation.&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>