
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).
ajv-error-messages
Advanced tools
Normalise errors from ajv to a simpler format.
Takes ajv errors and returns a simpler object. Inspired by https://github.com/MauriceButler/jayschema-error-messages
v2 of ajv-error-messages
has been upgraded to work with v8 of ajv
var normalise = require('ajv-error-messages');
var SchemaValidator = require('ajv');
var schemaValidator = SchemaValidator({ allErrors: true });
var schema = {
description: 'test schema',
type: 'object',
additionalProperties: false,
required: ['foo'],
properties: {
foo: {
type: 'string',
},
},
};
var invalidData = {
foo: 2,
};
var validator = schemaValidator.compile(schema);
function validatingData(data) {
var valid = validator(data);
var normalisedErrors;
if (!valid) {
var ajvErrors = validator.errors
normalisedErrors = normalise(ajvErrors);
}
return valid || normalisedErrors;
}
console.log(JSON.stringify(validatingData(invalidData)));
results in
{
fields: {
'foo': ['Must be string']
}
}
FAQs
Normalise AJV error messages
The npm package ajv-error-messages receives a total of 184 weekly downloads. As such, ajv-error-messages popularity was classified as not popular.
We found that ajv-error-messages 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
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.