Skip to content

fix(sharing): preserve trusted caller validation [WPB-8645] - #5226

Merged
MohamadJaara merged 3 commits into
developfrom
mo/fix-share-caller-validation
Aug 31, 2026
Merged

fix(sharing): preserve trusted caller validation [WPB-8645]#5226
MohamadJaara merged 3 commits into
developfrom
mo/fix-share-caller-validation

Conversation

@MohamadJaara

@MohamadJaara MohamadJaara commented Aug 27, 2026

Copy link
Copy Markdown
Member

https://wearezeta.atlassian.net/browse/WPB-8645

Goal

Keep public shares containing Wire FileProvider URIs gated by the verified sender throughout activity intent handling.

Repro

  1. Keep Wire running so its singleTask activity receives a share through onNewIntent.
  2. Share a Wire FileProvider URI into the app.
  3. On Android 15 or newer, replacing the activity intent drops the verified ComponentCaller.
  4. Intent queueing also loses the caller validation result before the early deep-link security check runs.

Change

  • Preserve the current ComponentCaller when replacing an intent on Android 15 and newer.
  • Capture caller validation when each intent is received and carry it through the intent coordinator.
  • Pass the captured result into the existing early deep-link rejection check.
  • Keep the import-screen validation as a second security check.
  • Use the shared Android-version capability boundary for inbound validation.

Security behavior

  • Android 14 and older continue treating Wire-provider public shares as untrusted.
  • Android 15 and newer require the verified caller to hold the URI read grant.
  • External provider URIs keep their existing behavior.

Coverage

Regression coverage verifies Android 14 rejection, Android 15 grant acceptance and denial, caller preservation, per-intent queueing, and both existing validation layers.

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.55%. Comparing base (58395b5) to head (34d127d).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5226      +/-   ##
===========================================
+ Coverage    52.46%   52.55%   +0.08%     
===========================================
  Files          740      740              
  Lines        25735    25745      +10     
  Branches      4223     4224       +1     
===========================================
+ Hits         13502    13530      +28     
+ Misses       10942    10920      -22     
- Partials      1291     1295       +4     
Files with missing lines Coverage Δ
...rc/main/kotlin/com/wire/android/ui/WireActivity.kt 93.33% <100.00%> (+13.33%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 58395b5...34d127d. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Test Results

2 634 tests  +5   2 634 ✅ +5   1m 34s ⏱️ +13s
  336 suites +2       0 💤 ±0 
  336 files   +2       0 ❌ ±0 

Results for commit 2e4b604. ± Comparison against base commit 58395b5.

♻️ This comment has been updated with latest results.

@yamilmedina yamilmedina left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice fix! I think this is why sharing logs to wire does not work now 🤔

@MohamadJaara
MohamadJaara force-pushed the mo/fix-share-caller-validation branch from 63d7aed to e4874fc Compare August 31, 2026 12:20
@MohamadJaara MohamadJaara changed the title fix(sharing): preserve trusted caller validation fix(sharing): preserve trusted caller validation [WPB-8645] Aug 31, 2026
@MohamadJaara
MohamadJaara enabled auto-merge August 31, 2026 15:12
@MohamadJaara
MohamadJaara added this pull request to the merge queue Aug 31, 2026
Merged via the queue into develop with commit 958eab9 Aug 31, 2026
20 checks passed
@MohamadJaara
MohamadJaara deleted the mo/fix-share-caller-validation branch August 31, 2026 16:42
@github-actions

Copy link
Copy Markdown
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants