You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CM-68330: fix hook payload handling on Cursor for Windows
Two payload bugs found in Windows/Cursor MDM testing:
- Cursor sends the hook payload with a UTF-8 BOM; json.loads rejects it and
safe_json_parse returned {}, silently allowing without scanning. Read stdin
bytes and decode utf-8-sig at both hook entry points - strips the BOM and
pins the payload to UTF-8 regardless of the Windows ANSI code page (non-ASCII
prompts were mojibake under cp1252). The text-mode fallback path lstrips
U+FEFF as defense-in-depth.
- Cursor sends workspace_roots=[] when no folder is open; the .get() default
only applies when the key is missing, so workspace_roots[0] raised
IndexError. Fall back to '.' via `or`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments