Skip to content

fix: warn that copied ecash is spendable - #560

Open
FrankChinedu wants to merge 2 commits into
fedimint:masterfrom
FrankChinedu:fix/ecash-clipboard-warning
Open

fix: warn that copied ecash is spendable#560
FrankChinedu wants to merge 2 commits into
fedimint:masterfrom
FrankChinedu:fix/ecash-clipboard-warning

Conversation

@FrankChinedu

Copy link
Copy Markdown
Contributor

The copy button on the ecash send screen hands a bearer instrument to the clipboard, which other apps, input methods and clipboard-sync services can read. Nothing on screen said so (fixes #534, security audit L23).

Adds a persistent warning directly above the token and its copy button, so it is read before the tap rather than shown as a toast afterwards. A persistent note is used instead of a one-time dialog because the risk applies to every copy, and because it needs no persisted "already warned" state.

The screen is presented in a fixed-height bottom sheet and was a plain non-scrolling Column already holding a square QR, so the outer padding becomes a SingleChildScrollView to keep the added banner from overflowing on shorter screens.

The copy button on the ecash send screen hands a bearer instrument to
the clipboard, which other apps, input methods and clipboard-sync
services can read. Nothing on screen said so (fixes fedimint#534, security
audit L23).

Adds a persistent warning directly above the token and its copy
button, so it is read before the tap rather than shown as a toast
afterwards. A persistent note is used instead of a one-time dialog
because the risk applies to every copy, and because it needs no
persisted "already warned" state.

The screen is presented in a fixed-height bottom sheet and was a
plain non-scrolling Column already holding a square QR, so the outer
padding becomes a SingleChildScrollView to keep the added banner from
overflowing on shorter screens.
@m1sterc001guy

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-03T20:55:33.355545Z 3259bbf Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3259bbf1e6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/ecash_send.dart Outdated
Expanded(
child: Text(
context.l10n.ecashClipboardWarning,
style: const TextStyle(color: Colors.orange),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Increase the warning text contrast

The Colors.orange foreground is rendered on Colors.orange.shade100, producing a contrast ratio of only about 1.7:1—well below the 4.5:1 expected for normal-sized text. This makes the new security warning difficult to read, especially for users with low vision, undermining the purpose of warning users before they copy spendable ecash; use a substantially darker foreground color.

Useful? React with 👍 / 👎.

Colors.orange on an orange.shade100 background gives a contrast ratio
of roughly 1.7:1, well under the 4.5:1 WCAG AA asks for body text. A
security warning that is hard to read defeats its own purpose, so use
brown.shade900 for the text and icon instead, which keeps the warm
tone at about 10.9:1.

A darker orange is not sufficient: orange.shade900 only reaches 3.0:1
and deepOrange.shade900 4.4:1, both still short of AA.

Co-Authored-By: Claude Opus 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.

Ecash is copied to the clipboard with no warning that it is spendable

2 participants