code injection vulnerability exists in the huggingface/text-generation-inference repository
Date: 2024-06
Affected: pip/text-generation
Attack vector: rce
Category: vulnerability-disclosure
Severity: Medium
CVE: CVE-2024-3924
CWE: CWE-94
CVSS: 4.4 (CVSS:3.0/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N)

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.


Mitigations:

Architectural layers (MAESTRO):