Malicious code in scrapetools2 (PyPI)
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (44124d389269a5e4dc8801d3af1afeb08aee57313fcc7082570c5890e7d89233) scrapetools2 1.2.1 ships an auto-update mechanism in downloader.py that fetches tar.gz payloads from public IPFS gateways (eu.orbitor.dev, dget.top, ipfs.filebase.io) at the author-controlled IPNS name k51qzi5uqu5dmh5178x8jzdkz8u3k3qona4zrwlvdr6865it3901l1oe8emjwc, decrypts an 'updates' entry using a Fernet key bundled inside the package (scrapetools2/versions), writes each decrypted blob to scrapetools2/modules/N.py, and then compile()+exec()s them in-process. The updater is invoked via runtime.DBConsumer.startQueue -> updater() and loops on a 60-second interval, so any code path that reaches the advertised RuntimeSite/browser-pool flow triggers the fetch-and-execute cycle. The package additionally ships an encrypted 'updates' blob decrypted by packer.unpackdata into a JSON {"cmd":...} whose contents are written to modules/*.py and exec'd by run_modules(); the executed source is not visible in the sdist without the bundled key. Because IPNS is a mutable pointer under the holder's control and the only integrity check is a Fernet key shipped with the package, whoever controls the IPNS name can push arbitrary Python that will be executed on installer hosts.
MAL-2026-17199
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: osv:MAL-2026-17199
scrapetools2
Source reference: /affected/0/package/name
- Affected versions
- 1.2.1
Source reference:
/affected/0/versions1.2.0Source reference:
/affected/0/versions0.2.0Source reference:
/affected/0/versions0.2.1Source reference:
/affected/0/versions - Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"package": {
"name": "scrapetools2",
"purl": "pkg:pypi/scrapetools2",
"ecosystem": "PyPI"
},
"versions": [
"1.2.1",
"1.2.0",
"0.2.0",
"0.2.1"
],
"database_specific": {
"cwes": [
{
"name": "Embedded Malicious Code",
"cweId": "CWE-506",
"description": "The product contains code that appears to be malicious in nature."
},
{
"name": "Embedded Malicious Code",
"cweId": "CWE-506",
"description": "The product contains code that appears to be malicious in nature."
},
{
"name": "Embedded Malicious Code",
"cweId": "CWE-506",
"description": "The product contains code that appears to be malicious in nature."
},
{
"name": "Embedded Malicious Code",
"cweId": "CWE-506",
"description": "The product contains code that appears to be malicious in nature."
}
],
"source": "https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/scrapetools2/MAL-2026-17199.json",
"indicators": {
"evidence_files": [
{
"path": "scrapetools2/downloader.py",
"tlsh": "2db1a453d8a6aeba9367d47c086ad151b335a9073b1042743ffc62a80f4563947e47ec",
"sha256": "f6de293017d338dfe34f90026e76012f6ae7eb2d18e7e6d9f963199e8cd1314c"
},
{
"path": "scrapetools2/packer.py",
"tlsh": "932198a1bcd91a80d38bc0284422c910f2a9bc5f1301a1657e8cabe4af8817ff6a45cd",
"sha256": "b140d03415affdb26eb34dd8ba6bee4c4fac05bc106baf1e4fd31b27a68a6bd7"
}
],
"package_integrity": [
{
"hashes": {
"md5": "7cf44493b43d599944e6c3a803a5e736",
"sha256": "e0f1f58f241c64e04e3f7946436403c695e30040dc7733b97cd69dcc30d77168",
"blake2b_256": "609a817a6d63406fd35c09ee2be49d50210313c81903a935410366e2e38fa214"
},
"filename": "scrapetools2-1.2.1-py2.py3-none-any.whl"
},
{
"hashes": {
"md5": "22bafa8e1af53276d230ab5a415bff6e",
"sha256": "8d4d42e93e67612862888adb1bee1c1254a8ed21aa30570b438a47b291759eee",
"blake2b_256": "02730598c74da7b7e25a8fac62c6951ec15cf25b3091ae6ebab46778306591d8"
},
"filename": "scrapetools2-1.2.1.tar.gz"
}
]
}
}
}
]Publisher severity
No explicit severity was provided.
- Event
- #19727 · Revision 1
- Added to Heist Feed
- Publisher date