
Research
Namastex.ai npm Packages Hit with TeamPCP-Style CanisterWorm Malware
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.
A naive diff algorithm based on the unique key path of each value in an Object / JSON
A naive diff algorithm based on the unique key path of each value in an Object / JSON
$ npm install flat-diff --save
Given:
import diff from 'flat-diff';
const base = {
a: [1, 2, { b: 1 }, 4, 5, 6],
b: 'test',
c: 'prev'
};
const target = {
a: [1, 2, { b: 2 }, 4, 6],
b: 'test 2',
d: 'new'
};
const metadata = diff(base, target);
will give a result of:
const metadata = [
{ path: 'a.0', type: 'same', value: 1 },
{ path: 'a.1', type: 'same', value: 2 },
{ path: 'a.2.b', type: 'put', prev: 1, value: 2 },
{ path: 'a.3', type: 'same', value: 4 },
{ path: 'a.4', type: 'put', prev: 5, value: 6 },
{ path: 'a.5', type: 'del', value: 6 },
{ path: 'b', type: 'put', prev: 'test', value: 'test 2' },
{ path: 'c', type: 'del', value: 'prev' },
{ path: 'd', type: 'post', value: 'new' }
];
// Note: path keys will be sorted.
Due to how keys are generated, if you have an array and object with number keys in the same path, there will be a conflict.
i.e.
// object
{
a: {
'0': 'b',
'1': 'c'
}
}
// array
{
a: ['b', 'c']
}
// both formats above will result in similar paths:
[
{path: 'a.0', value: 'b'},
{path: 'a.1', value: 'c'}
]
flat-diff is MIT licensed
FAQs
A naive diff algorithm based on the unique key path of each value in an Object / JSON
The npm package flat-diff receives a total of 1 weekly downloads. As such, flat-diff popularity was classified as not popular.
We found that flat-diff 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
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.