Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

fix(ci): harden workflow security — prevent script injection and scope permissions#99

Open
jongio wants to merge 1 commit into
mainfrom
auto/secops/2026-05-17
Open

fix(ci): harden workflow security — prevent script injection and scope permissions#99
jongio wants to merge 1 commit into
mainfrom
auto/secops/2026-05-17

Conversation

@jongio
Copy link
Copy Markdown
Owner

@jongio jongio commented May 17, 2026

Summary

Harden CI workflow security by fixing two vulnerabilities identified during security audit.

Changes

1. Prevent script injection in update-azd-core.yml (CWE-77)

The update-azd-core.yml workflow used inline expression contexts to inject repository_dispatch payload values directly into shell commands. Since dispatch payloads are attacker-controlled, this enabled command injection.

Fix:

  • Move all payload values into env: blocks and reference them as shell variables
  • Strengthen version validation from ^v to strict semver: ^v[0-9]+.[0-9]+.[0-9]+(-[a-zA-Z0-9.]+)?$

2. Scope workflow permissions in website.yml (CWE-276)

The website.yml workflow declared contents: write and pull-requests: write at the workflow level, granting elevated permissions to all jobs — including the build job which only needs read access.

Fix:

  • Remove workflow-level permissions
  • Add job-level permissions: build gets read-only; deploy/cleanup jobs get write access

Testing

  • All Go tests pass
  • YAML syntax validated
  • No functional changes to workflow behavior

Issues

Closes #95
Closes #97

…e permissions

- Replace inline expression contexts with env vars in update-azd-core.yml
  to prevent command injection via repository_dispatch payloads (CWE-77)
- Strengthen version validation to require strict semver format
- Move workflow-level permissions to job-level in website.yml to enforce
  least privilege — build job now gets read-only access (CWE-276)

Closes #95
Closes #97

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jongio jongio added automated Created by automation secops labels May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Website Preview

Your PR preview is ready!

📎 Preview URL: https://jongio.github.io/azd-exec/pr/99/

This preview will be automatically cleaned up when the PR is closed.

github-actions Bot added a commit that referenced this pull request May 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

automated Created by automation secops

Projects

None yet

1 participant