Skip to content

fix(cursor): unwrap Cursor 3.27 safe-storage sessions - #1802

Merged
iamtoruk merged 6 commits into
getagentseal:mainfrom
avs-io:fix/cursor-safe-storage
Oct 30, 2026
Merged

iamtoruk merged 6 commits into
getagentseal:mainfrom
avs-io:fix/cursor-safe-storage

Conversation

@avs-io

@avs-io avs-io commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Cursor 3.27 stores the app session as cursor-safe-storage:v1: ciphertext. CodeBurn treated that as an expired JWT.
  • Unlock it with the Cursor Safe Storage keychain item, then run the existing expiry check.
  • security -w appends a newline. Trim it before the KDF, or the decrypt fails and sync still looks locked.
  • If the keychain item cannot be read, say so. Do not tell the user to sign in again.

Closes #1801

Testing / Verification

  • I have tested this locally against real data (not just unit tests)
  • npm test passes
  • npm run build succeeds
  • Not a UI change
  • UI change: before and after screenshots attached below

Local menubar build, same machine, Cursor 3.27.22. npm test: 5244 passed. codeburn import cursor --sync imported the usage export after the newline trim.

Before:

Cursor settings before, session reported expired

After:

Cursor settings after, connected from the app session

Cursor 3.27 stores the app session as cursor-safe-storage:v1 ciphertext.
Read it with the Safe Storage keychain item instead of treating it as an
expired JWT. Trim the newline security -w appends before the KDF.
@avs-io
avs-io requested a review from iamtoruk as a code owner October 29, 2026 14:52
Status never reads it. A forced sync may ask, and the background sync
reads only after one succeeded and none was refused since, reusing the
token per stored blob. codeburn quota asks as it does for Claude. Drop
the service-only lookup that asked again after a Deny.
A dock refresh reads it only after a user-initiated read succeeded, and
its first locked read turns that off again. The opened token is kept per
stored blob; an explicit disconnect forgets both. The popover names the
sync command, and the service-only lookup is gone.
Windows and Linux have no login keychain, so the locked message there
says CodeBurn cannot open the encrypted session yet.
Both fell back to the export error for the new locked code. On macOS the
desktop names the sync command; elsewhere it says the session cannot be
opened yet.
@iamtoruk
iamtoruk merged commit 9a624cc into getagentseal:main Oct 30, 2026
26 checks passed
@iamtoruk

Copy link
Copy Markdown
Member

Thanks, the unlock is right. I added five commits on your branch: keychain reads only after a user action (same rule as Claude), status never reads the keychain, honest text on Windows and Linux, the locked line in the apps, and docs. Merged as 9a624cc, ships with the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cursor 3.27 app session is treated as expired

2 participants