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.
zoxios-nock
Advanced tools
A testing package that returns a nock scope when provided a zoxios request-maker.
npm i zoxios axios zod
npm i zoxios-nock
Parsing request's query and response's body.
import { zoxios } from 'zoxios';
import { zoxiosNock } from 'zoxios-nock';
describe('when provided a GET request', () => {
const requestMaker = zoxios('http://google.com')
.method('get')
.concatPath('api')
.responseSchema(
z.object({ name: z.string(), age: z.number().min(0).max(120) }),
);
it('should return GET scope', async () => {
// Providing zoxiosNock a requestMaker from zoxios.
const scope = zoxiosNock(getRequestMaker);
const response = await getRequestMaker.exec();
expect(response).toMatchObject({
name: expect.any(String),
age: expect.any(Number),
});
expect(scope.isDone()).toBeTruthy();
});
});
FAQs
Nock creation using zoxios definitions
We found that zoxios-nock 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.