Skip to content

Keep one-time codes and password-manager copies out of the clipboard widget - #55

Merged
fdussert merged 2 commits into
mainfrom
hotfix/clipboard-short-secrets
Oct 20, 2026
Merged

fdussert merged 2 commits into
mainfrom
hotfix/clipboard-short-secrets

Conversation

@fdussert

Copy link
Copy Markdown
Owner

Summary

Found while reviewing #49: the clipboard provider recorded a six-digit one-time code unmasked. Every rule in isSecret started at eight characters, so the code showed on the Edge, stayed in the 20-entry history and reached a paired iPad whose screen holds the clipboard widget.

  • Mask one-time codes. A text that is only 4–8 digits, or two groups of 3–4 digits split by one space or dash (482913, 482 913, 4829-1375), is now masked. The rule matches the whole text: digits inside prose (Meeting at 2026), phone numbers and lopsided splits are left alone. The trade-off, explained in a comment: a bare year or postcode copied on its own is masked too, which costs a preview and nothing else. It still copies back with a tap.
  • Honour more private pasteboard markers. The provider already skipped a pasteboard marked org.nspasteboard.ConcealedType, TransientType or AutoGeneratedType. It now also skips the markers that 1Password, KeeWeb, Butler, Typeit4me and Keyboard Maestro's generator set, which other clipboard managers honour too. These entries are never recorded at all, not just masked.

No UI change: the widget already shows ••• secret for any masked entry.

Tests

  • server/test/clipboard.test.ts: 482913 and its variants are masked, and the snapshot never contains the digits. Meeting at 2026, phone numbers and odd splits are not masked. Each new private type records nothing.
  • pnpm typecheck and pnpm test pass.

🤖 Generated with Claude Code

fdussert and others added 2 commits October 19, 2026 18:39
The clipboard provider already skipped a pasteboard carrying the
nspasteboard.org Concealed, Transient or AutoGenerated types. Some
applications mark what they copy with their own type instead of, or as
well as, those: 1Password, KeeWeb, Butler, Typeit4me and Keyboard
Maestro's generator. Other clipboard managers honour these markers too,
so a copy carrying one is now never recorded either.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every rule in isSecret started at eight characters, so a six-digit OTP
copied from an SMS or an authenticator was recorded unmasked: shown on
the Edge, kept in the 20-entry history, and sent to a paired iPad whose
screen holds the clipboard widget.

A text that is only four to eight digits, or two groups of three or four
split by one space or dash, is now masked. It is tested before the
whitespace rule so "482 913" counts. The rule is anchored on the whole
text: digits inside prose, phone numbers (more digits, more groups) and
lopsided splits are left alone. A bare year or postcode copied on its
own is masked too, which costs a preview and nothing else.

Found while reviewing PR #49.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying fremkit with  Cloudflare Pages  Cloudflare Pages

Latest commit: 544344c
Status: ✅  Deploy successful!
Preview URL: https://ea1ac634.fremkit.pages.dev
Branch Preview URL: https://hotfix-clipboard-short-secre.fremkit.pages.dev

View logs

@fdussert
fdussert merged commit 19ed0ba into main Oct 20, 2026
3 checks passed
@fdussert
fdussert deleted the hotfix/clipboard-short-secrets branch October 20, 2026 08:29
fdussert added a commit that referenced this pull request Nov 18, 2026
The kiosk window becomes a non-activating panel that never turns key, so a
tap on the Edge no longer takes the keyboard (or the ⌘Tab switcher) away from
the app on the primary display. Tested on a real Edge with real touches.

The merge also brings origin/main's #55 (clipboard one-time codes, private
pasteboard markers) and #56 (UI tests off the real WebSocket), which local
main did not have yet; CHANGELOG entries from both sides are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant