# MAL-2024-12287: Malicious code in hmac2 (PyPI)


- **Type:** Malicious package
- **Package:** `hmac2` (PyPI)
- **Published:** 30 Oct 2024

## What is MAL-2024-12287?

MAL-2024-12287 is a malicious package in hmac2, published on 30 Oct 2024. 

### Official description

The package contains obfuscated code that exfiltrate basic data, and then executes commands delivered from remote server

---

Category: MALICIOUS - The campaign has clearly malicious intent, like infostealers.

Campaign: 2024-10-hmac2

Reasons (based on the campaign):

 - obfuscation

 - dependency-confusion

 - The package contains code to exfiltrate basic data from the system, like IP or username. It has a limited risk.

 - exfiltration-generic

## What should I do about MAL-2024-12287?

Remove the package from your dependencies and lockfiles, then rotate any secrets on machines where it was installed.

## Fix prompt for AI coding agents

```text
MAL-2024-12287 is a malicious package: hmac2 (PyPI). Every version was published to cause harm.

Task:
1. Search this repository's dependency manifests and lockfiles for the package, including transitive dependencies.
2. If it is present, remove it, regenerate the lockfile with the project's package manager, and replace whatever it was used for.
3. List any CI runners, developer machines or containers that installed it, so their secrets can be rotated.
4. If the package is not used anywhere, say so and change nothing.

Reference: https://insights.sbomify.com/MAL-2024-12287/ (Markdown: https://insights.sbomify.com/MAL-2024-12287/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/MAL-2024-12287

---
From sbomify Insights: https://insights.sbomify.com/MAL-2024-12287/
Summaries are generated and may contain mistakes; the official description above is the record.
