by feross · 2y ago · 0 comments
This is what Socket AI produces when given @ledgerhq/connect-kit 1.1.7 to analyze:
> The obfuscated code block is highly suspicious and likely contains malicious behavior. The presence of obfuscation and the unclear purpose of the code raise significant red flags.
Feeling very proud of our team right now as this validates that our static analysis + LLM approach works well on novel malicious dependencies. If you're interested, we maintain a listing of malicious packages detected by this system [3].
Small plug: If you’d like real-time protection against attacks like this, you can install Socket for GitHub to automatically scan every PR in your repo. The free plan is incredibly generous. If you do decide to install it, it’s important that you enable the ‘AI Detected Security Risk’ alert type in your Security Policy to activate this protection.
[1]: https://socket.dev
[2]: https://socket.dev/blog/introducing-socket-ai-chatgpt-powere...
I'll see if we can write up a bit about how it works in a future blog post.
[1]: https://socket.dev/npm/package/@ledgerhq/connect-kit-loader
[2]: https://github.com/LedgerHQ/connect-kit/blob/main/packages/c...
[3]: https://socket.dev/npm/package/@ledgerhq/connect-kit-loader/...
We don't currently detect 'implicit dependencies' loaded via CDN URLs, though we'll look into what it would take to support this.
How about a multi-stage system that uses the LLM to attempt analysis of the statistically-detected high entropy regions by way of an assortment of tools, such as b64 decode?
I like where you are headed with this. Just some thoughts I had.