
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.

import { Confeta, types } from 'confeta'
import ConfetaEnv from 'confeta-env'
import ConfetaArgv from 'confeta-argv'
import ConfetaFile from 'confeta-file'
import changeCase from 'change-case'
let config = Confeta({
mongoUrl: {
type: types.string,
description: 'Mongo Url',
default: 'mongo://localhost:27017'
},
timeout: {
type: types.integer
},
host: {
type: { // nested object
domain: {
type: types.string,
description: 'Domain name',
required: true
},
port: {
type: types.integer,
description: 'Port',
required: true
}
}
}
})
.addSource(ConfetaEnv({prefix: 'MYAPP__', separator: '__'}), changeCase.constantCase)
.addSource(ConfetaArgv())
.addSource(ConfetaFile({parseFn: JSON.parse, path: 'config.json'}))
.build()
Full example can be seen in ./example
I got tired of nconf inability to handle different naming conventions between different sources (e.g. CONSTANT_CASE in process.env vs camelCase in json file). So I created a new, more customisable library where you can specify schema for your configuration and map schema names to different sources. With schema you can specify exactly what type do you expect and avoid annoying situation when you have to parse value manually after getting it from config. Also some simple validation I think is nice.
Yes, core confeta package has no sources in it. You have to either install a separate package with source you need for your app or implement your own one (which is very simple btw)
Officially supported sources:
options:
Returns object containting all settings fetched from sources
It's very simple, all you have to do is provide object which exposes .get(segments) function. It will be called every time Confeta tries to fetch value and segments will be an array of strings which represents a path to value in a schema tree.
MIT
FAQs
Confeta core package
The npm package confeta receives a total of 31 weekly downloads. As such, confeta popularity was classified as not popular.
We found that confeta 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.