
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
@bicycle-codes/message
Advanced tools
Create and verify signed messages with the webcrypto API.
npm i -S @bicycle-codes/message
import { Keys } from '@bicycle-codes/keys'
import { create } from '@bicycle-codes/message'
const alicesKeys = await Keys.create()
const req = await create(alicesKeys, { hello: 'world' })
The returned object has a format like
{
author: 'did:key:...',
signature: '123abc',
...message
}
[!NOTE]
The message will have the fieldsauthor
andsignature
appended to it.author
is the DID that was used to sign this message. It is read byverify(message)
.
import { test } from '@substrate-system/tapzero'
import { Keys } from '@bicycle-codes/keys'
import { create } from '@bicycle-codes/message'
let req:SignedMessage<{ hello: 'world' }>
const alicesKeys = await Keys.create()
test('create a message', async t => {
req = await create(alicesKeys, { hello: 'world' })
t.ok(req, 'request was created')
t.equal(typeof req.signature, 'string', 'should have a signature')
t.ok(req.author.includes('did:key:'), 'should have an author field')
t.equal(req.hello, 'world', 'should have the properties we passed in')
})
import { test } from '@nichoth/tapzero'
import { verify } from '@bicycle-codes/message'
test('verify a message', async t => {
// `req` is the message we created above
const isOk = await verify(req)
t.equal(isOk, true, 'should return true for a valid message')
})
FAQs
Create and verify signed messages
The npm package @bicycle-codes/message receives a total of 27 weekly downloads. As such, @bicycle-codes/message popularity was classified as not popular.
We found that @bicycle-codes/message 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
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.