
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).
Data validation for Python, inspired by the Laravel framework.
Documentation: https://mdoesburg.github.io/spotlight/
Source Code: https://github.com/mdoesburg/spotlight
Spotlight can be installed via pip:
pip install spotlight
To validate data, we start by defining validation rules for each field we want to validate. After that, we pass the data and the validation rules into the Validator's validate method.
Lets have a look at a simple example:
from spotlight import Validator
rules = {
"id": "required|integer",
"email": "required|email",
"first_name": "required|string",
"last_name": "required|string",
"password": "required|min:8|max:255",
}
data = {
"id": 1,
"email": "john.doe@example.com",
"first_name": "John",
"last_name": "Doe",
"password": "test",
}
validator = Validator()
errors = validator.validate(data, rules)
The validate method will return a dictionary of errors, if any occurred.
In the example above, the validate method will return the following errors:
{"password": ["The password field has to be at least 8 characters."]}
Alternatively, validation rules may be specified as lists of rules instead of a single | delimited string:
rules = {
"id": ["required", "integer"],
"email": ["required", "email"],
"first_name": ["required", "string"],
"last_name": ["required", "string"],
"password": ["required", "min:8", "max:255"],
}
The full documentation can be found here.
FAQs
Data validation for Python, inspired by the Laravel framework.
We found that spotlight 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.