Withdrawn Advisory
This advisory has been withdrawn because the confidentiality, integrity, and availability impacts of the vulnerability affect Litestar's CI/CD environment rather than the litestar package. While the information in the advisory is still valid, users of the litestar package are not affected and do not need to receive Dependabot alerts.
Original Advisory
Summary
Litestar's docs-preview.yml workflow is vulnerable to Environment Variable injection which may lead to secret exfiltration and repository manipulation.
Environment Variable injection (GHSL-2024-177)
The docs-preview.yml workflow gets triggered when the Tests And Linting workflow completes:
on:
workflow_run:
workflows: [Tests And Linting]
types: [completed]
Later, it downloads and extracts an artifact generated by the triggering workflow:
- name: Download artifact
uses: dawidd6/action-download-artifact@v6
with:
workflow_conclusion: success
run_id: ${{ github.event.workflow_run.id }}
path: docs-preview
name: docs-preview
And reads docs-preview/.pr_number into an Environment Variable:
- name: Set PR number
run: echo "PR_NUMBER=$(cat docs-preview/.pr_number)" >> $GITHUB_ENV
The $GITHUB_ENV pointed file is just a regular file where every KEY=VALUE will be used to define a new Environment Variable after the step completes. Since the contents of the .pr_number file have not been validated, they may contain new lines that will cause new Environment Variables to be defined.
An attacker can send a malicious .pr_number file with the following content:
111
LD_PRELOAD=/home/runner/work/litestar/litestar/inject.so