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.
elasticgraph-indexer_lambda
Advanced tools
Adapts elasticgraph-indexer to run in an AWS Lambda.
We use JSON Lines to encode our indexing events. It is just individual JSON objects
delimited by a newline control character(not the \n
string sequence), such as:
{"op": "upsert", "__typename": "Payment", "id": "123", "version": "1", "record": {...} }
{"op": "upsert", "__typename": "Payment", "id": "123", "version": "2", record: {...} }
{"op": "delete", "__typename": "Payment", "id": "123", "version": "3"}
However, due to SQS message size limit, we have to batch our events carefully so each batch is below the size limit. This makes payload encoding a bit more complicated on the publisher side because each message has a size limit. The following code snippet respects the max message size limit and sends JSON Lines payloads with proper size:
def partition_into_acceptably_sized_chunks(batch, max_size_per_chunk)
chunk_size = 0
batch
.map { |item| JSON.generate(item) }
.slice_before do |json|
chunk_size += (json.bytesize + 1)
(chunk_size > max_size_per_chunk).tap { |chunk_done| chunk_size = 0 if chunk_done }
end
.map { |chunk| chunk.join("\n") }
end
FAQs
Unknown package
We found that elasticgraph-indexer_lambda demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
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.