Most active commenters
  • josefbud(4)

←back to thread

1369 points universesquid | 15 comments | | HN request time: 0s | source | bottom
Show context
DDerTyp ◴[] No.45170133[source]
One of the most insidious parts of this malware's payload, which isn't getting enough attention, is how it chooses the replacement wallet address. It doesn't just pick one at random from its list.

It actually calculates the Levenshtein distance between the legitimate address and every address in its own list. It then selects the attacker's address that is visually most similar to the original one.

This is a brilliant piece of social engineering baked right into the code. It's designed to specifically defeat the common security habit of only checking the first and last few characters of an address before confirming a transaction.

We did a full deobfuscation of the payload and analyzed this specific function. Wrote up the details here for anyone interested: https://jdstaerk.substack.com/p/we-just-found-malicious-code...

Stay safe!

replies(5): >>45170393 #>>45170458 #>>45172015 #>>45173594 #>>45180351 #
josefbud ◴[] No.45172015[source]
I'm a little confused on one of the excerpts from your article.

> Our package-lock.json specified the stable version 1.3.2 or newer, so it installed the latest version 1.3.3

As far as I've always understood, the lockfile always specifies one single, locked version for each dependency, and even provides the URL to the tarball of that version. You can define "x version or newer" in the package.json file, but if it updates to a new patch version it's updating the lockfile with it. The npm docs suggest this is the case as well: https://arc.net/l/quote/cdigautx

And with that, packages usually shouldn't be getting updated in your CI pipeline.

Am I mistaken on how npm(/yarn/pnpm) lockfiles work?

replies(3): >>45172213 #>>45172215 #>>45172431 #
1. sigotirandolas ◴[] No.45172213[source]
Not the parent, but the default `npm install` / `yarn install` builds will ignore the lock file unless everything can be satisfied, if you want the lock file to be respected you must use `npm ci` / `yarn install --frozen-lockfile`.

In my experience, it's common for CI pipelines to be misconfigured in this way, and for Node developers to misunderstand what the lock file is for.

replies(3): >>45172286 #>>45172488 #>>45172844 #
2. DDerTyp ◴[] No.45172286[source]
TIL: I need to fix my CI pipeline. Gonna create a jira ticket I guess…

Thank you!

replies(1): >>45172877 #
3. 0cf8612b2e1e ◴[] No.45172488[source]
Not a web guy, but that seems a bonkers default. I would have naively assumed a lockfile would be used unless explicitly ignored.
replies(2): >>45173657 #>>45175213 #
4. josefbud ◴[] No.45172844[source]
Yeah, I think I had made the assumption that they were using `npm ci` / `yarn install --frozen-lockfile` / `pnpm install --frozen-lockfile` in CI because that's technically what you're always supposed to do in CI, but I shouldn't have made that assumption.
5. josefbud ◴[] No.45172877[source]
Sorry, I had assumed this was what you were doing when I wrote my question but I should have specified. And sorry for now making your npm install step twice as long! ;)
replies(1): >>45173111 #
6. rimunroe ◴[] No.45173111{3}[source]
npm ci should be much faster in CI as it can install the exact dependency versions directly from the lockfile rather than having to go through the whole dependency resolution algorithm. In CI environments you don't have to wait to delete a potentially large pre-existing node_modules directory since you should be starting fresh each time anyway.
replies(1): >>45173457 #
7. josefbud ◴[] No.45173457{4}[source]
I've seen pipelines that cache node modules between runs to save time, but yeah if they're not doing that then you're totally right.
replies(1): >>45187542 #
8. metafunctor ◴[] No.45173657[source]
Welcome to the web side. Everything’s bonkers. Hard-earned software engineering truths get tossed out, because hey, wtf, I’ll just do some stuff and yippee. Feels like everyone’s stuck at year three of software engineering, and every three years the people get swapped out.
replies(2): >>45175560 #>>45177024 #
9. Already__Taken ◴[] No.45175213[source]
We didn't get locking until npm v5 (some memory and googling, could be wrong.) And it took a long time to do everything you'd think you want.

Changing the main command `npm install` after 7 years isn't really "stable". Anyway didn't this replace versions, so locking won't have helped either?

replies(2): >>45177692 #>>45178386 #
10. jiggawatts ◴[] No.45175560{3}[source]
> every three years the people get swapped out

That's because they are being "replaced", in a sense!

When an industry doubles every 5 years like web dev was for a long time, that by the mathematical definition means that the average developer has 5 years or less experience. Sure, the old guard eventually get to 10 or 15 years of experience, but they're simply outnumbered by an exponentially growing influx of total neophytes.

Hence the childish attitude and behaviour with everything to do with JavaScript.

replies(1): >>45175945 #
11. metafunctor ◴[] No.45175945{4}[source]
Good point! The web is going through its own endless September.

And so, it seems, is everything else. Perhaps, this commentary adds no value — just old man yells at cloud stuff.

12. anonymars ◴[] No.45177024{3}[source]
The web saw "worse is better" and said "hold my beer"
13. jffry ◴[] No.45177692{3}[source]
> Anyway didn't this replace versions, so locking won't have helped either?

The lockfile includes a hash of the tarball, doesn't it?

replies(2): >>45187569 #>>45188049 #
14. minitech ◴[] No.45178386{3}[source]
You can’t replace existing versions on npm. (But probably more important is what @jffry mentioned – yes, lockfiles include hashes.)
15. Already__Taken ◴[] No.45188049{4}[source]
It does, the answer to my question was no.