Skip to main content

Malicious code in tsshare (PyPI)

0
High
Published: 09/04/2026 (09/04/2026, 00:00:00 UTC)
Source: GCVE Database
Product: tsshare

Description

The PyPI package `tsshare` is malicious. It impersonates the popular Chinese market-data library `tushare` — its docstrings advertise compatibility with `Tushare pro_bar` and it ships `MyShareClient`/`MyShareError` aliases. `tsshare/client.py` conceals its default API endpoint by base64-decoding it at runtime: in 1.0.5–1.0.18 the value decodes to the hardcoded raw IP `https://47.112.191.75` (Alibaba Cloud, China), and in 1.0.19 it rotates to the domain `https://fszzw56.com`. On use, the client builds a persistent cross-platform hardware fingerprint (Windows disk-drive serial via `Win32_DiskDrive`, macOS `Hardware UUID` via `system_profiler`, Linux `/etc/machine-id`) and routes the request — carrying the user's Tushare `auth_code` token — to that hidden endpoint, so the operator receives the paid API token together with a stable machine identifier. There is no install-time hook; exfiltration occurs on API use. --- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (539c8fdb69887b093801655215f1857f53abb20e6dc763198c543def86c39387) The package presents itself as a drop-in replacement for Tushare's pro_api, but every method call is dispatched through a query() that POSTs to a hardcoded default backend at https://47.112.191.75/api/v1/proxy rather than to tushare.pro. The destination URL is stored base64-encoded (_E = b"aHR0cHM6Ly80Ny4xMTIuMTkxLjc1") and decoded at runtime by _default_base_url, and the destination is a bare IP unrelated to the credential's issuer. set_token() stores the caller's Tushare auth_code, and every subsequent proxied call includes {'auth_code': self.auth_code,...} in the POST body to that endpoint, so the paid third-party credential leaves the trust boundary it was issued for and can be logged or replayed by the operator of 47.112.191.75. The client also collects a persistent hardware fingerprint on first use — PowerShell Win32_Processor ProcessorId and Win32_DiskDrive SerialNumber on Windows, system_profiler Hardware UUID on macOS, /etc/machine-id on Linux — SHA-256 hashes it, caches it under ~/.tsshare/device_id.json, and attaches it as meta.device_id to every request, giving the backend operator a stable per-machine identifier unnecessary for the advertised proxy function. TLS certificate verification on the requests.Session is disabled by default (session.verify defaults to false via TSSHARE_SSL_VERIFY/MYSHARE_SSL_VERIFY) and urllib3 InsecureRequestWarning is silenced, so the auth_code and hardware ID are transmitted to the bare-IP HTTPS endpoint without cert validation.

Affected software

PyPIghsa
tsshare
Affected versions
=1.0.19=1.0.7=1.0.5=1.0.11=1.0.18=1.0.6=1.0.14=1.0.10=1.0.16=1.0.2=1.0.8=1.0.1=1.0.4=1.0.15=1.0.17=1.0.9

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/10/2026, 13:38:53 UTC

Technical Analysis

The 'tsshare' PyPI package masquerades as the popular 'tushare' market-data library by mimicking its API and naming conventions. In versions including and specifically =1.0.19, it decodes a base64-encoded URL at runtime to contact an attacker-controlled endpoint (https://fszzw56.com). When used, it collects a stable hardware fingerprint (Windows disk serial, macOS hardware UUID, or Linux machine-id), hashes it, and stores it locally. It then sends this identifier along with the user's Tushare pro API auth_code token to the malicious endpoint, effectively exfiltrating sensitive credentials and machine identity data without user consent or awareness.

Potential Impact

Users who install and use 'tsshare' risk having their Tushare pro API authentication tokens and stable hardware identifiers exfiltrated to an attacker-controlled server. This compromises the confidentiality of their paid API credentials and enables persistent tracking of the affected machine. There is no indication of further exploitation beyond credential and fingerprint theft in the provided data.

Mitigation Recommendations

Users should avoid installing or using the 'tsshare' package, especially version =1.0.19. Since this is a malicious package impersonating a legitimate one, users should verify package authenticity before installation. Remove any installations of 'tsshare' and revoke or rotate any Tushare API tokens that may have been exposed. There is no official patch or fix since this is a malicious package rather than a vulnerability in legitimate software.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
MAL-2026-16044
Osv Schema Version
1.7.4
Ecosystems
["PyPI"]

Threat ID: 6aa2af89acd9273b4925b510

Added to database: 09/10/2026, 13:24:25 UTC

Last enriched: 09/10/2026, 13:38:53 UTC

Last updated: 09/11/2026, 14:32:04 UTC

Views: 19

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses