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.
Corti is a drop in replacement for the browser's SpeechRecognition object. It mocks some of the behaviour of the native object to facilitate automated testing, and provides a number of extra methods beyond the spec to help testing.
For an example of using Corti to test a real project, check out SpeechKITT.
To easily use Speech Recognition in your own project, check out annyang.
// Patch the current environment with a mock Speech Recognition object
Corti.patch();
// Interact with the mock object, like you would with the real SpeechRecognition object
var recognition = new window.SpeechRecognition();
recognition.onstart = function() {console.log("I'm listening");};
recognition.addEventListener('result', function(sre) {
console.log(sre.results.item(sre.resultIndex).item(0).transcript);
});
recognition.addEventListener('end', function() {console.log("Quiet");});
recognition.continuous = true;
// Use extra utility methods added to the mock object to assist with testing
expect(recognition.isStarted()).toBe(false);
recognition.start();
expect(recognition.isStarted()).toBe(true);
recognition.abort();
expect(recognition.isStarted()).toBe(false);
// Simulate speech recognition
recognition.addEventListener('result', mySpyFunction);
expect(mySpyFunction).not.toHaveBeenCalled();
recognition.say("Next time you want to stab me in the back, have the guts to do it to my face");
expect(mySpyFunction).toHaveBeenCalled();
Tal Ater: @TalAter
Licensed under MIT.
FAQs
Replace window.SpeechRecognition with a mock object and automate your tests
The npm package corti receives a total of 92 weekly downloads. As such, corti popularity was classified as not popular.
We found that corti 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
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.