TOCTTOU ("time of check to time of use") "cwd" variable race condition
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Apport |
Fix Released
|
High
|
Unassigned | ||
apport (Ubuntu) |
Fix Released
|
High
|
Unassigned |
Bug Description
Author: Sander Bos, <https:/
Date: 2019-07-30
In data/apport, Apport reads out the current working directory of a
crashed process in get_pid_info() and puts it into the "cwd" variable:
83 cwd = os.readlink(
Later, this variable gets used in calls to write_user_
writing the core dump file:
181 core_path = os.path.join(cwd, 'core')
The time between setting the "cwd" variable and using the variable forms
a TOCTTOU issue, and can be abused by a user to create a core dump file
in a different directory than the actual current working directory of
the crashed process (being Apport's intended destination directory for
the core dump file). This can for example be abused replacing (any path
component of) the directory to which "cwd" points with a FUSE bindfs(1)
or similar file system mount point, or by a symbolic link to an arbitrary
(and potentially root owned) directory.
Moreover, when using FUSE, basically "anything" could be put behind the
"mount point" leading to various potential exploitation scenarios, e.g.,
an indefinite sleep() would lead to (some form of) DoS for Apport.
Proposed fix: if possible, use a file descriptor for handling "cwd".
CVE References
Changed in apport (Ubuntu): | |
importance: | Undecided → High |
Changed in apport: | |
importance: | Undecided → High |
Changed in apport (Ubuntu): | |
assignee: | nobody → Canonical Security Team (canonical-security) |
Changed in apport (Ubuntu): | |
assignee: | Canonical Security Team (canonical-security) → Ubuntu Security Team (ubuntu-security) |
information type: | Private Security → Public Security |
tags: | added: id-5d640ed806b8601dd0ea00ab |
Changed in apport: | |
milestone: | none → 2.21.0 |
status: | New → Fix Released |
CVE-2019-11482 has been assigned for this issue.