
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
Sort groups of strings into buckets.
Inspired by OpenRefine's clustering.
The unit of analysis is a bucket. It looks like this:
const bucket = {
"commonWord": 3,
"CommonWord": 20,
"SuperRareWord": 1
}
strcluster can break your bucket into bins by computing a bin key for each
string. Here's a code sample, using the bucket from above:
import { clusterByKey } from 'clustring'
import fingerprint from 'clustring/key/fingerprint'
const bins = clusterByKey(bucket, fingerprint())
// bins is:
// [
// {
// "name": "CommonWord",
// "key": "commonword",
// "count": 23,
// "bucket": { "commonWord": 3, "CommonWord": 20 }
// },
// {
// "name": "SuperRareWord",
// "key": "superrareword",
// "count": 1,
// "bucket": { "SuperRareWord": 1}
// }
// ]
strcluster can also break your bucket into bins using a distance function to compare two strings.
Distance functions aren't cheap. A block-based approach avoids comparisons by grouping strings into "blocks" that all contain the same N sequence of characters. (Effectively, this skips comparisons by assuming infinite distance if there is no such sequence).
Here's some sample code:
import { clusterByKnn } from 'clustring'
import levenshtein from 'clustring/knn/levenshtein'
const bins = clusterByKnn(bucket, levenshtein(2), { blockSize: 5 })
// bins will be same as in previous example.
npm install
npm test -- --watch # runs tests continuously
npm run-script build -- --watch # builds continuously
Pick a feature; write a test; make it pass; commit.
version in package.jsongit commit -m 'vx.x.x && git tag vx.x.x && git push && git push origin vx.x.xnpm publishFAQs
Algorithms for clustering strings
The npm package clustring receives a total of 20 weekly downloads. As such, clustring popularity was classified as not popular.
We found that clustring demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.