
Research
5 Malicious Chrome Extensions Enable Session Hijacking in Enterprise HR and ERP Systems
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.
npm-api-client
Advanced tools
A self-generating client for npm's new registry API
Note: This client was designed to work with a private API that is only accessible to employees of npm, Inc. If that API is ever made public, this client will become relevant/useful.
var npm = require('acl-client')()
npm.packages.get('browserify')
.then(function(pkg){ /* yay */ })
.catch(function(err){ /* oof */ })
api.npmjs.com set process.env.ACL_CLIENT_HOST.Every request takes an optional options object as its last argument. The following options are allowed:
ttl - time in seconds to cache the response in redis. If not set, cache will not be used. Value can also be a human-friendly string like 5 minutes or 4 hours.bearer - a string of the current username. Can be used if hapiRequest is not available. If both hapiRequest and bearer options are specified, bearer takes precedence.logger - an object with four methods: debug, info, warn, and error. See the bole API for more info.hapiRequest - a Hapi request object. If the request is from a logged-in user, this will set bearer automatically. The client will also emit log messages using the given request's logger.All PUT, POST, and DELETE operations require a bearer token. Some GET requests do too.
To inject a bearer token into the request, pass a hapi request object as the last argument, or an object with a bearer string:
npm.collaborators.get('@npm/foo', {hapiRequest: request})
// or
npm.collaborators.get('@npm/foo', {bearer: 'zeke'})
To enable the built-in redis cache, set ACL_CLIENT_REDIS_URL in the environment before
requiring the client. To cache a request, specify a TTL in seconds or a human-friendly
string like 5 hours or 20 minutes.
// set this _before_ requiring the module
process.env.ACL_CLIENT_REDIS_URL = 'redis://localhost:6379'
// initialize the client. The redis instance will be attached to each method
var npm = require('npm-api-client')()
// set a `ttl` option in seconds
npm.packages.get('browserify', {ttl: 60})
// or use a human-friendly string
npm.packages.get('browserify', {ttl: '2 hours'})
To invalidate the cache for a specific request, call that request's cache.drop method,
passing the same arguments used when making the initial request:
npm.packages.get.cache.drop('browserify')
.then(function(){
// bye-bye browserify
})
Note: the optional options object used to initially make the request, e.g.
{ttl: 60, logger: null}, need not be present when calling cache.drop()
ACL_CLIENT_HOST (required): the hostname (and optional port) to make requests to, sans http(s) scheme.ACL_CLIENT_CUSTOMER_HOST (optional): the hostname for npm.customer requestsACL_CLIENT_REDIS_URL (optional): a redis instance for caching request responsesSee dist/operations.json for more details about the methods below.
packages.get(packageName, [query], [options])packages.list([query], [options])packages.count([query], [options])packages.star(packageName, body, [options])packages.perms(packageName, [query], [options])packages.delete(packageName, [options])packages.create(body, [options])packages.getDefaultTeam(packageName, [query], [options])collaborators.list(packageName, [query], [options])collaborators.add(packageName, body, [options])collaborators.update(packageName, userName, body, [options])collaborators.delete(packageName, userName, [options])users.create(body, [options])users.update(userName, body, [options])users.get(userName, [query], [options])users.delete(userName, [options])users.login(userName, body, [options])users.verify(userName, body, [options])users.getPackages(userName, [query], [options])users.getStars(userName, [query], [options])users.createPackage(userName, body, [options])users.setLicense(userName, body, [options])users.getLicense(userName, body, [options])users.search([query], [options])teams.update(teamName, body, [options])teams.delete(teamName, [options])teams.addPackage(teamName, body, [options])teams.removePackage(teamName, [options])teams.addUser(teamName, body, [options])teams.removeUser(teamName, [options])orgs.create(body, [options])orgs.get(orgName, [query], [options])orgs.delete(orgName, [options])orgs.update(orgName, body, [options])orgs.addUser(orgName, body, [options])orgs.users.list(orgName, [query], [options])orgs.users.delete(orgName, [options])orgs.users.update(orgName, userName, body, [options])orgs.packages.list(orgName, [query], [options])orgs.packages.create(orgName, body, [options])orgs.teams.list(orgName, [query], [options])orgs.teams.create(orgName, body, [options])orgs.listScopes(orgName, [query], [options])orgs.setLicense(orgName, body, [options])customers.get(userName, [query], [options])customers.create(body, [options])customers.update(userName, body, [options])customers.delete(userName, [options])src/operations.yml defines a list of http operations. An operation looks like this:
name: packages.get
description: Get metadata for a specific npm package
path: /package/{name}
method: GET
When you require('acl-client')(), the index iterates over each
operation in the schema and binds a reusable request function to each. The end result
is a tree of functions, namespaced by their dot-delimited name property from the schema:
packages: {
get: [Function],
list: [Function],
count: [Function],
star: [Function],
perms: [Function],
delete: [Function],
create: [Function],
getDefaultTeam: [Function]
},
collaborators: {
list: [Function],
add: [Function],
update: [Function],
delete: [Function]
},
...
FAQs
A self-generating client for npm's new registry API
We found that npm-api-client 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
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.