Skip to content

fix(sharing): preserve trusted caller validation - #5226

Open
MohamadJaara wants to merge 1 commit into
developfrom
mo/fix-share-caller-validation
Open

fix(sharing): preserve trusted caller validation#5226
MohamadJaara wants to merge 1 commit into
developfrom
mo/fix-share-caller-validation

Conversation

@MohamadJaara

Copy link
Copy Markdown
Member

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 (f6228cd) to head (63d7aed).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5226      +/-   ##
===========================================
+ Coverage    52.46%   52.55%   +0.09%     
===========================================
  Files          739      739              
  Lines        25729    25739      +10     
  Branches      4220     4221       +1     
===========================================
+ Hits         13498    13527      +29     
+ Misses       10940    10918      -22     
- Partials      1291     1294       +3     
Files with missing lines Coverage Δ
...rc/main/kotlin/com/wire/android/ui/WireActivity.kt 93.33% <100.00%> (+13.33%) ⬆️
...id/ui/sharing/ImportMediaAuthenticatedViewModel.kt 63.90% <100.00%> (+13.53%) ⬆️

... 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 f6228cd...63d7aed. 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

Copy link
Copy Markdown
Contributor

Test Results

2 626 tests  +5   2 626 ✅ +5   1m 36s ⏱️ +4s
  335 suites +2       0 💤 ±0 
  335 files   +2       0 ❌ ±0 

Results for commit 63d7aed. ± Comparison against base commit f6228cd.

@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 🤔

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.

2 participants