<?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: Raja Nagori</title>
    <description>The latest articles on DEV Community by Raja Nagori (@raja_nagori).</description>
    <link>https://dev.to/raja_nagori</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%2F4069913%2F3fd90b17-73b1-4fd4-a5a4-4ebba1c6079b.png</url>
      <title>DEV Community: Raja Nagori</title>
      <link>https://dev.to/raja_nagori</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/raja_nagori"/>
    <language>en</language>
    <item>
      <title>Dependency confusion in one table: internal scope vs public higher version</title>
      <dc:creator>Raja Nagori</dc:creator>
      <pubDate>Thu, 13 Aug 2026 15:00:00 +0000</pubDate>
      <link>https://dev.to/raja_nagori/dependency-confusion-in-one-table-internal-scope-vs-public-higher-version-2joj</link>
      <guid>https://dev.to/raja_nagori/dependency-confusion-in-one-table-internal-scope-vs-public-higher-version-2joj</guid>
      <description>&lt;h2&gt;
  
  
  Problem
&lt;/h2&gt;

&lt;p&gt;Your CI asks for an internal package. The public registry answers first with &lt;code&gt;999.999.999&lt;/code&gt;. Installers that maximize version will take it. That is dependency confusion no phishing required.&lt;/p&gt;

&lt;p&gt;Print the resolved registry host in CI logs and alert on public hosts for private scopes. Make confusion visible.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8usx5ikyldcuyxj49j6g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8usx5ikyldcuyxj49j6g.png" alt="High Level Overview" width="800" height="462"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution concept
&lt;/h2&gt;

&lt;p&gt;Ship one control at a time, measure bypasses, then add the next. A single enforced check beats a binder of unenforced best practices.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Scope + registry map for every internal namespace.&lt;/li&gt;
&lt;li&gt;Exact pins; no caret/range on private packages.&lt;/li&gt;
&lt;li&gt;Assert resolved URL host in CI against an allowlist.&lt;/li&gt;
&lt;li&gt;Treat lockfile resolved fields as security-relevant artifacts.&lt;/li&gt;
&lt;li&gt;Internal package exists only on a private registry&lt;/li&gt;
&lt;li&gt;Build config also searches the public registry&lt;/li&gt;
&lt;li&gt;Attacker publishes the same name with a higher version&lt;/li&gt;
&lt;li&gt;Installer prefers public artifact; malicious code runs&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F48ks2qchdqi9q9pbalmy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F48ks2qchdqi9q9pbalmy.png" alt="Sequence Diagram" width="799" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Field notes
&lt;/h2&gt;

&lt;p&gt;Print resolved URLs during install in CI. If an “internal” package suddenly resolves to a public host, treat it as an incident even when tests pass. Scoped registry maps belong in the repo, not only on individual laptops.&lt;/p&gt;

&lt;h2&gt;
  
  
  Residual risk
&lt;/h2&gt;

&lt;p&gt;Misconfigured local &lt;code&gt;.npmrc&lt;/code&gt; bypasses org policy. Verify resolution in the same environment that ships artifacts and not only on a secure bastion.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it, then talk back
&lt;/h2&gt;

&lt;p&gt;Explore the concept in &lt;strong&gt;Supply Chain Attack Simulator (SCAS)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://simulator.rajanagori.in/" rel="noopener noreferrer"&gt;Master supply chain security with real attack scenarios&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/RAJANAGORI/supply-chain-attack-simulator#start-here" rel="noopener noreferrer"&gt;Start Here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://simulator.rajanagori.in/guide.html?p=scenario-guides%2Fzero-to-hero%2FZERO_TO_HERO_SCENARIO_02.md" rel="noopener noreferrer"&gt;Dependency Confusion Supply Chain Attack&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;If you face any issues - &lt;a href="https://github.com/RAJANAGORI/supply-chain-attack-simulator/issues/new/choose" rel="noopener noreferrer"&gt;Github Issues - RAJANAGORI&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>npm</category>
      <category>python</category>
      <category>devops</category>
    </item>
    <item>
      <title>Typosquatting is not “user error” - it is a package resolution problem</title>
      <dc:creator>Raja Nagori</dc:creator>
      <pubDate>Tue, 11 Aug 2026 15:00:00 +0000</pubDate>
      <link>https://dev.to/raja_nagori/typosquatting-is-not-user-error-it-is-a-package-resolution-problem-40e9</link>
      <guid>https://dev.to/raja_nagori/typosquatting-is-not-user-error-it-is-a-package-resolution-problem-40e9</guid>
      <description>&lt;p&gt;Why lookalike package names bypass review, and how to reason about install-time vs require-time risk.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem
&lt;/h2&gt;

&lt;p&gt;If your threat model starts at “crypto of the tarball,” you are already late. Most teams lose at &lt;strong&gt;name resolution&lt;/strong&gt;: the wrong package string installs cleanly, exports a familiar API, and executes side effects before any business logic runs.&lt;/p&gt;

&lt;p&gt;Add a CI check that fails on unexpected new package names in the lockfile for protected services. Cheap control, high signal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyhkmlf5ppdz9w1lqdxir.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyhkmlf5ppdz9w1lqdxir.png" alt="High level overview" width="800" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution concept
&lt;/h2&gt;

&lt;p&gt;Ship one control at a time, measure bypasses, then add the next. A single enforced check beats a binder of unenforced best practices.&lt;/p&gt;

&lt;p&gt;Practical controls:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Control&lt;/th&gt;
&lt;th&gt;Why it helps&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Lockfiles + &lt;code&gt;npm ci&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Stops casual name drift on install&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Name allowlists in CI&lt;/td&gt;
&lt;td&gt;Fails builds on unexpected package strings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lifecycle script policy&lt;/td&gt;
&lt;td&gt;Limits install-time execution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Boot-time network watch&lt;/td&gt;
&lt;td&gt;Catches require-time beacons&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Do not equate “tests passed” with “no side effects on require.”&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Attacker publishes a lookalike name near a popular package&lt;/li&gt;
&lt;li&gt;Developer (or lockfile drift) installs the wrong name&lt;/li&gt;
&lt;li&gt;Malicious module runs at install or first require&lt;/li&gt;
&lt;li&gt;Payload phones home or in safe labs, posts to localhost only&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8ijqdwfwwlw9yfsvgh3h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8ijqdwfwwlw9yfsvgh3h.png" alt="Sequence diagram for series of operation" width="800" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Field notes
&lt;/h2&gt;

&lt;p&gt;Watch for packages whose README is a thin clone of a popular project, publish times clustered after a viral blog post about that project, and maintainers with no prior history. In CI, prefer failing on unexpected new package names over paging after exfiltration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Residual risk
&lt;/h2&gt;

&lt;p&gt;Lookalike detection is fuzzy. Attackers iterate names faster than blocklists. Combine identity checks with behavior signals unexpected scripts, unexpected network knowing both have gaps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it - then talk back
&lt;/h2&gt;

&lt;p&gt;Explore the concept in &lt;strong&gt;Supply Chain Attack Simulator (SCAS)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://simulator.rajanagori.in/" rel="noopener noreferrer"&gt;Master supply chain security with real attack scenarios&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/RAJANAGORI/supply-chain-attack-simulator#start-here" rel="noopener noreferrer"&gt;Start Here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://simulator.rajanagori.in/guide.html?p=scenario-guides%2Fzero-to-hero%2FZERO_TO_HERO_SCENARIO_01.md" rel="noopener noreferrer"&gt;Typosquatting Supply Chain Attack&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;If you face any issues - &lt;a href="https://github.com/RAJANAGORI/supply-chain-attack-simulator/issues/new/choose" rel="noopener noreferrer"&gt;Github Issues - RAJANAGORI&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>programming</category>
      <category>opensource</category>
      <category>npm</category>
    </item>
  </channel>
</rss>
