Repository navigation
fix(security): turn pinning off only for a recognised spelling, and refuse a release that carries another - #1005
Merged
Merged
Conversation
…efuse a release that carries another ENABLE_SSL_PINNING was read as false for anything but true/1/yes/on, so a typo or a stray blank silently shipped a staging or production release unpinned, and the build helpers passed it. Only the on and off spellings now override the default; any other value keeps it, AppConfig reports it, main() refuses a release that carries it, and scripts/ci/ssl_pinning_defines.sh and fastlane/ssl_pinning.rb refuse to build it. .env.example and configuration.md list the accepted values. Refs #991 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…helper, and report an unrecognised value The shell helper deleted every space, so "o n" passed it while the app refuses to start on it. It now trims only the ends, as the app and the Ruby helper do. printConfig and getDebugInfo report an unrecognised value, the release refusal shows at most 32 characters of it, and the security guide lists the accepted spellings. Refs #991 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
koniz-dev
added a commit
that referenced
this pull request
Oct 30, 2026
Refs #991 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ENABLE_SSL_PINNINGwas read throughEnvConfig.getBool, which treats anything buttrue/1/yes/onas false. So a typo (ture,enabled) or a stray blank silently turned pinning off in a staging or production release, with valid fingerprints and no warning. Both build helpers passed such a value through.Change.
AppConfig.enableSslPinninghonours only the on spellings (true,1,yes,on) and the off spellings (false,0,no,off), in any case and trimmed. Any other value keeps the environment's default.AppConfig.sslPinningFlagUnrecognisedreports such a value, andmain()refuses to start a release that carries one, naming the value.tool/golden/stripped/lib/main.dartmirrors the change.scripts/ci/ssl_pinning_defines.shandfastlane/ssl_pinning.rbrefuse a staging or production build with such a value. They now trim the flag as the app does, so" OFF "is an opt-out in all three places..env.exampleanddocs/guides/configuration.mdlist the accepted spellings.Tests.
test/core/config/ssl_pinning_flag_test.dart: in staging and production,enabled,tureand" "keep pinning on and are reported.False,OFF,0andnoopt out. An unset flag is not reported. With the old parsing, the six unrecognised cases fail.startup_reachability_test.dart: a production release with valid fingerprints andENABLE_SSL_PINNING=enabledboots into the failure screen, naming"enabled".build_all_analyze_size_test.dartandfastlane_ssl_pinning_rb_test.dart:enabledand" "are refused even with fingerprints, and a padded upper-case opt-out builds. With the old helpers, these 4 fail.Pre-merge review (a fresh
qasubagent on the diff): the fail-open is closed in all three places. Its findings, fixed in the second commit:"o n"and"t r u e"passed it while the app refuses to start on them. It now trims only the ends. Tests were added; against the first commit they fail.printConfigandgetDebugInfonow report an unrecognised value, so a debug run is not silent either.ENABLE_SSL_PINNING=true.It also confirmed:
getBoolflag fails open in its unsafe direction (debug features and HTTP logging fail closed);main()is right;Refs #991
🤖 Generated with Claude Code