Privilege Escalation by manipulating system files via hard links [severity: low]
- Dominant language
- C
- Stars
- 20.5k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
## Tags
**Severity: low**
**Difficulty: low**
## Issue
In ISH 1.2.3(197) there is an issue with 'ln' and 'unlink' in which the program does not check who owns the file or if the user has permission to create a file in the specified location before removing or creating the hard link.
## Implications
This issue enables a non-root user to effectively create, delete or replace files owned by any user, which can result in privilege escalation.
## Reason for the categorization.
ISH allows for the manipulation of arbitrary files through the Apple Files app and allows the exporting of the file system to any person with physical access to the device in an unlocked state.
## Exploitation
These commands shouldn't be run as root or any other privileged user as it defeats the purpose of the privilege escalation.
**Requirements:**
access to the commands 'ln' and 'unlink'
path to target file
replacement file (in home directory)
a place to save the old file (to reverse the action in the future)
```
link PATH-TO-TARGET OLD-FILE #to reverse the action in the future
unlink PATH-TO-TARGET OLD-FILE
link REPLACEMENT-FILE PATH-TO-TARGET
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the implementations of the `ln` and `unlink` commands and read how they handle ownership and permissions before creating or removing hard links. Reproduce the reported sequence in a safe test environment, then verify that unauthorized manipulation of another user's file is prevented and that legitimate operations still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, ios, linux
- Domain
- cli, operating-systems, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100