
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-provider/memory
Advanced tools
It provides CRUD methods for objects stored in memory.
Read the Data Provider docs to learn how to use addons.
When querying providers created with this addon, the query object can have one of the next properties:
prop
(String): Specific property of the object to be accessed.import { Memory } from "@data-provider/memory";
const sessionStatus = new Memory({
id: "session-status",
initialState: {
data: {
loggedIn: false
}
}
});
sessionStatus.query({ prop: "loggedIn" }).update(true);
sessionStatus.query({ prop: "loggedIn" }).read().then(result => {
console.log("Is logged in", result);
// true
});
Apart of the common Data Provider methods, next ones are available:
update(data)
Updates an specific property of the stored object when the provider is queried, or the full object when not. When the object is modified, it will automatically cleans the cache of the provider and also the cache of the parent provider when it is queried (as modifying a property also modifies the full object).
data
(Any): New data to be set.// modifies an specific property
sessionStatus.query({ prop: "loggedIn" }).update(true);
// Overwrites full object
sessionStatus.update({
loggedIn: true
});
delete()
Removes an specific property of the stored object when the provider is queried, or sets the full object as empty when not. When the object is modified, it will automatically cleans the cache of the provider and also the cache of the parent provider when it is queried (as deleting a property also modifies the full object).
// removes an specific property
sessionStatus.query({ prop: "loggedIn" }).delete();
// Sets the full object as {}
sessionStatus.delete();
Providers created with this addon will have automatically the memory
tag, so you can select all of them together using the providers
methods as in:
import { providers } from "@data-provider/core";
providers.getByTag("memory").cleanCache();
Contributors are welcome. Please read the contributing guidelines and code of conduct.
FAQs
Memory origin addon for Data Provider
We found that @data-provider/memory 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.