
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@hono/standard-validator
Advanced tools
The validator middleware using Standard Schema Spec for Hono applications. You can write a schema with any validation library supporting Standard Schema and validate the incoming values.
import { z } from 'zod'
import { sValidator } from '@hono/standard-validator'
const schema = z.object({
name: z.string(),
age: z.number(),
})
app.post('/author', sValidator('json', schema), (c) => {
const data = c.req.valid('json')
return c.json({
success: true,
message: `${data.name} is ${data.age}`,
})
})
app.post(
'/post',
sValidator('json', schema, (result, c) => {
if (!result.success) {
return c.text('Invalid!', 400)
}
})
//...
)
Headers are internally transformed to lower-case in Hono. Hence, you will have to make them lower-cased in validation object.
import { object, string } from 'valibot'
import { sValidator } from '@hono/standard-validator'
const schema = object({
'content-type': string(),
'user-agent': string(),
})
app.post('/author', sValidator('header', schema), (c) => {
const headers = c.req.valid('header')
// do something with headers
})
Rokas Muningis https://github.com/muningis
MIT
FAQs
Validator middleware using Standard Schema
The npm package @hono/standard-validator receives a total of 173,181 weekly downloads. As such, @hono/standard-validator popularity was classified as popular.
We found that @hono/standard-validator 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.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.