Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
JS bindings for libopus 1.4, ported with Emscripten.
var OpusScript = require("opusscript");
// 48kHz sampling rate, 20ms frame duration, stereo audio (2 channels)
var samplingRate = 48000;
var frameDuration = 20;
var channels = 2;
// Optimize encoding for audio. Available applications are VOIP, AUDIO, and RESTRICTED_LOWDELAY
var encoder = new OpusScript(samplingRate, channels, OpusScript.Application.AUDIO);
var frameSize = samplingRate * frameDuration / 1000;
// Get PCM data from somewhere and encode it into opus
var pcmData = new Buffer(pcmSource);
var encodedPacket = encoder.encode(pcmData, frameSize);
// Decode the opus packet back into PCM
var decodedPacket = encoder.decode(encodedPacket);
// Delete the encoder when finished with it (Emscripten does not automatically call C++ object destructors)
encoder.delete();
If your environment doesn't support WASM, you can try the JS-only module. Do note that the JS-only version barely has optimizations due to compiler/toolchain limitations, and should only be used as a last resort.
var encoder = new OpusScript(samplingRate, channels, OpusScript.Application.AUDIO, {
wasm: false
});
Since this module wasn't written for TypeScript, you need to use import = require
syntax.
// Import using:
import OpusScript = require("opusscript");
// and NOT:
import OpusScript from "opusscript";
FAQs
JS bindings for libopus 1.4, ported with emscripten
The npm package opusscript receives a total of 13,410 weekly downloads. As such, opusscript popularity was classified as popular.
We found that opusscript 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.