Safeguard
Security Guides•

Can a fork pull request reach your mobile signing secrets?

Pull requests from forks should never run with keystores or store keys. How to keep signing material away from untrusted builds in a mobile pipeline.

Safeguard Security Team
4 min read

It should not, and you should design so it cannot. Run untrusted pull request builds without signing material, keep keystores and store keys in a protected release job, and treat any workflow that checks out fork code and also reads secrets as a hole. Platform defaults help, but they are not a plan.

Why mobile pipelines are a special case

A mobile pipeline holds unusually valuable secrets: an Android upload keystore, an iOS certificate, a store API key, a Play service account file. All of them are worth more than a typical test token. A pull request build only needs to compile and run tests, which needs none of them.

What the platform documentation says

A hosted CI service's secure-use guide gives several relevant points:

  • Any user with write access to the repository has read access to all secrets configured in it, so credentials in workflows should have the least privileges required.
  • Workflow triggers such as pull_request_target and workflow_run run with more privilege and must not explicitly check out untrusted code, including from forks.
  • Self-hosted runners can be persistently compromised by untrusted code, so they should almost never be used for public repositories.

A second page covers manual approval: workflow runs from a fork contributor may require approval from a maintainer with write access, and the doc tells reviewers to be especially alert to changes to the workflow files themselves.

Checklist for a safe split

ControlWhat to do
Build identityGive pull request builds no signing keys, no store credentials
TriggersAvoid privileged triggers that check out fork code
Release jobPut signing in one job, reachable only from a protected branch or tag
ApprovalRequire reviewers on the environment holding production secrets
Workflow filesReview changes to pipeline files as carefully as app code
RunnersUse ephemeral runners for untrusted code
CachesDo not let pull request builds write caches the release job restores

The cache link people miss

Caches can carry an attack across the trust boundary. The same documentation set says low-trust triggers get read-only cache access by default, and warns that opening write access reintroduces cache poisoning, where a more privileged workflow later restores attacker-controlled content. Our post on what should never go in a mobile CI cache covers what to keep out.

Debug builds do not need release keys

For Android, build pull requests in debug configuration with the debug keystore, which holds nothing valuable. For iOS, build for simulator or with signing disabled. Production signing happens later, in a job that never ran contributor code.

Test it

Open a draft pull request from a throwaway fork and print whether signing variables exist, without printing their values. If any exist, your split is not working. Do this after changing workflow files, not just once.

Try it yourself

The demo shows how a gate decides whether a pull request may proceed. Click through it and look at what is checked before anything merges.

Click through it at your own pace, or open it full screen.

Where Safeguard fits

Safeguard offers policies and gates on pull requests, SBOM and dependency scanning, and reachability analysis. Try a free scan.

Quick check

Are secrets hidden from every pull request by default?

Defaults vary by trigger and by repository settings. Do not rely on them. Design the pipeline so pull request jobs have no signing material to read.

Is approval of fork runs enough?

It helps, but reviewers can miss a subtle change. Keep the secrets out of that job anyway.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.