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.
___ /
_-_- _/\____ / __\\__
_-_-__ / ,-. -| / - ,-.`-.
_-_- `( o )-- / --( o )-'
`-' / `-'
tunel (n): RESTful message tunneling over IPC.
Here’s the code for Electron’s main thread:
//
// Main Thread
//
const electron = require('electron');
const channel = electron.ipcMain;
const { app, registerChannel } = require('tunel/server');
registerChannel(channel);
// `app` API is similar to `express.js`
app.get('/api/v1/profile', async req => {
// You can access req.body, req.params…
void req;
// Unlike express, there is no `res` object.
// As soon as you return from the function, you’ll relay
// a response back.
// So, returning a JSON `json`, is similar to `res.send(json)`.
return {
userName: 'robert',
fullName: 'Robert Denir Ona'
};
});
Here’s the cod for Electron’s renderer thread (i.e., the browser):
//
// Renderer Thread
//
import request from 'tunel';
const doFetch = async () => {
// `request` API is similar to `axios`.
const response = await request({
method: 'GET',
url: '/api/v1/profile',
data: { some: 'payload' },
headers: {
'Content-Type': 'application/json'
}
});
// Will log
// `{ status: 200, data: { userName: 'robert',
// fullName: 'Robert Denir Ona' }}`
console.log(response);
};
doFetch();
FAQs
tunel is a RESTful message tunnel over IPC.
The npm package tunel receives a total of 2 weekly downloads. As such, tunel popularity was classified as not popular.
We found that tunel 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’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.