Skip to content

Commit fe2679f

Browse files
committed
CI: prevent script injection
Treat github.event.pull_request.title as untrusted; use an intermediate environment variable to prevent script injections. Suggested-by: Stephen Paulger <[email protected]> Signed-off-by: Vincent Stehlé <[email protected]>
1 parent 2d21182 commit fe2679f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/main.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
# and only in the following cases:
2828
# - Push of a tag or to the main branch
2929
# - Pull request opened for the main branch of the main repository.
30+
env:
31+
     PR_TITLE: ${{ github.event.pull_request.title }}
3032
if: ${{ github.repository == 'ARM-software/ebbr' }}
3133
run: |
3234
case "${{ github.event_name }}" in
@@ -43,7 +45,7 @@ jobs:
4345
if [ "${{ github.event.action }}" == opened ] &&
4446
[ "${{ github.event.pull_request.base.ref }}" == main ]; then
4547
msg="Pull request ${{ github.event.number }}"
46-
msg="$msg (\"${{ github.event.pull_request.title }}\")"
48+
msg="$msg (\"$PR_TITLE\")"
4749
msg="$msg ${{ github.event.action }}"
4850
url="${{ github.event.pull_request.html_url }}"
4951
fi ;;

0 commit comments

Comments
 (0)