CVE-2023-49291CWE-20

Improper Sanitization of Branch Name Leads to Arbitrary Code Injection

Critical · published December 4, 2023

CVSS v3.1
9.3
EPSS
1%
Percentile
73.1
In the wild
Unconfirmed
What it is

🚨 A crafty branch name is all it takes for an attacker to dance through your security! The `tj-actions/branch-names` GitHub Action is vulnerable to exploitation, potentially allowing unauthorized code execution and access to sensitive information. 🔥 Think of it like a restaurant where diners can place orders using the name of their favorite dish. If they can cleverly name a dish the chef doesn’t recognize, they might just receive something entirely different — or worse, something harmful! This vulnerability is absolutely devastating: an attacker could gain access to your secrets, steal your `GITHUB_TOKEN` permissions, or execute arbitrary code within your GitHub Actions environment. The risks are sky-high, and any delay in addressing this could lead to serious breaches. You definitely don’t want to leave the door open for this one!

Put simply

Think of it like a restaurant where diners can place orders using the name of their favorite dish. If they can cleverly name a dish the chef doesn’t recognize, they might just receive something entirely different — or worse, something harmful! The vulnerability stems from the improper reference to the `github.event.pull_request.head.ref` and `github.head_ref` context variables within a GitHub Actions `run` step, allowing attackers to execute code by crafting malicious branch names.

What to do

This vulnerability is absolutely devastating: an attacker could gain access to your secrets, steal your `GITHUB_TOKEN` permissions, or execute arbitrary code within your GitHub Actions environment. The risks are sky-high, and any delay in addressing this could lead to serious breaches. You definitely don’t want to leave the door open for this one! Upgrade to version 7.0.7 of `tj-actions/branch-names` immediately to close this critical vulnerability. Unfortunately, there are no known workarounds, so updating is your best bet to ensure security. Don't wait! You've got this! By following these steps, you'll patch this vulnerability and keep your projects secure. 🛡️

The record
Technical detail
CVSS v3.1
9.3 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N
CVSS v4.0
Not supplied
EPSS
0.01448 · 73.1th percentile
Weakness
CWE-20 · Improper Input Validation
Published
2023-12-04T23:21Z
EPSS history
Timeline
  • 04 DEC 23:21Z
    Improper Sanitization of Branch Name Leads to Arbitrary Code Injection
    cvelistv5