Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@hitorisensei/errors.wrap
Advanced tools
This is a simple library for wrapping errors with additional context messages for rethrowing without losing the original error stack trace and message.
This is a simple library for wrapping errors with additional context messages for rethrowing without losing the original error stack trace and message.
function connectDatabase() {
throw new Error('Database connection failed');
}
function startApp() {
try {
connectDatabase();
} catch (err) {
throw err;
}
}
try {
startApp();
} catch (err) {
console.error(err);
}
Error: Database connection failed
at connectDatabase (test-nowrap.js:3:9)
at startApp (test-nowrap.js:8:5)
at Object.<anonymous> (test-nowrap.js:16:3)
at Module._compile (node:internal/modules/cjs/loader:1112:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
at Module.load (node:internal/modules/cjs/loader:988:32)
at Module._load (node:internal/modules/cjs/loader:834:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
const { wrap } = require('@hitorisensei/errors.wrap');
function connectDatabase() {
throw new Error('Database connection failed');
}
function startApp() {
try {
connectDatabase();
} catch (err) {
throw wrap(err, 'Cannot start app');
}
}
try {
startApp();
} catch (err) {
console.error(err);
}
Error: Cannot start app: Database connection failed
at startApp (/Users/hitori/Projekty/wrap/test-wrap.js:11:11)
at Object.<anonymous> (/Users/hitori/Projekty/wrap/test-wrap.js:16:3)
at Module._compile (node:internal/modules/cjs/loader:1112:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
at Module.load (node:internal/modules/cjs/loader:988:32)
at Module._load (node:internal/modules/cjs/loader:834:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
Error: Database connection failed
at connectDatabase (/Users/hitori/Projekty/wrap/test-wrap.js:4:9)
at startApp (/Users/hitori/Projekty/wrap/test-wrap.js:9:5)
at Object.<anonymous> (/Users/hitori/Projekty/wrap/test-wrap.js:16:3)
at Module._compile (node:internal/modules/cjs/loader:1112:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
at Module.load (node:internal/modules/cjs/loader:988:32)
at Module._load (node:internal/modules/cjs/loader:834:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
FAQs
This is a simple library for wrapping errors with additional context messages for rethrowing without losing the original error stack trace and message.
We found that @hitorisensei/errors.wrap 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.