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.
An NPM library that exposes max arity and other metadata for JS functions
This package implements the es-shim API interface. It works in an ES6-supported environment and complies with the spec (TODO this is a lie. Write a proposal).
"Arity" refers to the number of parameters a function declares.
function (a, b, c) {}
declares 3 parameters so has a minimum and maximum arity of 3.
function (a, b = 0, ...rest) {}
declares 3 parameters. It has a minimum arity of 1 since
there is no default value for a. It has a maximum arity of 3 since that is the number declared.
It uses a rest parameter ...rest
so it can actually take additional parameters.
npm install arity-of
const arityOf = require('arity-of');
function myFunction(a, b = 0, [c, d], ...e) {
// ...
}
myFunction.length; // Minimum arity
const {
max, // Maximum arity (including any ...restParamater)
usesRest, // True if there is a ...restParameter.
} = arityOf(myFunction);
FAQs
Exposes max arity and other metadata for JS functions
The npm package arity-of receives a total of 1 weekly downloads. As such, arity-of popularity was classified as not popular.
We found that arity-of 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.