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.
mustache-mailer
Advanced tools
A mustache-template-backed mailer. Built with handlebars, and nodemailer, inspired by ActionMailer.
foo.text.hbs
, for text email templates.foo.meta.hbs
, meta information in JSON format, e.g., subject
.foo.html.hbs
, for html email templates.MustacheMailer
with:transport
: the transport module you wish to use, e.g., SES.templateDir
: the path to the template directory.var mm = new MustacheMailer({
transport: require('nodemailer-ses-transport')({
accessKeyId: 'AWSACCESSKEY',
secretAccessKey: 'AWS/Secret/key'
}),
templateDir: './mail-templates'
});
MessageMailer
instance to grab a template:html
template and a text
template, both will be sent.sendMail
are sent to nodemailer
, and
to the mustache templates.var msg = mm.message('confirmation', function(err, msg) {
msg.sendMail({
to: 'bencoe@gmail.com',
name: 'Ben',
id: 'adfasdfadsfasdf'
});
}
tokenFacilitator
PluginIt often arises that you'd like to toss a token inside an email, e.g., click this confirmation link to change your password.
For generating these tokens, MustacheMailer allows you to install a
tokenFacilitator
plugin:
var mm = new MustacheMailer({
transport: mock,
templateDir: path.resolve(__dirname, './fixtures'),
// a fake token facilitator.
tokenFacilitator: {
generate: function(data, cb) {
setTimeout(function() {
data.email.should.eql('zeke@example.com');
data.name.should.eql('Zeke');
return cb(null, parseInt(Math.random() * 256));
}, 20);
}
}
});
http://example.com/{{{tokenHelper name=name email=email}}}
key
, value
pairs in data.FAQs
send emails using nodemailer, and mustache templates.
We found that mustache-mailer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 28 open source maintainers 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.