fix(app): stop evaluating firebase.json content as Ruby/Python source in ios_config.sh - #9294
Open
russellwheatley wants to merge 2 commits into
Open
fix(app): stop evaluating firebase.json content as Ruby/Python source in ios_config.sh#9294russellwheatley wants to merge 2 commits into
russellwheatley wants to merge 2 commits into
Conversation
… in ios_config.sh A single quote in a firebase.json string value breaks out of the Ruby string literal that ios_config.sh interpolates config values into, letting arbitrary Ruby run as the build user during the iOS Xcode build phase (CWE-94). Pass firebase.json's path and the requested key through ARGV/sys.argv instead of splicing file content into Ruby/Python source strings, and regenerate the CocoaPods-embedded copy of the script in the test app's Xcode project to match. Adds a regression test that reproduces the original PoC and asserts the injected code no longer executes.
…are fixture test-rn-bare/ios/testrnbare.xcodeproj/project.pbxproj carried the same pre-fix, vulnerable copy of the Core Configuration build phase script. Its own CI workflow only triggers on test-rn-bare/** and a few native paths this PR doesn't touch, so it would otherwise stay unpatched and untested after this merges.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9294 +/- ##
============================================
- Coverage 69.45% 69.43% -0.01%
+ Complexity 2122 2121 -1
============================================
Files 443 443
Lines 25537 25537
Branches 4259 4259
============================================
- Hits 17733 17728 -5
- Misses 6404 6406 +2
- Partials 1400 1403 +3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
russellwheatley
marked this pull request as ready for review
September 8, 2026 10:14
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.
packages/app/ios_config.shsplicedfirebase.jsoncontent straight intoruby -e/python3 -csource strings when reading config keys during the iOS Xcode build phase. A single quote in a string value breaks out of the Ruby string literal, so the rest of the value runs as Ruby with the build user's privileges (CWE-94). Reported privately through our security disclosure process, credit to the reporter.Exploiting this needs attacker control over
firebase.jsoncontent (a malicious project contribution, a copied config artifact, or a compromised config-supply chain), it isn't reachable from the mobile runtime.firebase.json's path and the requested key(s) throughARGV/sys.argvinstead of interpolating file content into interpreter source, for both the root parse andgetFirebaseJsonKeyValuetests/ios/testing.xcodeproj/project.pbxprojto match (this is the copy Xcode actually runs for the e2e test app)test-rn-bare/ios/testrnbare.xcodeproj/project.pbxproj, which carried the same vulnerable patternpackages/app/__tests__/iosConfig.test.js, a regression test that runs the script against a craftedfirebase.jsoncontaining the injection payload and asserts it doesn't execute