
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).
Load config from a javascript object.
When JSON is too limiting; you need to dynamically set values, include comments or external files in your configuration, jsconf is the tool for you.
npm i jsconf --save
load from a file
var jsconf = require('jsconf')
var config = jsconf.load('/path/to/config.jsconf')
console.log(config)
parse a string
var config = jsconf.parse('{x: +new Date}')
console.log(config)
load from a file with exposed variables
var jsconf = require('jsconf')
// The jsconf object will now have access the variable `cwd`
jsconf.context.cwd = process.cwd()
var config = jsconf.load('/path/to/config.jsconf')
console.log(config)
A jsconf file contains a single javascript object declaration. There cannot be any executable code outside the object. Comments are allowed anywhere.
These are the perks:
Dynamic Properties
{
created: +new Date,
nuance: ~~(100 + (Math.random() * 1000)),
guid: (function(x){return x % 200})(+new Date) // closure FTW!
}
C-style Comments
/**
* Database Configuration
* blah blah blah
*/
{
mysql: {
host: '127.0.0.1',
port: 3306,
user: 'DB_USER',
password: 'DB_PASS',
database: 'DB_NAME',
//socketPath: '/opt/local/var/run/mysql55/mysqld.sock',
// Settings
connectionLimit: 10, // Max number of connections to create at once
multipleStatements: true, // Allow multiple mysql statements per query
},
}
Include External Files
{
https: {
port: 443,
creds: {
'key': fs.readFileSync('./app/config/ssl-certs/server.key'),
'cert': fs.readFileSync('./app/config/ssl-certs/server.crt'),
'ca': fs.readFileSync('./app/config/ssl-certs/ca.crt'),
'requestCert': true,
'rejectUnauthorized': false
}
},
}
FAQs
Load config from a javascript object
We found that jsconf 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.