You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Secret scanner false positives block mobile release (Codemagic) #8742
scripts/scan-public-artifact-secrets.py blocks iOS and Android Codemagic builds with false positives, preventing mobile releases.
iOS: framework binary false positives
The scanner runs a regex \b[A-Z][A-Z0-9_]{2,}\b on all files in the IPA, including compiled third-party framework binaries. BoringSSL constants in TwilioVoice.framework and Flutter.framework — CLIENT_EARLY_TRAFFIC_SECRET, PRIVATE_KEY_ENCODE_ERROR — match denied name patterns (^|_)SECRET($|_) and (^|_)PRIVATE_KEY($|_).
shopt -s nullglob before the scanner call causes the glob build/**/outputs/**/*.aab to expand to zero arguments when no AAB exists. argparse crashes with "the following arguments are required: artifacts".
Scanner v1 fix was insufficient — full findings from Codemagic build testing
Hey @Git-on-my-level! We ran your scanner against real Codemagic iOS builds and hit false positives beyond what the v1 fix (PR #8741) covered. Here's what we found — hoping this helps you fix it properly since you know the scanner best.
False positive sources discovered
The in_framework check from v1 only covers .framework/ dirs, but compiled binaries and config files outside .framework/ also false-positive:
Runner (Mach-O binary, no extension) — contains BoringSSL/TLS constants like CLIENT_EARLY_TRAFFIC_SECRET, PRIVATE_KEY_ENCODE_ERROR
BatteryWidget.appex/BatteryWidget — enum names like CREDENTIAL_MISMATCH, API_KEY, PROJECT_TOKEN
GoogleService-Info.plist — config key names like API_KEY, GCM_SENDER_ID (already handled by your is_public_firebase_config in later commits)
The regex \b[A-Z][A-Z0-9_]{2,}\b matches ANY uppercase identifier with 3+ chars. In compiled iOS binaries, thousands of such identifiers exist as enum names, config keys, and SDK constants — none are actual secrets. The exact denied name byte search (for name in denied: if name.encode() in data) and private key markers also match compiled binary content.
What we tested
We triggered Codemagic ios-internal-auto builds from a fix branch. The approach that passed was restricting heuristic scans (private key markers, denied name bytes, regex tokens) to files with known text extensions only (.env, .json, .yaml, .swift, .dart, etc.) — while keeping CI secret value leak detection on ALL files. See PR #8747 (now closed) for the full implementation and 14-test suite if useful as reference.
Also: empty glob exit code
The nargs='*' + return 1 on empty artifacts kills the Codemagic pipeline when Android nullglob matches nothing (no AAB built yet). The build step itself already fails if no artifact was produced, so the scanner exiting 1 is redundant and blocks the pipeline. Consider return 0 with a warning.
Codemagic build evidence
Build 6a451afb6f01cbbe3a0303b7 (v1 scanner) — FAILED on framework false positives
@Git-on-my-level One more thing — once you've got the scanner fix working, could you please let @beastoin know directly? We've got a mobile release blocked on this (build 970 failed on all 4 Codemagic workflows due to the scanner false positives). We need confirmation that the scanner passes on a real Codemagic build before we can re-tag and ship.
Activity
beastoin commentedon Jul 2, 2026
Scanner v1 fix was insufficient — full findings from Codemagic build testing
Hey @Git-on-my-level! We ran your scanner against real Codemagic iOS builds and hit false positives beyond what the v1 fix (PR #8741) covered. Here's what we found — hoping this helps you fix it properly since you know the scanner best.
False positive sources discovered
The
in_frameworkcheck from v1 only covers.framework/dirs, but compiled binaries and config files outside.framework/also false-positive:Runner(Mach-O binary, no extension) — contains BoringSSL/TLS constants likeCLIENT_EARLY_TRAFFIC_SECRET,PRIVATE_KEY_ENCODE_ERRORBatteryWidget.appex/BatteryWidget— enum names likeCREDENTIAL_MISMATCH,API_KEY,PROJECT_TOKENGoogleService-Info.plist— config key names likeAPI_KEY,GCM_SENDER_ID(already handled by youris_public_firebase_configin later commits).framework/contents — TwilioVoice, Flutter, Firebase SDK constants (covered by v1)Root cause
The regex
\b[A-Z][A-Z0-9_]{2,}\bmatches ANY uppercase identifier with 3+ chars. In compiled iOS binaries, thousands of such identifiers exist as enum names, config keys, and SDK constants — none are actual secrets. The exact denied name byte search (for name in denied: if name.encode() in data) and private key markers also match compiled binary content.What we tested
We triggered Codemagic ios-internal-auto builds from a fix branch. The approach that passed was restricting heuristic scans (private key markers, denied name bytes, regex tokens) to files with known text extensions only (
.env,.json,.yaml,.swift,.dart, etc.) — while keeping CI secret value leak detection on ALL files. See PR #8747 (now closed) for the full implementation and 14-test suite if useful as reference.Also: empty glob exit code
The
nargs='*'+return 1on empty artifacts kills the Codemagic pipeline when Androidnullglobmatches nothing (no AAB built yet). The build step itself already fails if no artifact was produced, so the scanner exiting 1 is redundant and blocks the pipeline. Considerreturn 0with a warning.Codemagic build evidence
6a451afb6f01cbbe3a0303b7(v1 scanner) — FAILED on framework false positives6a451ff6089a3997e9181f57(text-extension-only approach) — PASSED cleanLet us know if you need any help or want to pair on this — happy to share the test artifacts and approach details!
by AI for @beastoin
beastoin commentedon Jul 2, 2026
@Git-on-my-level One more thing — once you've got the scanner fix working, could you please let @beastoin know directly? We've got a mobile release blocked on this (build 970 failed on all 4 Codemagic workflows due to the scanner false positives). We need confirmation that the scanner passes on a real Codemagic build before we can re-tag and ship.
Thanks David! 🙏
by AI for @beastoin
Fix public artifact scanner binary false positives (#9104)