
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Express middleware to rehost and resize images
$ npm install rehost
var express = require('express');
var rehost = require('rehost');
var app = express();
app.use('/:rehost.:format', rehost());
app.listen(3000);
Requesting the following URL on the server:
http://localhost:3000/aHR0cDovL2V4YW1wbGUuY29tL2ltYWdlLnBuZw.jpg?resize=500x500
Will fetch, resize and convert the image at:
The source URL is encoded using "Base 64 Encoding with URL and Filename Safe Alphabet" from RFC 4648 without padding.
Example in JavaScript:
var base64 = require('base64-url');
var url = 'http://example.com/image.jpg'
var enc = base64.encode(url);
Example in Ruby:
require 'base64'
url = 'http://example.com/image.jpg'
enc = Base64.urlsafe_encode64(url, padding: false)
The resize parameter is a subset of ImageMagick geometry:
<width>x<height>{!}.
The format parameter to convert the image can be jpg or png.
The rehost, resize and format parameters can be in the query string or
the path of the request. They can also be defined in an optional options
object passed to the middleware function.
No caching is done on the server so it should be running behind a CDN.
Copyright (c) 2017 Vincent Ollivier. Released under MIT.
FAQs
Express middleware to rehost and resize images
We found that rehost 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.