
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
express-request-logger
Advanced tools
An easy way to create a key/value pair list to be logged on each request in express.
$ cd /path/to/your/project
$ npm install express-request-logger
This package is meant to be used as middleware for a web app using Express. It will allow you to create a key/value pair list of data to get logged per request. Using this it can output data to allow you to analyze how your web app is being used.
Since response time is a part of the logging output, express-request-logger should be put as early in the middleware chain as possible.
var winston = require('winston');
var reqLogger = require('express-request-logger');
var logger = new (winston.Logger)({ transports: [ new (winston.transports.Console)() ] });
app.use(reqLogger.create(logger));
The req
object will now have a kvLog
object that can have extra data added to it. At the end of the request it will be logged with all the other data collected.
function (req, res, next) {
// ...
req.kvLog.action = 'test';
// ...
}
The key message
is special, it will be removed from the object and be sent to the logger as the true message. It is optional, so if it is not included, the log will just contain an empty message.
Currently it is recommended to use winston as the logger object, but any object that can be called like loggerObj.log(level, message, {key: value})
will work.
FAQs
Log anything you want per request
We found that express-request-logger 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
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.