News for hackers. Stuff that matters.
Re:NPM debug and chalk packages compromised by Yoric on Monday September 08, 2025 @05:12PM (#45174071)
So how do you detect these attacks?
Re:NPM debug and chalk packages compromised by 33a on Monday September 08, 2025 @07:54PM (#45175681)
We use a mix of static analysis and AI. Flagged packages are escalated to a human review team. If we catch a malicious package, we notify our users, block installation and report them to the upstream package registries. Suspected malicious packages that have not yet been reviewed by a human are blocked for our users, but we don't try to get them removed until after they have been triaged by a human.

In this incident, we detected the packages quickly, reported them, and they were taken down shortly after. Given how high profile the attack was we also published an analysis soon after, as did others in the ecosystem.

We try to be transparent with how Socket work. We've published the details of our systems in several papers, and I've also given a few talks on how our malware scanner works at various conferences:

* https://arxiv.org/html/2403.12196v2

* https://www.youtube.com/watch?v=cxJPiMwoIyY

Re:NPM debug and chalk packages compromised by ATechGuy on Monday September 08, 2025 @10:55PM (#45176864)
You rely on LLMs riddled with hallucinations for malware detection?
Re:NPM debug and chalk packages compromised by jmb99 on Monday September 08, 2025 @11:21PM (#45177009)
I'm not exactly pro-AI, but even I can see that their system clearly works well in this case. If you tune the model to favour false positives, with a human review step (that's quick), I can image your response time being cut from days to hours (and your customers getting their updates that much faster).
Re:NPM debug and chalk packages compromised by ATechGuy on Tuesday September 09, 2025 @10:59AM (#45182837)
You are assuming that they build their own models.
Re:NPM debug and chalk packages compromised by Mawr on Tuesday September 09, 2025 @01:03AM (#45177608)
"LLM bad"

Very insightful.

Re:NPM debug and chalk packages compromised by Culonavirus on Tuesday September 09, 2025 @01:25AM (#45177731)
He literally said "Flagged packages are escalated to a human review team." in the second sentence. Wtf is the problem here?
Re:NPM debug and chalk packages compromised by ATechGuy on Tuesday September 09, 2025 @10:59AM (#45182830)
What about packages that are not "flagged"? There could be hallucinations when deciding to (or not) "flag packages".
Re:NPM debug and chalk packages compromised by orbital-decay on Tuesday September 09, 2025 @11:16AM (#45183112)
>What about packages that are not "flagged"?

You can't catch everything with normal static analysis either. LLM just produces some additional signal in this case, false negatives can be tolerated.

Re:NPM debug and chalk packages compromised by ATechGuy on Tuesday September 09, 2025 @11:25AM (#45183273)
static analysis DOES NOT hallucinate.
Re:NPM debug and chalk packages compromised by Twirrim on Tuesday September 09, 2025 @12:27PM (#45184369)
So what? They're not replacing standard tooling like static analysis with it. As they mention, it's being used as additional signal alongside static analysis.

There are cases an LLM may be able to catch that their static analysis can't currently catch. Should they just completely ignore those scenarios, thereby doing the worst thing by their customers, just to stay purist?

What is the worst case scenario that you're envisioning from an LLM hallucinating in this use case? To me the worst case is that it might incorrectly flag a package as malicious, which given they do a human review anyway isn't the end of the world. On the flip side, you've got LLM catching cases not yet recognised by static analysis, that can then be accounted for in the future.

If they were just using an LLM, I might share similar concerns, but they're not.

Re:NPM debug and chalk packages compromised by tripzilch on Thursday September 11, 2025 @05:20AM (#45209477)
well, you've never had a non-spam email end up in your spam folder? or the other way around?

when static analysis does it, it's called a "misclassification"

Re:NPM debug and chalk packages compromised by wiseowise on Tuesday September 09, 2025 @03:02AM (#45178490)
> We use a mix of static analysis and AI. Flagged packages are escalated to a human review team.

“Chat, I have reading comprehension problems. How do I fix it?”

Re:NPM debug and chalk packages compromised by atanasi on Wednesday September 10, 2025 @11:13AM (#45198971)
Reading comprehension problems can often be caught with some static analysis combined with AI.
Re:NPM debug and chalk packages compromised by Yoric on Thursday September 11, 2025 @03:26AM (#45208822)
So, from what I understand from your paper, you're using ChatGPT with careful prompts?
Re:NPM debug and chalk packages compromised by veber-alex on Monday September 08, 2025 @05:32PM (#45174292)
AI based code review with escalation to a human
Re:NPM debug and chalk packages compromised by Yoric on Monday September 08, 2025 @06:17PM (#45174765)
I'm curious :)

Does the AI detect the obfuscation?

Re:NPM debug and chalk packages compromised by justusthane on Monday September 08, 2025 @06:37PM (#45175006)
Probably. It’s trivial to plug some obfuscated code into an LLM and ask it what it does.
Re:NPM debug and chalk packages compromised by spartanatreyu on Monday September 08, 2025 @07:24PM (#45175437)
Yeah, but just imagine how many false positives and false negatives there would be...
Re:NPM debug and chalk packages compromised by 33a on Monday September 08, 2025 @09:27PM (#45176325)
It's actually pretty easy to detect that something is obfuscated, but it's harder to prove that the obfuscated code is actually harmful. This is why we still have a team of humans review flagged packages before we try to get them taken down, otherwise you would end up with way too many false positives.
Re:NPM debug and chalk packages compromised by Yoric on Tuesday September 09, 2025 @01:44AM (#45177854)
Yeah, what I meant is that obfuscation is a strong sign that something needs to be flagged for review. Sadly, there's only a thin line between obfuscation and minification, so I was wondering how many false positives you get.

Thanks for the links in your other comment, I'll take a look!

Re:NPM debug and chalk packages compromised by nurettin on Monday September 15, 2025 @12:22AM (#45246094)
I think that would be static analysis. After processing the source code normally (looking for net & sys calls), you decode base64, concatenate all strings and process again (until decode makes no change)