
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).
Minimalist utilities for backend services.
NOTE: Version
0.4.0
and above uses ESM module (i.e.,type: module
) only.
Provides a BaseLog
class with a LogWriter
driver architecture.
import {BaseLog, LogWriter} from 'backlib';
interface WebLogRecord {
...
}
class WebLog extends BaseLog<WebLogRecord>{
constructor() {
const writers: LogWriter<WebLogRecord>[] = [];
const baseName = 'web_log';
// Add custom writer using redstream (Redis Stream) for realtime login
const logStream = getWebLogStream(); // not provided
writers.push({
name: baseName + '_stream',
writeRec: async (rec: WebLogRecord) => {
await logStream.xadd(rec);
}
});
super({ writers });
}
}
const _webLog = new WebLog(); // must be after ServiceLog definition
export webLog(rec: WebLogRecord){
_webLog.log(rec);
}
Know if a decorator method is at the leaf
of the class tree. Usefull when want to apply logic one one per method name.
// One per decorator
const leafTracer = newLeafTracer();
export function MethodDec() {
return function (target: Object, propertyKey: string, descriptor: TypedPropertyDescriptor<any>) {
// original method
const method = descriptor.value!;
descriptor.value = async function methodDecWrapper() {
// must be called on each invocation (because of order of Decoration eval at init time).
// However, flag is cache, so fast check.
const isLeaf = leafTracer.trace(this.constructor, target.constructor, propertyKey);
if (isLeaf){
// here logic to be apply only for the top most method for a given name for this class inheritance tree
}
const result = method.apply(this,arguments);// exec and get result
if (isLeaf){
// eventual logic post execution
}
return result;
}
}
}
FAQs
Minimalist library for backend services
The npm package backlib receives a total of 4 weekly downloads. As such, backlib popularity was classified as not popular.
We found that backlib 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.