
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).
Walk a require tree for a cached module.
npm install --save cache-walk
Requiring one file typically adds more than one file to the require cache, since that file (probably) requires other files, which potentially require other files. This module let's you walk through the entire require tree of a particular module as it is in the cache.
cache-walk
exports three functions for interacting with a require tree: .get
, .walk
, and .delete
. .get
returns a list of module ids (absolute file paths), .walk
calls a function for each module encountered, and .delete
deletes an entire require tree from the cache.
var foo = require('./foo');
var cache = require('cache-walk');
// requiredModules will contain ./foo
// plus everything required by ./foo and it's children
var requiredModules = cache.get('./foo');
var foo = require('./foo');
var cache = require('cache-walk');
// The callback will be called first with the ./foo module id
// and then with everything required by ./foo and it's children
cache.walk('./foo', function(mod) {
console.log(mod);
});
var foo = require('./foo');
var cache = require('cache-walk');
// Delete ./foo from the cache along with it's children etc.
cache.delete('./foo');
These examples use relative paths, but absolute ones work as well.
Please see the contribution guidelines.
FAQs
Walk a require tree for a cached module
The npm package cache-walk receives a total of 6 weekly downloads. As such, cache-walk popularity was classified as not popular.
We found that cache-walk 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.