GHSL-2024-144: Checkout and execution of untrusted code in the GitHub workflows of JupyterLab - CVE-2024-39700
The GitHub Actions workflows in JupyterLab checked out and ran code from pull requests triggered by issue comments, allowing an attacker to execute untrusted code with a privileged token. This could let them modify the repository or read secrets.
Originally disclosed on GitHub Security Lab
JupyterLab is vulnerable to checkout and execution of untrusted code in the GitHub workflows allowing attacker to gain write access and read secrets from the repository.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
Running untrusted code with a privileged repository token and access to secrets may lead to an unauthorized repository modification or exfiltration of the secrets.
What the attacker needed
Ability to create a pull request; ability to comment on the pull request
The fix
The workflows should be fixed to avoid checking out and running untrusted code in a privileged context, for example by using a separate workflow with limited permissions or requiring approval.
How it was found
- Create a pull request with a malicious script in the repository.
- Comment on the pull request to trigger the workflow.
- The workflow checks out the pull request branch and runs the script with a privileged token.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
GitHub Actions are automated tasks that run when something happens, like a comment on a pull request. Here, the task ran code from the pull request itself, which an outsider controls, and gave that code powerful permissions. So an attacker could make the task do harmful things, like change the project's code or steal secret keys.