Skip to content
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

Improve security of github action #1822

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Improve security of github action #1822

wants to merge 1 commit into from

Conversation

@bookernath bookernath requested a review from a team as a code owner December 31, 2024 15:58
Copy link

changeset-bot bot commented Dec 31, 2024

⚠️ No Changeset found

Latest commit: 7c85082

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Dec 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
catalyst-latest ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 31, 2024 4:08pm
catalyst-soul ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 31, 2024 4:08pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
catalyst ⬜️ Ignored (Inspect) Dec 31, 2024 4:08pm
catalyst-au ⬜️ Ignored (Inspect) Visit Preview Dec 31, 2024 4:08pm
catalyst-uk ⬜️ Ignored (Inspect) Visit Preview Dec 31, 2024 4:08pm

Copy link
Contributor

⚡️🏠 Lighthouse report

Lighthouse ran against https://catalyst-latest-kxu1a1ljt-bigcommerce-platform.vercel.app

🖥️ Desktop

We ran Lighthouse against the changes on a desktop and produced this report. Here's the summary:

Category Score
🟠 Performance 79
🟢 Accessibility 96
🟢 Best practices 100
🟠 SEO 82

📱 Mobile

We ran Lighthouse against the changes on a mobile and produced this report. Here's the summary:

Category Score
🟢 Performance 99
🟢 Accessibility 96
🟢 Best practices 100
🟠 SEO 85

exit 1
fi
echo "ref=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT

- name: Use commit SHA for filename
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this removed intentionally?

id: validate
run: |
# Validate ref name against allowed pattern (alphanumeric, dash, underscore, and forward slash only)
if ! [[ "${{ github.event.pull_request.head.ref }}" =~ ^[a-zA-Z0-9/_-]+$ ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this line i think we should still env the ${{ github.event.pull_request.head.ref }} as if you enter something like "]]asdf" it can escape the shell condition which can lead to RCE.

Using intermediate env vars like here: https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable should treat any special characters as escaped which we can safely use later

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could use the default environment variable GITHUB_HEAD_REF instead? Should probably have the same escaped value 🤔

https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants