7

I have a workflow that FTPs files by using an external action from someuser:

    - name: ftp deploy
      uses: someuser/ftp-action@master
      with:
        config: ${{ secrets.FTP_CONFIG }}

Is this a security concern? For example could someuser change ftp-action@master to access my secrets.FTP_CONFIG? Should I copy/paste their action into my workflow instead?

1

2 Answers 2

4

If you use ftp-action@master then every time your workflow runs it will fetch the master branch of the action and build it. So yes, I believe it would be possible for the owner to change the code to capture secrets and send them to an external server under their control.

What you can do to avoid this is use a specific version of the action and review their code. You can use a commit hash to refer to the exact version you want, such as ftp-action@efa82c9e876708f2fedf821563680e2058330de3. You could use a tag if it has release tags. e.g. [email protected] Although, this is maybe not as secure because tags can be changed.

Alternatively, and probably the most secure, is to fork the action repository and reference your own copy of it. my-fork/ftp-action@master.

1

The GitHub help page does mention:

Anyone with write access to a repository can read and use secrets.

If someuser does not have write access to the repository, there should be no security issue.

As commented below, you should specify the exact commit of the workflow you are using, in order to make sure it does not change its behavior without your knowledge.

4
  • 1
    I understand that others can't read my secrets directly. But I'm running my secret through someone else's code. What if that code changes? If their code sends my secrets to my ftp server, then could their code be changed (after it's incorporated into my workflow) to send my credentials elsewhere? Sep 13, 2019 at 5:05
  • @sfmiller940 I will have to check but you should be using a specific version/revision of that code workflow: nothing should change unless you explicitly reference it.
    – VonC
    Sep 13, 2019 at 5:07
  • So maybe I should specify the exact commit rather than just ftp-action@master? Sep 13, 2019 at 5:09
  • 1
    @sfmiller940 Exactly: that would be safer
    – VonC
    Sep 13, 2019 at 5:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.