Malicious code in modern-csv (PyPI)
- MAL-2026-21051
Summary
The PyPI package modern-csv has been flagged as malicious (record MAL-2026-21051, not on the CISA known exploited list, no CVSS score assigned). According to the source details, installing the package silently executes a script fetched from a remote location. That script reports information back to an external party and sets up a Cloudflare tunnel, giving the attacker backdoor access to the affected environment. The record places it in a campaign labeled 2026-12-modern-csv and classifies it as malicious rather than a vulnerability in legitimate code. Teams that have installed modern-csv should treat the host environment as potentially compromised and investigate accordingly.
AI summary · verify against the vendor advisory
Description
Show the whole descriptionHide the whole description
modern-csv is advertised as a zero-dependency CSV auditing library, but the distribution contains an undocumented module, src/modern_csv/check.py, that is unrelated to that purpose. The module downloads the cloudflared binary from a mutable 'latest' release URL into ~/bin, marks it executable, and launches it as a detached process (start_new_session=True) with a hardcoded author-held tunnel token, establishing a persistent inbound channel from an operator-controlled control plane to the host. The same module fetches a shell script from https://raw.githubusercontent.com/najm-x/test1/refs/heads/main/print_hart_with_red_color.sh - a personal repository unrelated to the package's declared project, referenced at an unpinned mutable branch with no hash or signature verification - writes it under /tmp and executes it with bash, so whoever controls that path can run arbitrary shell commands on the host. Each stage of the download, execution and tunnel-startup flow posts status strings to https://us-east-1.aws.edge.axiom.co/v1/ingest/test-logs using an embedded third-party log-ingest token, giving the operator live monitoring of the activity. None of this behavior is documented in the README, and none of it is required by the package's CSV-linting API. Package silently executes remote script, which then reports home and establishes a Cloudflare tunnel allowing for backdoor access to the environment. --- Category: MALICIOUS - The campaign has clearly malicious intent, like infostealers. Campaign: 2026-12-modern-csv Reasons (based on the campaign): - Downloads and executes a remote malicious script. - backdoor
Text from the OSV record.
Recommendation
Remove the package and rotate any secret the machine that installed it could reach. There is no version to update to.
Affected
modern-csvPyPI
No versions listed
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.