Skip to content

Commit

Permalink
CI: prevent script injection
Browse files Browse the repository at this point in the history
Treat github.event.pull_request.title as untrusted; use an intermediate
environment variable to prevent script injections.

Suggested-by: Stephen Paulger <Stephen.Paulger@arm.com>
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
  • Loading branch information
vstehle committed May 23, 2024
1 parent 2d21182 commit f34259a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
# and only in the following cases:
# - Push of a tag or to the main branch
# - Pull request opened for the main branch of the main repository.
env:
PR_TITLE: ${{ github.event.pull_request.title }}
if: ${{ github.repository == 'ARM-software/ebbr' }}
run: |
case "${{ github.event_name }}" in
Expand All @@ -43,7 +45,7 @@ jobs:
if [ "${{ github.event.action }}" == opened ] &&
[ "${{ github.event.pull_request.base.ref }}" == main ]; then
msg="Pull request ${{ github.event.number }}"
msg="$msg (\"${{ github.event.pull_request.title }}\")"
msg="$msg (\"$PR_TITLE\")"
msg="$msg ${{ github.event.action }}"
url="${{ github.event.pull_request.html_url }}"
fi ;;
Expand Down

0 comments on commit f34259a

Please sign in to comment.