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.
Runs a fake SQS server on a HTTP port.
const assert = require('assert')
const SQSServer = require('fake-sqs')
const AWS = require('aws-sdk')
async function test() {
const myServer = new SQSServer({
port: 0
})
await myServer.bootstrap()
const sqs = new AWS.SQS({
region: 'us-east-1',
sslEnabled: false,
accessKeyId: '123',
secretAccessKey: 'abc',
apiVersion: '2012-11-05'
})
const queueUrl = `http://` + myServer.hostPort
await sqs.sendMessage({
QueueURL: queueUrl,
MessageBody: 'my message'
}).promise()
await myServer.waitForMessages(1)
var queue = myServer.getQueue()
assert.equal(queue[0].MessageBody, 'my message')
assert.equal(queue.length, 1)
await myServer.close()
}
process.on('unhandledReject', (err) => { throw err })
test()
const server = new SQSServer(opts)
Create a fake SQS server
opts.port
; defaults to 0await server.bootstrap()
Starts the server.
After bootstrap returns you can read server.hostPort
to get
the actual listening port of the server.
server.getQueue()
Returns the current array of items queued in SQS. These are shaped like aws SQS objects.
await server.waitForMessages(count)
Get notified once N messages have in total been sent to this fake SQS.
await server.waitForDeletes(count)
Get notified once N messages have in total been deleted from this fake SQS.
await server.waitForFlush()
Get notified when the number of pending messages in the SQS queue is zero.
This can be used with waitForMessages()
to first wait for N
messages to be send and then wait for them to have been received
and deleted from the queue.
await server.close()
Closes the underlying http server.
% npm install fake-sqs
FAQs
Run a fake SQS HTTP server for testing purposes
The npm package fake-sqs receives a total of 1 weekly downloads. As such, fake-sqs popularity was classified as not popular.
We found that fake-sqs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.