
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Creates a clone of the http class that signs each request before its sent.
Usage:
var elasticsearch = require('elasticsearch');
require('aws_es')(elasticsearch);
var client = new elasticsearch.Client({
host : 'xxxxx.es.amazonaws.com',
amazonES: {
region : 'us-east-1',
accessKey : 'XXXX',
secretKey : 'XXXX'
}
})
Config variables service
, region
, accessKey
and secretKey
can be defined in an amazonES
object at client creation. Alternatively, service defaults to 'es', region defaults to 'us-east-1' and the keys default to environment variables: AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
The complete code is as follows:
var aws4 = require('aws4');
module.exports = function(es) {
var pool = es.ConnectionPool,
http = pool.connectionClasses.http;
var aws = function() { http.apply(this,arguments); };
require('util').inherits(aws,http);
aws.prototype.createAgent = function(config) {
this._amazonES = config.amazonES || {};
http.prototype.createAgent.call(this,config);
};
aws.prototype.makeReqParams = function (_params) {
var params = http.prototype.makeReqParams.call(this,_params);
params.body = _params.body;
params.headers = params.headers || {};
params.headers['Content-Type'] = params.headers['Content-Type'] || 'application/json';
if (params.gzip === undefined) params.gzip = true;
var config = this._amazonES;
params.service = config.service || 'es';
params.region = config.region || 'us-east-1';
aws4.sign(params,{
accessKeyId: config.accessKey || process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: config.secretKey || process.env.AWS_SECRET_ACCESS_KEY
});
return params;
};
pool.defaultConnectionClass = 'aws';
pool.connectionClasses.aws = aws;
return es;
};
FAQs
Creates a clone of the http class that signs each request before its sent.
The npm package aws_es receives a total of 3 weekly downloads. As such, aws_es popularity was classified as not popular.
We found that aws_es 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.