Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Lets you spy on a chain
$ npm install chain-spy
import { create } from 'chain-spy'
function select(db) {
return db
.select('id', 'name', 'age')
.where('name', 'Daenerys')
.sort('age')
.someFunction(5)
}
const dbProxy = create({ someFunction: n => n })
const result = select(dbProxy)
console.log(result)
// 5
console.log(dbProxy.__execution_log__)
// [ { type: 'get', name: 'select' },
// { type: 'apply', args: [ 'id', 'name', 'age' ] },
// { type: 'get', name: 'where' },
// { type: 'apply', args: [ 'name', 'Daenerys' ] },
// { type: 'get', name: 'sort' },
// { type: 'apply', args: [ 'age' ] } ]
// { type: 'get', name: 'someFunction' },
// { type: 'apply', args: [ 5 ] } ]
// Can be used with snapshot testing, eg.
expect(dbProxy.__execution_log__).toMatchSnapshot() // jest
t.snapshot(dbProxy.__execution_log__); // ava
Type: object
Can overwrite the return value of a property. eg.
const proxy = create({ hello: 'world', cat: n => n + 1 })
proxy.hello // world
proxy.something.hello // world
proxy.something('else').hello // world
proxy.cat(1) // 2
Can also access the proxy inside a overwrite function:
const proxy = create({ hello: function(n) {
return n === 5 ? 7 : this
}})
proxy.hello(1).hello(2).hello(5) // 7
MIT
FAQs
Lets you spy on a chain
The npm package chain-spy receives a total of 13 weekly downloads. As such, chain-spy popularity was classified as not popular.
We found that chain-spy 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.