<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Naval Saini</title>
    <description>The latest articles on DEV Community by Naval Saini (@navalsaini27).</description>
    <link>https://dev.to/navalsaini27</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1501414%2Fb2b6020b-24bf-41dc-bea4-75b31867c8f9.png</url>
      <title>DEV Community: Naval Saini</title>
      <link>https://dev.to/navalsaini27</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/navalsaini27"/>
    <language>en</language>
    <item>
      <title>What a Job Take-Home Taught Me About npm Supply-Chain Attacks</title>
      <dc:creator>Naval Saini</dc:creator>
      <pubDate>Thu, 17 Sep 2026 09:39:51 +0000</pubDate>
      <link>https://dev.to/navalsaini27/what-a-job-take-home-taught-me-about-npm-supply-chain-attacks-2an5</link>
      <guid>https://dev.to/navalsaini27/what-a-job-take-home-taught-me-about-npm-supply-chain-attacks-2an5</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;TLDR; I have built a simple cursor skill &lt;a href="https://reposafety.com" rel="noopener noreferrer"&gt;https://reposafety.com&lt;/a&gt; for scanning take home interview tests. So far it seems to do a pretty good job.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  What a Job Take-Home Taught Me About npm Supply-Chain Attacks
&lt;/h1&gt;

&lt;p&gt;I recently received a full-stack coding assignment from &lt;strong&gt;Antfarm DAO&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;At first, the company and recruiting process seemed genuine.&lt;/p&gt;

&lt;p&gt;The company had a polished website: &lt;a href="https://theantfarm.tech/" rel="noopener noreferrer"&gt;theantfarm.tech&lt;/a&gt;, a &lt;a href="https://dev.to/antfarm-tech"&gt;DEV.to presence&lt;/a&gt;, and what appeared to be a normal engineering recruiting process.&lt;/p&gt;

&lt;p&gt;The person who sent me the assessment also &lt;strong&gt;appeared to have an established online presence&lt;/strong&gt;, with profiles on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/matthew-carlino"&gt;DEV.to&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/matthew-carlino-tech" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/matthew-carlino-bb6729231" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/users/12677192/matthew-carlino" rel="noopener noreferrer"&gt;Stack Overflow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://leetcode.com/u/matthew-carlino/" rel="noopener noreferrer"&gt;LeetCode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://t.me/matthewcarlino" rel="noopener noreferrer"&gt;Telegram&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The communication was professional and the assessment looked like a completely normal one-hour engineering task.&lt;/p&gt;

&lt;p&gt;Then I looked at the dependency tree.&lt;/p&gt;

&lt;h2&gt;
  
  
  The dependency that changed everything
&lt;/h2&gt;

&lt;p&gt;The repository pulled in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;animatecss-tailwind-adapter@2.0.6
        ↓
@aaron205whitmore/postcss-animate-utils@1.0.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second package contains malicious code.&lt;/p&gt;

&lt;p&gt;It contacts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;153.75.81.2:1224
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and can receive a base64-encoded payload and execute it with Node's &lt;code&gt;require&lt;/code&gt; available:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;require&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dynamicCssRules&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That provides a mechanism for arbitrary remote JavaScript execution.&lt;/p&gt;

&lt;p&gt;The exact &lt;code&gt;1.0.2&lt;/code&gt; package I recovered has SHA-1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;183f39ef3531ad688f168c81e25b528b55630d67
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I've documented the investigation and preserved the relevant evidence here:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/naval200/proof_of_dev" rel="noopener noreferrer"&gt;https://github.com/naval200/proof_of_dev&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;npm install&lt;/code&gt; is not just package installation
&lt;/h3&gt;

&lt;p&gt;When we run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we're trusting an entire dependency graph.&lt;/p&gt;

&lt;p&gt;A developer may never have heard of the malicious package, yet it can still arrive through a transitive dependency.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check the dependency tree
&lt;/h3&gt;

&lt;p&gt;Don't only look at &lt;code&gt;package.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For an unfamiliar repository, inspect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and investigate unfamiliar packages, particularly private scoped dependencies.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pay attention to &lt;code&gt;.npmrc&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This repository also contained an npm authentication token.&lt;/p&gt;

&lt;p&gt;A private dependency combined with a repository-provided npm credential is something I'd investigate before installing anything.&lt;/p&gt;

&lt;h3&gt;
  
  
  Install scripts aren't the only threat
&lt;/h3&gt;

&lt;p&gt;Even if a package has no suspicious &lt;code&gt;postinstall&lt;/code&gt; script, malicious code can execute when a library is imported or used.&lt;/p&gt;

&lt;p&gt;So:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;No malicious install script ≠ safe package.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Don't rerun suspicious code
&lt;/h3&gt;

&lt;p&gt;Once I identified the malicious package, I stopped running the application and investigated the machine instead.&lt;/p&gt;

&lt;p&gt;I checked for active connections:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;lsof &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="nt"&gt;-P&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;153.75.81.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;macOS logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;log show &lt;span class="nt"&gt;--predicate&lt;/span&gt; &lt;span class="s1"&gt;'eventMessage contains "153.75.81.2"'&lt;/span&gt; &lt;span class="nt"&gt;--last&lt;/span&gt; 24h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;running Node/npm processes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps aux | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s1"&gt;'[n]ode|[n]pm'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and inspected the npm cache and package contents.&lt;/p&gt;

&lt;p&gt;I found &lt;strong&gt;no evidence of C2 communication or persistence&lt;/strong&gt;, although these checks cannot prove that no connection ever occurred.&lt;/p&gt;

&lt;h2&gt;
  
  
  The broader lesson
&lt;/h2&gt;

&lt;p&gt;The interesting part of this incident wasn't just the malicious npm package.&lt;/p&gt;

&lt;p&gt;It was how normal everything looked beforehand.&lt;/p&gt;

&lt;p&gt;A credible-looking company website, professional communication, GitHub access, a realistic technical assignment, and an apparently established online presence can all lower your guard.&lt;/p&gt;

&lt;p&gt;For take-home assignments, I'm now treating the repository itself as &lt;strong&gt;untrusted software&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;inspect first → install later.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you've encountered any of these identifiers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@aaron205whitmore/postcss-animate-utils
animatecss-tailwind-adapter
153.75.81.2
antfarm-tech/proof_of_dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I'd be interested in comparing evidence.&lt;/p&gt;

&lt;h1&gt;
  
  
  Security #NPM #JavaScript #CyberSecurity #SupplyChainSecurity
&lt;/h1&gt;

</description>
      <category>security</category>
      <category>npm</category>
      <category>javascript</category>
      <category>cybersecurity</category>
    </item>
  </channel>
</rss>
