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.
force-ssl-heroku
Advanced tools
An express middleware that redirects unencrypted HTTP requests to HTTPS
An express middleware that redirects unencrypted HTTP requests to HTTPS on Heroku instances.
Heroku does SSL termination at its load balancer. However, the internal nodeJS app can tell if the original request was made with HTTP by inspecting headers inserted by Heroku. We can use this to redirect to the HTTPS Heroku url.
npm install force-ssl-heroku --save
It's designed for use with express:
var express = require('express');
var forceSsl = require('force-ssl-heroku');
var app = express();
app.use(forceSsl);
// Example:
app.get('/ping', pingHandler); // I'll now redirect to HTTPS.
// ... configure the rest of your routes.
app.listen(3000, 'localhost');
It works because Heroku exposes your app through a reverse proxy which is used for load-balancing and other things. This reverse proxy does SSL termination and forwards to your app which should only accept connections from localhost. The middleware detects this situation by inspecting headers inserted by Heroku's reverse proxy; since headers can be spoofed, you should not use this middleware anywhere that's not behind such a proxy!
FAQs
An express middleware that redirects unencrypted HTTP requests to HTTPS
The npm package force-ssl-heroku receives a total of 1,114 weekly downloads. As such, force-ssl-heroku popularity was classified as popular.
We found that force-ssl-heroku 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.