-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix handling of variables, inputs, platforms, and options with spaces #143
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Sanjula Ganepola <[email protected]>
Signed-off-by: Sanjula Ganepola <[email protected]>
@ChristopherHX When you have a chance, could you test out this change as I do not have a Mac or Linux |
Signed-off-by: Sanjula Ganepola <[email protected]>
…ng or encoding Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Sanjula Ganepola <[email protected]>
@ChristopherHX Turns out there is an issue with handling quotes in inputs. Variables are fine however. Is this an issue in
act --workflows ".github/workflows/sample.yaml" --secret-file "" --var MY_VAR="variable with spaces and quotes\"" --var-file "" --input MY_INPUT="input with spaces and quotes\"" --input-file "" --eventpath "" name: Echo Test
on:
push:
branches: ["main"]
jobs:
sample:
name: SAMPLE
runs-on: ubuntu-latest
steps:
- name: Echo
run: |
echo '${{ vars.MY_VAR }}'
echo ${{ github.event.inputs.MY_INPUT }} |
No, your workflow just has a script injection vulnerability. Regardless of using act or not It's best practice to use shell environment variables for passing untrusted data.
Your variable line has an incomplete mitigation of a special case of script injection by using single quotes Yes I just accept this risk myself a lot, mitigation adds more code |
✍ Changes
I tested this on Windows, but will need some help with testing on Linux and MacOS.
📋 Checklist