
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
@knighted/specifier
Advanced tools
@knighted/specifier
Node.js tool for parsing imports to change ESM and CJS specifiers.
import
, import()
, import.meta.resolve()
, export
, require
, and require.resolve()
.Given a file with some imports and exports:
// file.ts
import { someLib } from 'some-package'
import { foo } from './path/to/foo.js'
export { bar } from './path/to/bar.js'
You can use specifier
to change the values:
import { specifier } from '@knighted/specifier'
const update = await specifier.update('file.ts', ({ value }) => {
if (value === 'some-package') {
return 'some-package/esm'
}
return value.replace('.js', '.mjs')
})
console.log(update)
/*
import { someLib } from 'some-package/esm'
import { foo } from './path/to/foo.mjs'
export { bar } from './path/to/bar.mjs'
*/
Or collect the AST nodes:
import { type Spec, specifier } from '@knighted/specifier'
const nodes: { node: Spec['node']; parent: Spec['parent'] }[] = []
await specifier.update('file.ts', ({ node, parent }) => {
nodes.push({ node, parent })
})
nodes.forEach(({ node, parent }) => {
// Do something with the metadata
})
FAQs
Node.js tool for updating your ES module and CommonJS specifiers.
We found that @knighted/specifier demonstrated a healthy version release cadence and project activity because the last version was released less than 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
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.