{"id":"MAL-2026-6929","summary":"Malicious code in paysafe-sdk (PyPI)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (12ef2b75345902c9fe851d85e09c4b6680a3685669ab4dcd8b827ebaebb46626)\nPackage metadata claims to be the 'Official Paysafe SDK for Python' by 'Paysafe Developer Team', but the shipped module is a stealer disguised as a payments client. The public PaysafeClient class exposes stub methods; PaysafeClient.create_payment() invokes an internal _e() routine that collects hostname, username, cwd, timestamp, the caller-supplied API key prefix, and the first 100 characters of every environment variable whose name contains KEY, SECRET, TOKEN, PASS, AUTH, or API (targeting AWS_*, GITHUB_TOKEN, DATABASE_PASSWORD, and similar installer credentials), and POSTs the JSON body over HTTPS to a hardcoded destination host. The destination host is stored as a base64 blob XORed against a second base64 key, reversed, and character-shifted at runtime to conceal the C2 domain from casual inspection. A helper _h() aborts the exfiltration when platform.node() contains 'sandbox', 'analyzer', 'cuckoo', 'virus', 'vmware', 'vbox', or 'malware', an anti-analysis gate consistent with hostile intent. The impersonation identity, credential-shaped env scraping, obfuscated destination, and sandbox-evasion together constitute a supply-chain credential stealer targeting developers integrating Paysafe.\n\n## Source: kam193 (ae864f77805fa7e1facccf45d1af67d37603c5a085f55d733d9d3eb8cf4d26c8)\nWhen using a provided class, the code exfiltrates basic data and parts of sensitive env variables to a remote host.\n\n\n---\n\nCategory: MALICIOUS - The campaign has clearly malicious intent, like infostealers.\n\n\nCampaign: 2026-07-paysafe-api\n\n\nReasons (based on the campaign):\n\n\n - exfiltration-env-variables\n\n\n - dependency-confusion\n\n\n - action-hidden-in-lib-usage\n\n\n - The package contains code to detect if it is running in a sandbox environment.\n\n\n - obfuscation\n","modified":"2026-07-08T21:46:54.952224846Z","published":"2026-07-07T15:22:57Z","database_specific":{"malicious-packages-origins":[{"modified_time":"2026-07-07T15:22:57.69446Z","sha256":"ae864f77805fa7e1facccf45d1af67d37603c5a085f55d733d9d3eb8cf4d26c8","versions":["1.0.0"],"id":"pypi/2026-07-paysafe-api/paysafe-sdk","source":"kam193","import_time":"2026-07-07T15:30:57.593831538Z"},{"id":"pypi/2026-07-paysafe-api/paysafe-sdk","sha256":"504646a062398a61639e86185c70fee76a8e76eaa67772587045826c5cd8d7b7","versions":["1.0.0"],"modified_time":"2026-07-07T15:22:57.69446Z","source":"kam193","import_time":"2026-07-07T22:55:28.727435196Z"},{"id":"IN-MAL-2026-008604","sha256":"12ef2b75345902c9fe851d85e09c4b6680a3685669ab4dcd8b827ebaebb46626","versions":["1.0.0"],"modified_time":"2026-07-08T20:35:07Z","source":"amazon-inspector","import_time":"2026-07-08T21:27:49.690167972Z"}],"iocs":{"domains":["caliber-spinner-finishing.ngrok-free.dev"]}},"references":[{"type":"WEB","url":"https://bad-packages.kam193.eu/pypi/package/paysafe-sdk"},{"type":"WEB","url":"https://socket.dev/blog/npm-pypi-campaign-typosquats-popular-secure-payment-apps"},{"type":"PACKAGE","url":"https://pypi.org/project/paysafe-sdk/1.0.0/"}],"affected":[{"package":{"name":"paysafe-sdk","ecosystem":"PyPI","purl":"pkg:pypi/paysafe-sdk"},"versions":["1.0.0"],"database_specific":{"indicators":{"package_integrity":[{"hashes":{"md5":"2224e4dc9b583d2dde4297104d67d79e","sha256":"0b684af6f8964d139db33c0e8407de01662481e368b007f45e427200def07875","blake2b_256":"3cfd0d03737f02ae7a7404eb7e377c00c6b765bce1df17d5c9f3088a9a40872a"},"filename":"paysafe_sdk-1.0.0-py3-none-any.whl"},{"hashes":{"md5":"6ab050d778b7423de2deb68badd36df4","sha256":"cdfbe68738a4fe030799087370547ac5907295b696dcbe0509f784d7c3cee400","blake2b_256":"856a25ea071feee99f28fa51f625ac29b087ac0f02826ff22ec79a819b60bb74"},"filename":"paysafe_sdk-1.0.0.tar.gz"}],"evidence_files":[{"sha256":"bb6959b508946c4238ec15367822150d16bfc2b49f994cfdfe5c7957d9caccfb","path":"PKG-INFO","tlsh":"98d0a7a222861535b58286c9441952d291bed90128c7105dca670ac9128a39f037503d"},{"sha256":"dabb47d75f2efa6a5540661484efa989ccb338f24938b23152f14f3e424b0cb5","path":"paysafe_sdk/__init__.py","tlsh":"923186d12850744a91662e1b948d6984a34ffd000cafde4bfbb0aa56ae80673c538d28"}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/paysafe-sdk/MAL-2026-6929.json","cwes":[{"cweId":"CWE-506","name":"Embedded Malicious Code","description":"The product contains code that appears to be malicious in nature."}]}}],"schema_version":"1.7.5","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"},{"name":"Kamil Mańkowski (kam193)","contact":["https://github.com/kam193","https://bad-packages.kam193.eu/"],"type":"REPORTER"}]}