Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
pattern-key-compare
Advanced tools
Implementation of PATTERN_KEY_COMPARE
of Node.js resolver algorithm.
It implements the updated algorithm:
PATTERN_KEY_COMPARE(keyA, keyB)
keyA
contains only a single "*"
.keyB
contains only a single "*"
.baseLengthA
be the index of "*"
in keyA
plus one.baseLengthB
be the index of "*"
in keyB
plus one.baseLengthA
is greater than baseLengthB
, return -1
.baseLengthB
is greater than baseLengthA
, return 1
.keyA
is greater than the length of keyB
, return -1
.keyB
is greater than the length of keyA
, return 1
.0
.Assert: keyA/B ends with "/" or contains only a single "*"
Note that this is not correct as nowadays it supports file extensions. e.g.:
#a/b.js
./foo/*.js
# npm
npm install pattern-key-compare
# yarn
yarn add pattern-key-compare
# pnpm
pnpm add pattern-key-compare
# rush
rush add -p pattern-key-compare
import { patternKeyCompare } from 'pattern-key-compare'
[...].sort(patternKeyCompare)
FAQs
PATTERN_KEY_COMPARE implementation
The npm package pattern-key-compare receives a total of 6,718 weekly downloads. As such, pattern-key-compare popularity was classified as popular.
We found that pattern-key-compare 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.