GHSL-2024-338: Code Injection in Angular JA’s Actions workflow
The adev-preview-deploy.yml workflow in the angular/angular-ja repository is vulnerable to code injection because it interpolates the contents of an artifact into a shell script. An attacker could exploit this to gain write permissions for pull requests and leak the Firebase token.
Originally disclosed on GitHub Security Lab
angular/angular-ja repository is vulnerable to a code injection in its adev-preview-deploy.yml workflow which may an attacker to gain write permissions for the pullrequest scope and leak the Firebase token.
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
Root cause
The workflow interpolates the contents of an artifact file into a shell script without sanitisation, allowing code injection.
Impact
An attacker could modify any pull requests and access the FIREBASE_SERVICE_ACCOUNT secret, potentially deploying arbitrary code to Firebase and poisoning the angular.jp site.
What the attacker needed
GitHub account; ability to fork the repository; ability to create a pull request
The fix
The vulnerability was remediated by disabling the workflow.
How it was found
- Fork the angular/angular-ja repository.
- Create a new branch and modify adev-preview-build.yml to upload artifacts containing malicious commands.
- Commit the changes and create a pull request against angular/angular-ja.
- Wait for the preview deploy action to complete and observe the output of the vulnerable step.
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.
A GitHub Actions workflow is a set of automated steps that run on GitHub's servers. This workflow took a file uploaded by a previous workflow and inserted its contents directly into a shell command without checking it. An attacker could put malicious commands in that file, and when the workflow ran, those commands would execute with the workflow's permissions.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.