# CVE-2025-37814: tty: Require CAP\_SYS\_ADMIN for all usages of TIOCL\_SELMOUSEREPORT

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.34% (percentile 20, 2026-11-26)
- **Published:** 2025-05-08T06:26:10.723Z
- **Modified:** 2026-08-05T11:57:43.544Z

## Who should check

- Anyone running Linux \>= e46d91ca504d69ae3d09c120b162a238b8013890, \< 6f021bc0083b96125fdbed6a60d7b4396c4d6dac; \>= 2f83e38a095f8bf7c6029883d894668b03b9bd93, \< 9b50c9c97db953de756a39af83d4be4d7f618aa6; \>= 2f83e38a095f8bf7c6029883d894668b03b9bd93, \< ee6a44da3c87cf64d67dd02be8c0127a5bf56175; 2714ffdbb79b48dda03334a01af90fb024f39047; \>= 6.12.14, \< 6.12.26; \>= 6.13.3, \< 6.14
- Anyone running Linux 6.14

## Description

In the Linux kernel, the following vulnerability has been resolved:

tty: Require CAP\_SYS\_ADMIN for all usages of TIOCL\_SELMOUSEREPORT

This requirement was overeagerly loosened in commit 2f83e38a095f
("tty: Permit some TIOCL\_SETSEL modes without CAP\_SYS\_ADMIN"), but as
it turns out,

  (1) the logic I implemented there was inconsistent (apologies!),

  (2) TIOCL\_SELMOUSEREPORT might actually be a small security risk
      after all, and

  (3) TIOCL\_SELMOUSEREPORT is only meant to be used by the mouse
      daemon (GPM or Consolation), which runs as CAP\_SYS\_ADMIN
      already.

In more detail:

1. The previous patch has inconsistent logic:

   In commit 2f83e38a095f ("tty: Permit some TIOCL\_SETSEL modes
   without CAP\_SYS\_ADMIN"), we checked for sel\_mode ==
   TIOCL\_SELMOUSEREPORT, but overlooked that the lower four bits of
   this "mode" parameter were actually used as an additional way to
   pass an argument.  So the patch did actually still require
   CAP\_SYS\_ADMIN, if any of the mouse button bits are set, but did not
   require it if none of the mouse buttons bits are set.

   This logic is inconsistent and was not intentional.  We should have
   the same policies for using TIOCL\_SELMOUSEREPORT independent of the
   value of the "hidden" mouse button argument.

   I sent a separate documentation patch to the man page list with
   more details on TIOCL\_SELMOUSEREPORT:
   https://lore.kernel.org/all/20250223091342.35523-2-gnoack3000@gmail.com/

2. TIOCL\_SELMOUSEREPORT is indeed a potential security risk which can
   let an attacker simulate "keyboard" input to command line
   applications on the same terminal, like TIOCSTI and some other
   TIOCLINUX "selection mode" IOCTLs.

   By enabling mouse reporting on a terminal and then injecting mouse
   reports through TIOCL\_SELMOUSEREPORT, an attacker can simulate
   mouse movements on the same terminal, similar to the TIOCSTI
   keystroke injection attacks that were previously possible with
   TIOCSTI and other TIOCL\_SETSEL selection modes.

   Many programs (including libreadline/bash) are then prone to
   misinterpret these mouse reports as normal keyboard input because
   they do not expect input in the X11 mouse protocol form.  The
   attacker does not have complete control over the escape sequence,
   but they can at least control the values of two consecutive bytes
   in the binary mouse reporting escape sequence.

   I went into more detail on that in the discussion at
   https://lore.kernel.org/all/20250221.0a947528d8f3@gnoack.org/

   It is not equally trivial to simulate arbitrary keystrokes as it
   was with TIOCSTI (commit 83efeeeb3d04 ("tty: Allow TIOCSTI to be
   disabled")), but the general mechanism is there, and together with
   the small number of existing legit use cases (see below), it would
   be better to revert back to requiring CAP\_SYS\_ADMIN for
   TIOCL\_SELMOUSEREPORT, as it was already the case before
   commit 2f83e38a095f ("tty: Permit some TIOCL\_SETSEL modes without
   CAP\_SYS\_ADMIN").

3. TIOCL\_SELMOUSEREPORT is only used by the mouse daemons (GPM or
   Consolation), and they are the only legit use case:

   To quote console\_codes(4):

     The mouse tracking facility is intended to return
     xterm(1)-compatible mouse status reports.  Because the console
     driver has no way to know the device or type of the mouse, these
     reports are returned in the console input stream only when the
     virtual terminal driver receives a mouse update ioctl.  These
     ioctls must be generated by a mouse-aware user-mode application
     such as the gpm(8) daemon.

   Jared Finder has also confirmed in
   https://lore.kernel.org/all/491f3df9de6593df8e70dbe77614b026@finder.org/
   that Emacs does not call TIOCL\_SELMOUSEREPORT directly, and it
   would be difficult to find good reasons for doing that, given that
   it would interfere with the reports that GPM is sending.

   More information on the interaction between GPM, terminals and th
---truncated---

## Affected and fixed versions

- Linux: \>= e46d91ca504d69ae3d09c120b162a238b8013890, \< 6f021bc0083b96125fdbed6a60d7b4396c4d6dac; \>= 2f83e38a095f8bf7c6029883d894668b03b9bd93, \< 9b50c9c97db953de756a39af83d4be4d7f618aa6; \>= 2f83e38a095f8bf7c6029883d894668b03b9bd93, \< ee6a44da3c87cf64d67dd02be8c0127a5bf56175; 2714ffdbb79b48dda03334a01af90fb024f39047; \>= 6.12.14, \< 6.12.26; \>= 6.13.3, \< 6.14 (cvelist)
- Linux: 6.14 (cvelist)

## Mitigation

- Upgrade Linux to 6.14 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-37814. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-37814.md
Affected: Linux >= e46d91ca504d69ae3d09c120b162a238b8013890, < 6f021bc0083b96125fdbed6a60d7b4396c4d6dac; >= 2f83e38a095f8bf7c6029883d894668b03b9bd93, < 9b50c9c97db953de756a39af83d4be4d7f618aa6; >= 2f83e38a095f8bf7c6029883d894668b03b9bd93, < ee6a44da3c87cf64d67dd02be8c0127a5bf56175; 2714ffdbb79b48dda03334a01a…
Fixed in: Linux 6f021bc0083b96125fdbed6a60d7b4396c4d6dac, Linux 9b50c9c97db953de756a39af83d4be4d7f618aa6, Linux 6.12.26, Linux 6.14

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-37814 being exploited?

There is no confirmed exploitation: CVE-2025-37814 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.34% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-37814?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-37814?

Linux \>= e46d91ca504d69ae3d09c120b162a238b8013890, \< 6f021bc0083b96125fdbed6a60d7b4396c4d6dac; \>= 2f83e38a095f8bf7c6029883d894668b03b9bd93, \< 9b50c9c97db953de756a39af83d4be4d7f618aa6; \>= 2f83e38a095f8bf7c6029883d894668b03b9bd93, \< ee6a44da3c87cf64d67dd02be8c0127a5bf56175; 2714ffdbb79b48dda03334a01af90fb024f39047; \>= 6.12.14, \< 6.12.26; \>= 6.13.3, \< 6.14; Linux 6.14.

### Is there a fix for CVE-2025-37814?

Yes. Fixed in Linux 6f021bc0083b96125fdbed6a60d7b4396c4d6dac, Linux 9b50c9c97db953de756a39af83d4be4d7f618aa6, Linux 6.12.26, Linux 6.14. Upgrade Linux to 6.14 or later.

### How do I check if I'm affected by CVE-2025-37814?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/6f021bc0083b96125fdbed6a60d7b4396c4d6dac>
- patch: <https://git.kernel.org/stable/c/9b50c9c97db953de756a39af83d4be4d7f618aa6>
- patch: <https://git.kernel.org/stable/c/ee6a44da3c87cf64d67dd02be8c0127a5bf56175>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-37814>

HTML: <https://flawdb.com/CVE-2025-37814> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-37814>
