/

CVE-2026-58460

Severity:

HIGH RISK

(7.7)

Path Traversal (CWE-22) in React Native Sharing Intent

CVE-2026-58460

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Overwrite in App Private Storage

Severity:

HIGH RISK

(7.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal flaw in react-native-receive-sharing-intent allows crafted file names from a malicious ContentProvider to escape the intended cache directory.

A co-resident Android app can exploit this by sending a specially crafted ACTION_SEND intent, enabling it to overwrite arbitrary files in the target app's private storage with attacker-controlled data.

Affected context

This vulnerability arises in Android applications that integrate the react-native-receive-sharing-intent library and expose a share-receiver activity to handle ACTION_SEND intents.

The issue becomes relevant when the library trusts the _display_name field supplied by an external ContentProvider and uses it directly to construct file paths under a cache directory.

On devices where a malicious app is installed, that app can co-reside and interact with the vulnerable app's exported share-receiver to influence where incoming shared files are written.

Exploit preconditions

  • Attack surface: Local inter-app communication via Android intents and ContentProviders.
  • Required access: Installation of a malicious app on the same device capable of issuing explicit ACTION_SEND intents to the vulnerable app's exported activity.
  • Trigger point: The vulnerable app processes a shared file whose _display_name contains .. segments, causing the library to construct a path that escapes the cache directory.
  • Why exploitation is possible: The library fails to sanitize or canonicalize the _display_name before using it in filesystem operations, allowing directory traversal and writes outside the intended cache path.

Why this happens

The core defect maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory (Path Traversal).

The library constructs file system paths by concatenating a base cache directory with a user-controlled _display_name value without normalizing or validating it.

Because no check is performed to ensure the final resolved path remains within the intended directory, an attacker can insert ../ components to traverse directories and target arbitrary files under the application's private storage.

Potential impact

  • Overwriting application databases with attacker-controlled content, potentially corrupting or manipulating stored data.
  • Modifying shared preferences to alter feature flags, authentication state, or configuration values.
  • Replacing cached configuration or temporary files to influence application behavior.
  • Causing application crashes or denial of service by corrupting critical internal files.
  • Creating conditions that may assist in further logic or security bypasses within the app.

General mitigation guidance

Mitigation generally focuses on strictly constraining file paths derived from external input and treating all inter-app data as untrusted.

Common defensive patterns include:

  • Normalizing and canonicalizing filenames, rejecting any that contain .., path separators, or other traversal indicators.
  • Generating server-side or application-side filenames (e.g., random UUIDs) instead of trusting _display_name or other external metadata.
  • Ensuring that after path resolution, the resulting path is verified to reside strictly under the intended cache or storage directory before performing write operations.
  • Minimizing exposure of exported activities and requiring appropriate permissions or intent filters where possible, thereby reducing unintended inter-app access.
  • Applying least-privilege principles to file operations, limiting what locations the app writes to based on clear, pre-defined rules instead of dynamic input.

How teams detect issues like this

Detection efforts can focus on both code-level review and behavioral testing:

  • Static analysis rules that flag direct concatenation of filesystem paths with data sourced from intents, ContentProviders, or other IPC channels.
  • Code review checklists that require verification of path canonicalization and directory-bound checks wherever external filenames or paths are consumed.
  • Automated tests that send crafted ACTION_SEND intents with _display_name containing ../ sequences to observe whether the app writes outside the expected directory.
  • Security-focused linting or mobile app security scanners configured to detect path traversal patterns and unvalidated use of external metadata in file operations.

Sources

SourceLink
github.comgithub.com/ajith-ab/react-native-receive-sharing-intent/pull/192
vulncheck.comvulncheck.com/advisories/react-native-receive-sharing-intent-path-traversal-via-display-name

Frequently asked

questions

Not in the traditional network sense. Exploitation requires a malicious app installed on the same device that can send explicit intents to the vulnerable app's exported activity.

The attacker must be able to install and run an app on the device. That app then uses Android IPC mechanisms (intents and ContentProviders) to supply crafted _display_name values to the vulnerable app.

The most robust fix is to avoid using untrusted _display_name values in path construction altogether, instead generating internal filenames and enforcing strict directory boundaries through canonicalization and validation checks.

Treat all metadata from other apps as untrusted, enforce strong input validation on any values used in filesystem paths, adopt secure coding guidelines for Android IPC, and incorporate security-focused code review and static analysis into the development lifecycle.

Find out what's already
exploitable in your codebase.