Skip to content

[CI][Security] SEC-00774: Prevent GITHUB_ENV injection from PR title on PSDB/buildbot trigger workflows#3050

Open
vkallesh wants to merge 2 commits into
amd-stagingfrom
security/vkallesh/SEC-00774-github-env-injection-pr-title
Open

[CI][Security] SEC-00774: Prevent GITHUB_ENV injection from PR title on PSDB/buildbot trigger workflows#3050
vkallesh wants to merge 2 commits into
amd-stagingfrom
security/vkallesh/SEC-00774-github-env-injection-pr-title

Conversation

@vkallesh

@vkallesh vkallesh commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Fix for ROCM-26707

vkallesh and others added 2 commits June 24, 2026 13:31
…on PSDB/buildbot triggers

Critical finding SEC-00774: the "Escape pull request title" step wrote the raw PR
title to $GITHUB_ENV as `PR_TITLE=<title>`. A crafted multi-line PR title could
inject arbitrary environment variables into all subsequent steps, which run on
persistent self-hosted compiler-generic-runners that have org credentials in
scope (CI_GITHUB_TOKEN, CI_JENKINS_TOKEN, BUILDBOT_PWD) -> potential RCE and
secret exfiltration by any external contributor able to open a PR.

Changes (PSDB-amd-staging.yml and buildbot-psdb-trigger.yml):
- Write PR_TITLE to $GITHUB_ENV using a random here-doc delimiter
  (PR_TITLE<<ghadelimiter_<uuid>) so a multi-line title is stored as a single
  value and cannot define additional variables. Title is read from the event
  payload file (never interpolated into the shell). Also guards against a title
  that contains the generated delimiter.
- Remove credential secrets from job-level `env:` and scope them to only the
  step that needs them:
  - PSDB: CI_GITHUB_TOKEN / CI_JENKINS_JOB_NAME / CI_JENKINS_URL -> "Trigger
    Jenkins Pipeline" step only.
  - buildbot: CI_GITHUB_TOKEN -> "Set Initial Status to Pending" and "Poll
    Buildbot build status" steps only.
- Add top-level `permissions: contents: read` to both workflows.

Follow-up (infra, not in workflow YAML): migrate compiler-generic-runners to
ephemeral (single-job) runners as recommended in the finding.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vkallesh vkallesh requested review from ronlieb and skganesan008 June 24, 2026 14:37

@skganesan008 skganesan008 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please remove both the files.

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.

2 participants