
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
web-ext-native-msg
Advanced tools
Helper modules for WebExtensions native messaging host.
Browser | Windows | Linux | Mac |
---|---|---|---|
Firefox | ✓ | ✓ | ✓ |
Thunderbird | ✓ | ✓ | ✓ |
Waterfox Current | ✓ | ✓ | ✓ |
LibreWolf | ✓ *1 | ✓ | |
Chrome | ✓ | ✓ | ✓ |
Chrome Beta | ✓ *2 | ✓ | ✓ |
Chrome Canary | ✓ *2 | ✓ | |
Chromium | ✓ | ✓ | |
Brave | ✓ *2 | ✓ | ✓ |
Edge | ✓ | ✓ | ✓ |
Opera | ✓ *2 | ✓ *2 | |
Vivaldi | ✓ *2 | ✓ | ✓ |
*1: Shares host with Firefox. *2: Shares host with Chrome.
npm i web-ext-native-msg
Creates shell script, application manifest for specified browser.
Sample:
import { Setup } from 'web-ext-native-msg';
const handlerAfterSetup = info => {
const { configDirPath, shellScriptPath, manifestPath } = info;
// do something
};
const setup = new Setup({
hostDescription: 'Description of the host',
hostName: 'hostname',
mainScriptFile: 'index.js',
chromeExtensionIds: ['chrome-extension://xxxxxx'],
webExtensionIds: ['mywebextension@asamuzak.jp'],
callback: handlerAfterSetup
});
setup.run();
Construct:
Properties:
C:\Users\[UserName]\AppData\Roaming\[hostName]\config\
.~/Library/Application Support/[hostName]/config/
.~/.config/[hostName]/config/
.false
.index.js
.{
configDirPath: {string} - Config dir path.
shellScriptPath: {string} - Shell script path.
manifestPath: {string} - Application manifest path.
}
Methods:
Decode / encode native messages exchanged between browser and host.
Sample:
import process from 'node:process';
import { Input, Output } from 'web-ext-native-msg';
const handleReject = e => {
e = (new Output()).encode(e);
e && process.stdout.write(e);
return false;
};
const writeStdout = async msg => {
msg = await (new Output()).encode(msg);
return msg && process.stdout.write(msg);
};
const handleMsg = async msg => {
// do something
};
const input = new Input();
const readStdin = chunk => {
const arr = input.decode(chunk);
const func = [];
Array.isArray(arr) && arr.length && arr.forEach(msg => {
msg && func.push(handleMsg(msg));
});
return Promise.all(func).catch(handleReject);
};
process.stdin.on('data', readStdin);
Construct:
Input method:
Output method:
Spawns child process.
Sample:
import path from 'node:path';
import process from 'node:process';
import { ChildProcess, CmdArgs } from 'web-ext-native-msg';
const arg = '-a -b -c';
const cmdArgs = (new CmdArgs(arg)).toArray();
const app = path.resolve(path.join('path', 'to', 'myApp.exe'));
const file = path.resolve(path.join('path', 'to', 'myFile.txt'));
const opt = {
cwd: null,
encoding: 'utf8',
env: process.env
};
const proc = (new ChildProcess(app, cmdArgs, opt)).spawn(file).catch(e => {
throw e;
});
Construct:
{cwd: null, env: process.env}
.CmdArgs methods:
ChildProcess method:
Converts URI to native file path.
Get absolute path.
Get file name from native file path.
index
Get file stat.
Remove the directory and it's files.
Note: dir
should be subdirectory of baseDir
.
Remove the directory and it's files.
Note: dir
should be subdirectory of baseDir
.
Create a directory.
0o777
Create a file.
null
'w'
0o666
Read a file.
null
'r'
The directory is a directory or not.
The directory is a subdirectory of a certain directory or not.
The file is a file or not.
The file is executable or not.
0o111
FAQs
Helper modules for WebExtensions native messaging host
The npm package web-ext-native-msg receives a total of 366 weekly downloads. As such, web-ext-native-msg popularity was classified as not popular.
We found that web-ext-native-msg demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.