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.
@xapp/arachne
Advanced tools
An extremely simple web crawler, based on puppeteer.
Chromium is required for puppeteer and is typically the limiting factor when trying to get it to run in a Lambda due to its size. This can be overcome with a Lambda Layer, specifically this community maintained layer.
You can include this layer directly in your SLS framework file or SAM Policy template.
A SLS framework example:
functions:
eventReceiver:
handler: dist/index.receiver
layers:
- "arn:aws:lambda:us-east-1:764866452798:layer:chrome-aws-lambda:31"
In your Lambda source:
import { Browser, LaunchOptions, BrowserConnectOptions, BrowserLaunchArgumentOptions } from "puppeteer";
import { Arachne, ArachnePage, ArachneRequest, MemoryRequestQueue } from "@xapp/arachne";
// Other imports and code
// The important part..
let browser: Pick<Browser, "close" | "newPage">;
// The try catch allows to still run it locally if you want, assuming you
// have chromium installed on your machine
try {
log().debug('Looking for chrome-aws-lambda');
// eslint-disable-next-line @typescript-eslint/no-var-requires
const chromium = require('@sparticuz/chrome-aws-lambda');
browser = await chromium.puppeteer.launch({
args: chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath: await chromium.executablePath,
headless: chromium.headless,
ignoreHTTPSErrors: true,
});
} catch (e) {
log().debug("Could not find chrome-aws-lambda layer");
console.error(e);
}
const crawler = Arachne.crawler({
stealth: true,
launchOptions, /* timeout set to 5 seconds, default of 30 is too long */
queue,
browser,
pageHandler: async (page: ArachnePage, request: ArachneRequest) => {
//... handle page load
}
});
require("chrome-aws-lambda")
but this is WRONG if you use the layer directly. You need to use require('@sparticuz/chrome-aws-lambda');
FAQs
Unknown package
The npm package @xapp/arachne receives a total of 98 weekly downloads. As such, @xapp/arachne popularity was classified as not popular.
We found that @xapp/arachne demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.