fix(analytics): validate hashed conversion inputs - #9234
Merged
mikehardy merged 2 commits intoSep 1, 2026
Merged
Conversation
mikehardy
force-pushed
the
codex/analytics-validate-hashed-conversion-inputs
branch
from
August 30, 2026 23:05
cee7526 to
fefaa1e
Compare
Collaborator
|
Rebased onto current Tests
Also in this update
Local verification (Android ∥ iOS ∥ macOS)
|
mikehardy
approved these changes
Aug 30, 2026
mikehardy
left a comment
Collaborator
There was a problem hiding this comment.
Hey @OskarEichler 👋
Thanks for the PR - this looks like a real problem to me. I ran local Jest/unit plus the android/ios/macos e2e suite against it here and it came out clean. Pending CI, then I'll merge.
Cheers
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9234 +/- ##
============================================
- Coverage 68.62% 68.59% -0.03%
- Complexity 1917 2096 +179
============================================
Files 525 441 -84
Lines 38250 25163 -13087
Branches 5206 4256 -950
============================================
- Hits 26247 17257 -8990
+ Misses 10203 6528 -3675
+ Partials 1800 1378 -422
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
mikehardy
force-pushed
the
codex/analytics-validate-hashed-conversion-inputs
branch
from
September 1, 2026 11:11
fefaa1e to
b8606ef
Compare
mikehardy
force-pushed
the
codex/analytics-validate-hashed-conversion-inputs
branch
from
September 1, 2026 11:14
b8606ef to
7e65114
Compare
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.
Description
Validate and safely decode the SHA-256 values passed to the hashed on-device conversion APIs.
React Native exposes the hashes as hex strings, while Firebase's Apple SDK requires the decoded 32-byte SHA-256 value. The previous decoder accepted any string, parsed non-hex pairs as lossy zero-like bytes, and indexed past the end of odd-length input. It could therefore pass malformed data to Firebase or raise an Objective-C exception.
This change:
Firebase's on-device conversion guide specifies that the SDK value must be a 32-byte SHA-256 digest rather than a hexadecimal string; this bridge decodes the validated 64-character representation before calling it.
Breaking changes
No public API or type changes.
This is an observable input-validation correction: malformed, non-hex, or non-64-character hash strings now reject instead of being silently decoded into invalid bytes or triggering an out-of-bounds exception. Valid lowercase and uppercase SHA-256 hex strings are unchanged.
Related issues
No matching open issue found.
Release Summary
Validated and safely decoded hashed Analytics on-device conversion inputs on iOS.
Checklist
Android(shared JavaScript validation/no-op contract)iOSOther(shared validation and macOS compilation)e2etests added or updated inpackages/**/e2ejesttests added or updated inpackages/**/__tests__Test Plan
git diff --check: passing.