coracuity commented on code in PR #18637:
URL: https://github.com/apache/datafusion/pull/18637#discussion_r2516300142


##########
.github/workflows/take.yml:
##########
@@ -26,16 +26,30 @@ permissions:
 jobs:
   issue_assign:
     runs-on: ubuntu-latest
-    if: (!github.event.issue.pull_request) && github.event.comment.body == 
'take'
+    if: (!github.event.issue.pull_request) && (github.event.comment.body == 
'take' || github.event.comment.body == 'untake')
     concurrency:
       group: ${{ github.actor }}-issue-assign
     steps:
-      - run: |
-          CODE=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" 
-LI https://api.github.com/repos/${{ github.repository }}/issues/${{ 
github.event.issue.number }}/assignees/${{ github.event.comment.user.login }} 
-o /dev/null -w '%{http_code}\n' -s)
-          if [ "$CODE" -eq "204" ]
+      - name: Take or untake issue
+        run: |
+          COMMENT_BODY="${{ github.event.comment.body }}"

Review Comment:
   unfortunately, this is vulnerable to shell injections: 
https://docs.github.com/en/actions/concepts/security/script-injections
   
   templates are tricky things!
   
   but you can use this to get around the issue: 
https://docs.github.com/en/actions/reference/security/secure-use#use-an-intermediate-environment-variable
   
   might want to do this for the `USER_LOGIN`, too, since it's user-controlled



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to