Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Safely retrieve the request parameters from an incoming HTTP request
const { get } = require('get-param');
// Some middleware
(req, res, next) => {
const param = get(req, 'myParam');
// Example 1: Query Parameter
// req = { query: { myParam: 'this is my query param' }};
param === 'this is my query param'
// Example 2: Body Parameter
// req = { body: { myParam: 'this is my body param' }};
param === 'this is my body param'
// Example 3: Duplicate Parameter, defaults to body
// req = { body: { myParam: 'this is my body param' }, query: { myParam: 'this is my query param' }};
param === 'this is my body param'
}
const { get } = require('get-param');
// Some middleware
(req, res, next) => {
const param = get(req, 'myParam');
// Example 1: Parameter not defined
// req = { query: { someOtherParam: 'this is my query param' }};
param === false
// Example 2: req not passed
// req = undefined or null
param === false
}
FAQs
Retrieve the request parameters from an incoming HTTP request
We found that get-param 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.