
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
ftp-session-store
Advanced tools
Express Session Store On FTP
import express from 'express'; // const express = require('express');
import session from 'express-session'; // const session = require('express-session');
import { join } from 'path';
import SessionStore from 'ftp-session-store'; // const SessionStore = require('ftp-session-store');
const app = express();
/**
* @type {import('express-session')['SessionOptions']}
*/
const sess = {
/**
* generate session id by client IP and user agent
* * Optional
*/
genid: function (req) {
const ip =
req.headers['x-forwarded-for'] ||
req.socket.remoteAddress ||
req.connection.remoteAddress;
const isValidIP = typeof ip === 'string' && ip.trim().length > 0;
const ua = req.get('User-Agent');
const isValidUA = typeof ua === 'string' && ua.trim().length > 0;
if (isValidIP && isValidUA) {
return String(ip + ua).replace(/[^a-zA-Z0-9]/gm, '');
}
if (isValidIP) {
return String(ip).replace(/[^a-zA-Z0-9]/gm, '');
}
return 'uid';
},
secret: 'keyboard cat',
cookie: {
secure: false,
// 1 day expiration example
maxAge: 1 * 24 * 3600 * 1000
},
store: new SessionStore({
// store folder
path: join(__dirname, '../tmp/sessions'),
// ftp connection information
connection: {
host: process.env.FTP_HOST,
port: parseInt(process.env.FTP_PORT || '21'),
user: process.env.FTP_USER,
password: process.env.FTP_PASS,
protocol: process.env.FTP_PROTOCOL,
root: process.env.FTP_PATH
}
}),
resave: true,
saveUninitialized: false
};
if (app.get('env') === 'production') {
app.set('trust proxy', 1);
if ('cookie' in sess && typeof sess.cookie == 'object') {
sess.cookie.secure = true;
}
}
app.use(session(sess));
FAQs
Express Session Store On FTP
The npm package ftp-session-store receives a total of 0 weekly downloads. As such, ftp-session-store popularity was classified as not popular.
We found that ftp-session-store 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.