Summary
An arbitrary file overwrite vulnerability in the InTouch Contacts & Caller ID app allows crafted imports to overwrite internal application files on the device filesystem.
When an attacker can influence or supply files to the import process, this flaw can lead to arbitrary code execution or unintended exposure of sensitive information stored by the app.
Affected context
This vulnerability appears in the file import functionality of the InTouch Contacts & Caller ID application (v6.38.1).
It is relevant when:
- The app accepts files from external sources such as messaging apps, cloud storage, or downloads
- The import handler writes received file content into application-controlled storage paths
- Path and filename are derived from user-controlled or externally supplied metadata without strict validation
Under these conditions, file imports can overwrite internal configuration, cache, or possibly executable-related resources.
Exploit preconditions
- Attack surface: File import interface (e.g., "open with InTouch," in-app import dialogs, or content provider inputs)
- Required access: Ability to supply or control a file being imported by the victim app (often achievable through sending files, sharing links, or placing files in accessible storage)
- Trigger point: User or automated workflow that causes the app to import and store the provided file
- Why exploitation is possible: The app's import logic does not adequately constrain output paths or filenames, allowing crafted inputs to overwrite sensitive internal files rather than being stored in a safe, dedicated location
Why this happens
The underlying issue is improper handling of file paths and names derived from untrusted input during the import process.
Instead of normalizing and constraining the destination to a fixed, application-controlled directory, the app allows attacker-influenced values to dictate where data is written.
This aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where a missing or incomplete validation of filesystem paths enables writes outside the intended directory scope.
As a result, internal files such as configuration data, cache, or components influencing execution behavior can be overwritten with attacker-controlled content.
Potential impact
- Overwriting application configuration files that may:
- Alter runtime behavior in attacker-controlled ways
- Degrade security settings or logging
- Overwriting internal data files, leading to:
- Loss or corruption of user contact information
- Exposure of previously protected data if access controls are weakened
- Enabling arbitrary code execution where overwritten files are interpreted, loaded, or executed by the app or underlying platform
- Facilitating further compromise of the device environment through chained attacks using modified application state
General mitigation guidance
Effective mitigation typically focuses on strictly constraining file write locations and reducing the trust placed in imported file metadata:
- Resolve all destination paths against a fixed, application-owned base directory and reject any path that attempts to traverse outside it
- Normalize and canonicalize paths before use, explicitly blocking directory traversal sequences and unusual separators
- Generate safe, internal filenames independent of user-supplied names, using IDs or random tokens
- Apply strict allowlists for expected file types, formats, and size and reject anything that does not conform
- Store imported content in non-executable locations and avoid directly loading imported files as code, scripts, or configuration without additional validation
- Run sensitive parsing or processing logic under least-privilege, ensuring overwritten files cannot escalate to full code execution by design
How teams detect issues like this
Detection efforts can combine code-level analysis and behavioral monitoring:
- Static analysis: Search for file write APIs where the target path is derived from external input (e.g., Intent data, URIs from content providers, or filenames from user input) without normalization and directory constraints
- Code review: Examine the import workflow and verify that every file write uses a fixed base directory and sanitized filename; flag any use of raw user-controlled path segments
- Policy enforcement: Introduce secure coding guidelines for filesystem operations, such as mandatory use of helper APIs that enforce safe directories and canonicalization
- Runtime testing: Use fuzzing and dynamic tests to supply crafted paths and filenames (including traversal sequences) through file import channels, assessing whether internal app files can be overwritten
Automated mobile security scanners and CI-integrated SAST tools can assist in identifying path-handling anti-patterns during development.

