Cursor leaks Secure Event Input — breaks all system-wide input taps until quit or screen lock

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cursor calls EnableSecureEventInput and never balances it with
DisableSecureEventInput. Secure Event Input is a system-wide singleton on
macOS, so while it is held, every CGEventTap on the machine is disabled —
not just inside Cursor.
The result is that any third-party tool relying on input taps silently
stops working for as long as the Cursor process lives. In my case
Logitech Options+ mouse gestures die; by the same mechanism this will
affect Raycast hotkeys, text expanders and dictation tools.
I hit this roughly 7 times per working day. The only reliable recovery is
locking and unlocking the screen, which resets the session’s secure-input
state.

Steps to Reproduce

  1. Launch Cursor and work normally for a few minutes.
  2. Check who holds secure input:
    ioreg -l -d 1 -w 0 | grep -o ‘kCGSSessionSecureInputPID"=[0-9]*’
  3. Resolve the PID:
    ps -p -o comm=
    Actual result
    kCGSSessionSecureInputPID"=29082
    /Applications/Cursor.app/Contents/MacOS/Cursor
    Held continuously for 14+ minutes with no password field focused anywhere
    in the UI. It does not clear on window blur, on app deactivation, or when
    another app is brought to the front. It clears only on Cursor quit or on
    screen lock/unlock.

Expected Behavior

Secure Event Input is released as soon as the secret input field loses
focus, and is guaranteed released on window blur / app deactivation so a
leaked enable cannot outlive the field that requested it.

Operating System

MacOS

Version Information

3.14.27

Additional Information

this is almost certainly not Cursor-specific code but inherited Electron/Chromium password-field behaviour, so the fix likely belongs in how Cursor handles focus teardown around masked input fields.

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Pulling the holder PID from ioreg and pinning it on Cursor is exactly right and saved us the guesswork.

This isn’t intended behavior and it’s not anything in your setup. To clear it whenever it sticks: fully quit and relaunch Cursor (Cmd+Q, then reopen) - the process exiting always releases the hold.

To pin the trigger, two quick things:

  1. What did you type into a masked field right before it stuck (Git/proxy credential, SSH passphrase, API key, or agent secret)?
  2. Does it still happen on the current version (Help → About; latest is 3.15.x)?

If handy, this catches the exact moment it sticks - whatever you did in the seconds before Cursor shows as holder is the culprit:

while true; do p="$(ioreg -l -d 1 -w 0 | grep -o '"kCGSSessionSecureInputPID"=[0-9]*' | grep -o '[0-9]*')"; printf '%s holder=%s %s\n' "$(date +%H:%M:%S)" "${p:-none}" "$(ps -o comm= -p "$p" 2>/dev/null)"; sleep 1; done

Thanks, that confirms it’s not something on my end.

Still on the current version?

I’m on 3.14.27 (haven’t taken 3.15.x yet — happy to update and re-test if
that’s more useful, just say). It is still reproducing on 3.14.27.

I can give you exact frequency rather than a guess. Since lock/unlock is my
recovery, every occurrence leaves an instant lock→unlock pair (1–3s) in the
screen-lock log, which is trivially distinguishable from a real break:

Aug 4 — 6 occurrences
Aug 5 — 7
Aug 6 — 3
Aug 7 — 4   (10:22, 10:36, 13:50, 14:01)

So roughly 4–7 times per working day.

What was typed into a masked field beforehand?

<< FILL IN: Git/proxy credential, SSH passphrase, API key, agent secret,
sudo in the integrated terminal, or “nothing I can recall” >>

One data point that may argue against the masked-field theory: on the
instance I captured, the holding process had only been alive for about
9 minutes and had already been holding the lock for 14+ minutes
continuously. Its log showed nothing but normal startup keychain init
(SecKeychainAddCallback / “Enabling System Keychain Always due to
platform”) at launch. No password field was open in the UI at capture
time, and it did not release on window blur or app deactivation.

That makes me suspect either something during startup, or an extension /
MCP auth path, rather than an interactive credential prompt.

Monitoring

I’ve got your watcher running (modified to log only ownership transitions
plus the frontmost app at that moment, so the trigger context is captured).
I’ll post the transition log the next time it sticks.

Minor note on the check: when nobody holds it, the
kCGSSessionSecureInputPID key is absent from IOConsoleUsers entirely
rather than set to 0 — so an empty result means “clean”, not “command
failed”.

One to save you a dead end: those startup keychain lines (SecKeychainAddCallback etc.) are a different macOS subsystem, so they aren’t the trigger. And “no visible field” doesn’t rule out a masked one - a field in a background or popup window (an auth/login prompt, MCP authorization, or an agent secret) that’s torn down while focused would leave nothing visible, which fits what you’re seeing.

Your transition watcher is exactly what we need. When ownership flips to Cursor, the key thing to capture is what happened in the couple of seconds before - a login/auth popup, an MCP server connecting or authorizing, a Git/SCM sign-in, or an agent run touching a secret - plus the frontmost window. That should pin it, send it over next time it sticks.

On the version: I wouldn’t count on the update alone to fix it, but 3.15.x is fine to move to if it’s easy. The transition log is the key piece.

Update after 2.5 weeks, and I think the trigger is not what we assumed.

Version

Still reproducing on 3.17.8 (installed Aug 20) — so it survived well past
the 3.15.x you suggested.

The frequency tracks Cursor’s process uptime, not credential entry

This is the part that changed my mind. Using the same lock/unlock counting
method as before:

Aug 22 — 0 occurrences
Aug 23 — 0          (machine rebooted 21:25)
Aug 24 — 1          <- current Cursor instance started 09:33
Aug 25 — 6 by 13:41  (same instance, now 28h old)

One long-lived Cursor process (the only top-level instance on the machine),
and the rate climbs the longer it lives. I did not enter any credential,
SSH passphrase or API key today.

Lock/unlock is losing effectiveness, which fits a refcount

This morning I had to cycle three times in 49 seconds — 08:51:37, 08:52:06,
08:52:26 — where previously one cycle bought me an hour or more. Lock/unlock
resets the session’s secure-input state, but the hold is re-acquired almost
immediately.

That pattern points at an accumulating refcount rather than one unbalanced
enable from a single prompt.

Prior art that matches your popup/teardown theory exactly

Mozilla hit and fixed the identical bug: 2050794 - macOS Secure Event Input can be left enabled, locking out other apps (Logitech Options, TextExpander, 1Password)
“macOS Secure Event Input can be left enabled, locking out other apps
(Logitech Options, TextExpander, 1Password)”.

Their root cause was a process-global refcount (sSecureEventInputCount)
left non-zero via two paths:

  1. A focused widget/window destroyed without a preceding resign-key or
    blur — e.g. a popup/window closed while a password field is focused
    and the app stays active. Their Destroy / widgetDestroyed /
    OnDestroyWidget paths never drained it.
  2. A resign-key handler that returned early when its child object was
    already null, skipping the drain.

That is the scenario you described in your last reply, and it’s the same
macOS API. Might be the fastest path to a fix here.

They also instrumented it usefully: logging the running refcount on every
Enable/DisableSecureEventInput call. If Cursor had an equivalent debug
flag, I’d happily run it and send you the trace — that would settle this
in one session rather than us guessing at triggers.

One caveat worth ruling out

Per OpenRadar 48953777, kCGSSessionSecureInputPID reports the PID of the
app that was frontmost when EnableSecureEventInput was called, not
necessarily the caller — a background app calling it gets attributed to
whatever was in front. Cursor has been frontmost in all my captures, so
I can’t yet exclude misattribution from the ioreg key alone.

I’ll settle this with a quit test (quit Cursor, then check the key from
Terminal) and report back — if the hold survives Cursor exiting, I’ve been
blaming the wrong app and I’d rather find that out than waste your time.

Transition log

The watcher is running again (it died in my Aug 23 reboot, now living
outside /tmp). It logs ownership transitions plus the frontmost app. It
started while the hold was already active, so I don’t have a clean flip
captured yet — I’ll post it as soon as I catch one.

Ran the quit test plus several lock/unlock cycles. Transition log excerpts
below, from a watcher running as a LaunchAgent so it survives Cursor exiting.
Two findings: the hold outlives the process, and Cursor reclaims it within
seconds of any release.

1. Quitting Cursor does not release the hold

13:42:28  holder=46980  Cursor    alive  frontmost=Cursor       cursor_running=46980
13:56:55  holder=46980  Cursor    alive  frontmost=Slack        cursor_running=46980
13:57:47  holder=46980  Cursor    alive  frontmost=Slack        cursor_running=46980
13:59:47  holder=46980  DEAD-PID  DEAD   frontmost=WinBox       cursor_running=NO
14:14:26  holder=none   none      n/a    frontmost=loginwindow  cursor_running=13456

At 13:59:47 I quit Cursor (Cmd+Q) and upgraded to 3.17.19. PID 46980 was
confirmed gone via ps. The hold persisted anyway for 14.7 minutes, naming a
dead PID the entire time, and it did not transfer to the newly launched
instance (13456).

This was not merely a stale ioreg key — input taps stayed genuinely blocked
throughout, verified independently by my Logitech gestures remaining dead
with a freshly launched Cursor.

It cleared only at 14:14:26, on screen lock/unlock. So quit-and-relaunch is
not a usable workaround; lock/unlock remains my only recovery.

2. Cursor reclaims the hold within 3 seconds of being released

14:25:46  holder=none   none         n/a    frontmost=loginwindow      cursor_running=13456
14:26:34  holder=13456  Cursor       alive  frontmost=Cursor           cursor_running=13456
...
15:42:26  holder=none   none         n/a    frontmost=Cursor           cursor_running=13456
15:42:29  holder=13456  Cursor       alive  frontmost=Notion Calendar  cursor_running=13456
15:42:35  holder=621    loginwindow  alive  frontmost=loginwindow      cursor_running=13456
15:42:45  holder=none   none         n/a    frontmost=loginwindow      cursor_running=13456
15:42:48  holder=13456  Cursor       alive  frontmost=Cursor           cursor_running=13456

Freed at 14:25:46, retaken 48 seconds later. Then freed at 15:42:26 and
retaken after 3 seconds, and again at 15:42:45 → 15:42:48, another 3 seconds.

In practice Cursor holds secure event input continuously while I work, and
lock/unlock buys me only seconds before it is reclaimed.

For completeness on attribution: at 15:42:29 Cursor acquired the hold while a
different application was frontmost. Per OpenRadar 48953777, a background
caller of EnableSecureEventInput can be misattributed to whatever is frontmost
— that is not what is happening here. The key names Cursor specifically, even
when Cursor is not the front application.

3. There is no credential involved anywhere — this is the answer to your
earlier question

To answer the masked-field question directly, which I left open last time:
there is no masked field. I am not entering credentials of any kind.

In Cursor specifically: no Git or SCM sign-in, no proxy credential, no SSH
passphrase, no API key entry, no MCP authorization prompt, no sudo in the
integrated terminal, no agent secret. My entire interaction with Cursor is
typing into the agent prompt input field — an ordinary text box — and that is
enough to reproduce this.

Nor am I entering credentials in any other application during these sessions.
There is no password manager unlock, no login prompt, nothing masked anywhere
on the machine.

Combined with the 3-second reclaim above, I think the credential-prompt theory
can be closed out. Nobody types a password every three seconds, and I am not
typing one at all. Whatever calls EnableSecureEventInput here is doing so
during ordinary editing, not in response to a secret being entered.

4. Environment

Cursor 3.17.19 (upgraded mid-session today), macOS 26.5.2 (25F84),
Mac Studio M3 Ultra. Reproduced on 3.14.27, 3.17.8 and 3.17.19.

What would settle this fastest

Mozilla fixed the identical defect — bug 2050794, “macOS Secure Event Input
can be left enabled, locking out other apps (Logitech Options, TextExpander,
1Password)”. Their root cause was a process-global refcount left non-zero when
a focused widget or window is torn down without a preceding resign-key/blur,
via paths that never drained it. They instrumented it by logging the running
refcount on every Enable/DisableSecureEventInput call.

If Cursor can ship or point me at an equivalent debug flag, I will run it and
send you the trace. Given that the hold now demonstrably outlives the process,
is reclaimed within 3 seconds of release, and occurs with no masked field
anywhere in the session, I would expect the leak to sit in window/widget
teardown rather than in password-field focus handling.