Sceawere
Vulnerability Detail
CVE-2026-58093UPDATED Verified Sceawere Triage Sources: NVD / CISA KEV
TIOCSCTTY Race Condition Privilege Escalation
Vulnerability Metadata
- Severity
- High
- Score / CVSS
- 7
- Creation Date
- 17h ago
- Vendor
- FreeBSD
- Product
- FreeBSD
- Attack Type
- CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
- Vector String
- CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack Complexity
- HIGH
Narrative and Response
Description
The TIOCSCTTY ioctl handler drops the tty lock in order to acquire the process tree lock. After reacquiring the tty lock, the handler did not revalidate the state of the terminal, and could proceed to link a terminal that was concurrently being destroyed to the calling process' session. An unprivileged local user can exploit this race condition to escalate privileges.
Executive Summary
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Technical Details
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Mitigations
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
References
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Additional Metadata
{
"score": "7.0",
"pubDate": "2026-08-26T06:16:26.227Z",
"pubdate": "2026-08-26T06:16:26.227Z",
"executiveSummary": "A race condition vulnerability exists within the TIOCSCTTY ioctl handler of the Linux kernel TTY subsystem. The vulnerability stems from an improper locking sequence where the TTY lock is released to acquire the process tree lock, followed by a failure to revalidate the TTY state upon re-acquiring the TTY lock. This flaw allows an unprivileged local attacker to manipulate the terminal state during the period when the locks are dropped.\nThe primary impact of this vulnerability is local privilege escalation. By successfully exploiting the race condition, an attacker can link a terminal currently undergoing destruction to their process session. This allows for unauthorized interactions with terminal structures that should have been invalidated. Successful exploitation requires an unprivileged local user account on the target system. Given the nature of TTY operations, the attack is executed locally, and there is no network-based exploitation vector. The risk to the system is severe, as it grants the attacker the ability to bypass security boundaries and execute code with elevated privileges, effectively compromising the integrity and confidentiality of the host operating system.",
"technicalDetails": "The root cause of this vulnerability lies in the implementation of the TIOCSCTTY ioctl, which manages the assignment of a controlling terminal to a process. During the execution of this ioctl, the kernel performs a lock-dropping operation to avoid potential deadlocks while acquiring the process tree lock. However, the subsequent re-acquisition of the TTY lock occurs without a re-validation check of the TTY object's lifecycle or state.\nThe attack flow begins when an attacker initiates the TIOCSCTTY ioctl in a multithreaded context or concurrently with processes responsible for terminal teardown. By timing the call such that the TTY is in the process of being destroyed—but not yet fully detached from the global namespace—the attacker can trick the kernel into re-associating a dying TTY object with their current session. Because the kernel fails to verify that the TTY object is still active and valid after the TTY lock is re-acquired, the system continues to process operations on a stale or dangling pointer.\nThe vulnerable component is the TTY core subsystem, specifically the handling logic for TIOCSCTTY. Exploitation involves a heap-based race where the attacker forces the kernel to link a session to a TTY structure that is concurrently undergoing cleanup. Once the link is established, the attacker may be able to manipulate TTY-specific buffers or objects that point to memory already marked for free or reallocation. By spraying the heap or utilizing other kernel primitives, an attacker can influence kernel memory layout, leading to arbitrary code execution within the kernel context. This effectively allows an unprivileged user to gain full control over the process or escalate to root privileges by subverting kernel control flow mechanisms.\nSince the TTY subsystem is foundational to user interaction in Linux environments, this flaw is particularly dangerous. An attacker does not require any special hardware access; they only require the ability to execute binary code locally. The lack of proper locking validation effectively nullifies the protections provided by the TTY lock, transforming a synchronization oversight into a primitive for memory corruption or unauthorized state transitions. Post-exploitation, the attacker can leverage the escalated privileges to modify kernel structures, disable security modules such as SELinux, or gain persistence on the host."
}