Fix update-sample-data workflow pushing to protected master branch#14374
Open
valentijnscholten wants to merge 1 commit intoDefectDojo:masterfrom
Open
Fix update-sample-data workflow pushing to protected master branch#14374valentijnscholten wants to merge 1 commit intoDefectDojo:masterfrom
valentijnscholten wants to merge 1 commit intoDefectDojo:masterfrom
Conversation
The branch parameter used github.ref_name which resolved to 'master' when triggered via workflow_dispatch, causing a push to a protected branch. Simplify by letting create-pull-request manage the branch using a fixed name, removing the now-redundant manual branch steps.
dcdf559 to
e254b57
Compare
Maffooch
approved these changes
Feb 23, 2026
|
This pull request contains a code injection vulnerability: user-controlled workflow_dispatch inputs are interpolated directly into an actions/github-script JavaScript block, allowing an attacker to break out of the string context (e.g., via a crafted input with a quote) and execute arbitrary Node.js code on the runner with access to GITHUB_TOKEN and other job secrets.
Code Injection: Injection into github-script Javascript context in
|
| Vulnerability | Code Injection: Injection into github-script Javascript context |
|---|---|
| Description | The workflow interpolates GitHub Actions expressions ${{ inputs.release_number_new }} and ${{ env.NEW_BRANCH }} directly into the script block of actions/github-script. These values are derived from user-controlled inputs in a workflow_dispatch trigger and are used without any prior validation in this workflow. An attacker can provide a crafted input containing a single quote (e.g., 1.2.3'; console.log(process.env); //) to break out of the Javascript string context and execute arbitrary Node.js code. This code runs with the privileges of the GitHub Actions runner and has access to the GITHUB_TOKEN and any other secrets available to the job. |
django-DefectDojo/.github/workflows/release-3-master-into-dev.yml
Lines 105 to 108 in dcdf559
All finding details can be found in the DryRun Security Dashboard.
Jino-T
approved these changes
Feb 24, 2026
rossops
approved these changes
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The workflow that runs the new python script to update sample data still fails because of invalid handling of branches.
branchparameter in theCreate Pull Requeststep used${{ github.ref_name || 'dev' }}, which resolves tomasterwhen triggered viaworkflow_dispatchfrom the master branchmaster, which is blocked by the repository's branch protection rule ("Changes must be made through a pull request")update-sample-datafor thecreate-pull-requestactionpeter-evans/create-pull-requestis supposed to handle things gracefully if theupdate-sample-databranch already exists. It will update the existing branch and PR, or, if the PR is already merged, it will create a new PR.