Skip to content

[Security research PoC — do not merge] Custard CI fork-PR trust-boundary probe#4290

Closed
mohammadmseet-hue wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
mohammadmseet-hue:poc-ci-trust-boundary-20260419
Closed

[Security research PoC — do not merge] Custard CI fork-PR trust-boundary probe#4290
mohammadmseet-hue wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
mohammadmseet-hue:poc-ci-trust-boundary-20260419

Conversation

@mohammadmseet-hue
Copy link
Copy Markdown
Contributor

⚠️ Security research PoC — please do not merge

This PR is a benign, print-only probe submitted as part of a Google VRP submission in preparation on g.co/vulnz. It adds a before() hook in the helloworldGet test that logs a marker string plus the presence (as booleans / filename suffixes only) of auth-related environment variables set by custard-run.yaml. No network calls, no secrets read, no GCP API invocations, no side effects — existing assertions still pass.

What this demonstrates

.github/workflows/custard-run.yaml is triggered by workflow_run: types: [in_progress] on "Custard CI" (which runs on bare pull_request:), checks out github.event.workflow_run.head_sha, and executes make test dir=… on PR code after google-github-actions/auth@v3 has written the WIF credentials file for kokoro-system-test@long-door-651.iam.gserviceaccount.com to disk. This means arbitrary test code from any approved external contributor's PR executes inside the Custard CI test job with GOOGLE_APPLICATION_CREDENTIALS set.

The marker strings emitted by this PR — NODEJS_DOCS_SAMPLES_CI_TRUST_BOUNDARY_POC_20260419_MHDSAIT — will appear in the public CI run log if the workflow executes, providing live evidence that fork test code runs with auth context. That log reference will be included verbatim in the upcoming VRP submission.

Precedent

Same supply-chain class as:

  • GoogleCloudPlatform/magic-modules — VRP $31,337 (Divyanshu, 2023)
  • data-integrations/* + cdapio/* — VRP $15,000 (CDAP multi-repo, 2024)
  • GoogleCloudPlatform/microservices-demo / ci-pr.yaml — VRP submission 497433408 (Apr 2026)

The microservices-demo submission is on a different workflow (pull_request trigger, self-hosted GCE runners, GKE deploy), and its if: head.repo.full_name == github.repository fix does not apply to custard-run.yaml (different trigger, different runner, different auth path). Separate root cause, separate mitigation.

Action requested

If the first-time-contributor approval gate blocks the run, a triager from Google VRP / g.co/vulnz will be able to approve the one-off run after review. No merge requested. Happy to close immediately once the log capture is complete.

Reporter: @mohammadmseet-huemohammadmseet@gmail.com

Adds a print-only before() hook that logs the presence of auth-related env
vars (as booleans/suffixes only — no secrets, no network calls, no API
requests, no side effects). Tests all existing assertions still pass.

This PR is a security-research PoC intended to demonstrate the fork-PR
trust boundary on custard-run.yaml. If accepted, please close; do not
merge to main.

Reference: g.co/vulnz submission in preparation.
@mohammadmseet-hue mohammadmseet-hue requested review from a team as code owners April 19, 2026 21:45
@product-auto-label product-auto-label Bot added samples Issues that are directly related to samples. api: cloudfunctions Issues related to the Cloud Run functions API. asset: pattern DEE Asset tagging - Pattern. labels Apr 19, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a security research proof-of-concept in the test suite that logs environment variables related to GCP authentication and project configuration. A security concern was raised regarding the logging of this metadata to standard output, as it could expose sensitive CI/CD environment details in public logs.

Comment on lines +43 to +48
console.log('GAC_IS_SET=' + !!process.env.GOOGLE_APPLICATION_CREDENTIALS);
console.log('GAC_PATH_SUFFIX=' + (process.env.GOOGLE_APPLICATION_CREDENTIALS || '').split('/').pop());
console.log('GOOGLE_CLOUD_PROJECT=' + (process.env.GOOGLE_CLOUD_PROJECT || 'unset'));
console.log('GOOGLE_SAMPLES_PROJECT=' + (process.env.GOOGLE_SAMPLES_PROJECT || 'unset'));
console.log('SERVICE_ACCOUNT=' + (process.env.SERVICE_ACCOUNT || 'unset'));
console.log('CLOUDSDK_AUTH_ACCESS_TOKEN_SET=' + !!process.env.CLOUDSDK_AUTH_ACCESS_TOKEN);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

security-high high

Logging environment variables and their metadata (such as path suffixes or existence flags) to standard output is a security concern. This practice can expose sensitive configuration details of the CI/CD environment in public logs, which could be leveraged by an attacker. Even in a research PoC, it is best to avoid logging such information directly to the console.

@mohammadmseet-hue
Copy link
Copy Markdown
Contributor Author

Closing this research PoC. Withdrawing the probe; the structural pattern is fully demonstrable from the public workflow YAML and existing public Custard CI logs (run #24586751684). No live run is required for the VRP report. Apologies for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: cloudfunctions Issues related to the Cloud Run functions API. asset: pattern DEE Asset tagging - Pattern. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant