Skip to content

security: fix RCE vulnerability in test_templated_agent workflow#1945

Open
enriquekalven wants to merge 2 commits into
google:mainfrom
enriquekalven:fix/remediate-ci-rce
Open

security: fix RCE vulnerability in test_templated_agent workflow#1945
enriquekalven wants to merge 2 commits into
google:mainfrom
enriquekalven:fix/remediate-ci-rce

Conversation

@enriquekalven
Copy link
Copy Markdown
Contributor

Solution
Revert Trigger: Switched the workflow trigger from pull_request_target back to a standard pull_request trigger.
Secure Checkout: Removed all ref: ${{ github.event.pull_request.head.sha }} inputs from the actions/checkout actions.
By switching to pull_request, any code checked out from external forks will run in a restricted runner sandbox with no access to the base repository's secrets or high-privilege OIDC identity federation. This prevents any malicious changes from accessing sensitive project resources.

Verification & Testing
Validated the syntax of the modified workflow file .github/workflows/test_templated_agent.yaml using a YAML parser.
Verified that no other workflows in .github/workflows/ combine pull_request_target with checking out untrusted head SHAs.

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.

1 participant