
Research
npm Malware Targets Telegram Bot Developers with Persistent SSH Backdoors
Malicious npm packages posing as Telegram bot libraries install SSH backdoors and exfiltrate data from Linux developer machines.
remote-web-worker
Advanced tools
Leightweight (~0.3kb) Worker patch to allow loading scripts from remote URLs (cross-origin).
Allows to host Web Worker scripts on CDN servers without the following cors exceptions:
Uncaught DOMException: Failed to construct 'Worker': Script at 'https://cdn.jsdelivr.net/npm/console-log-hello-world' cannot be accessed from origin 'http://localhost:8080'.
Uncaught (in promise) DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://cdn.jsdelivr.net/npm/console-log-hello-world' failed to load.
npm install --save-dev remote-web-worker
Apply Patch
import 'remote-web-worker';
Initialize a Worker just like you would normally do:
const worker = new Worker(
'https://cdn.jsdelivr.net/npm/console-log-hello-world',
{ type: 'classic' }
);
According to spec the Worker constructor accepts only local URLs, not remote URLs: https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker
As a workaround this patched Worker will use importScripts
to load the remote script.
https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts
type="classic"
workers (no import
or export
)The remote script is loaded via importScripts
which is not subject to CORS.
However, the script is loaded in a separate context and cannot access the main thread
or the DOM.
The remote script runs in the current sites origin and therefore will not be able to access
Cookies or Local Storage of the remote server.
MIT
FAQs
Cross origin web worker
The npm package remote-web-worker receives a total of 8,469 weekly downloads. As such, remote-web-worker popularity was classified as popular.
We found that remote-web-worker 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
Malicious npm packages posing as Telegram bot libraries install SSH backdoors and exfiltrate data from Linux developer machines.
Security News
pip, PDM, pip-audit, and the packaging library are already adding support for Python’s new lock file format.
Product
Socket's Go support is now generally available, bringing automatic scanning and deep code analysis to all users with Go projects.