
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@saghen/hermes
Advanced tools
Hermes provides a generic interface for one way (Endpoints) and two way (Sockets) communication. It requires a transport for sending data between the server and client. The library provides transport implementations for HTTP (Endpoints only), Websocket, Web postMessage
, Browser Extension browser.runtime.sendMessage/port
and a loopback.
import { createRouter, createEndpointClient, createSocketClient, Socket } from './src'
import { createLoopback, LoopbackRequestMetadata } from './src/transports/loopback'
const loopback = createLoopback()
// Setup router
const endpoints = {
add: async (a: number, b: number) => a + b,
deep: {
echo: async (message: string) => message,
},
fail: () => Promise.reject('This endpoint fails'),
metadata: async (hello: 'world', metadata: LoopbackRequestMetadata) => hello,
}
const sockets = {
echo: async (socket: Socket<any, any>) => {
for await (const message of socket.receiveIter()) {
await socket.send(message)
}
},
test: async () => {},
}
const router = createRouter(endpoints, sockets)
loopback.listen(router)
// Setup clients
const endpointClient = createEndpointClient<typeof router.endpoints>(loopback.endpointTransport)
const socketClient = createSocketClient<typeof router.sockets>(loopback.socketTransport)
// Test endpoint client
await endpointClient.add(1, 2).then(console.log) // '3'
await endpointClient.deep.echo('foo').then(console.log) // 'foo'
await endpointClient.fail().catch(console.error) // 'This endpoint fails'
await endpointClient.metadata('world') // the second argument metadata passed by loopback transport
// Test socket client
const socket = await socketClient.echo()
await socket.send('Hello world!')
await socket.receive().then(console.log) // 'Hello world'
FAQs
Generic interface for one and two way communication layer
The npm package @saghen/hermes receives a total of 619 weekly downloads. As such, @saghen/hermes popularity was classified as not popular.
We found that @saghen/hermes 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
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.