Skip to content

Blossom security analysis fixes - #2674

Open
KoalaSat wants to merge 2 commits into
mainfrom
blossom-security-analysis-fixes
Open

Blossom security analysis fixes#2674
KoalaSat wants to merge 2 commits into
mainfrom
blossom-security-analysis-fixes

Conversation

@KoalaSat

@KoalaSat KoalaSat commented Aug 21, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Fixes #2536

coordinator opt-in for Blossom image uploads in chat

Coordinators can now choose whether to offer encrypted image uploads (Blossom) in the trade chat by setting an environment variable. If a coordinator does not offer it, the upload button is greyed out with a tooltip explaining why.

Android stack overflow

Replaced String.fromCharCode.apply(null, Array.from(data)) with a chunked loop (8192-byte chunks), matching the already-safe getBinary pattern

EXIF metadata leak

Added stripImageMetadata() — canvas re-encode before encryption strips all EXIF/GPS/camera data. WebP/GIF animations are flattened to a single frame. Falls back to original file if canvas is unavailable

SVG tracking risk nip17File.ts

Changed isImageMimeType from startsWith('image/') to an explicit allowlist ['image/jpeg', 'image/png', 'image/webp', 'image/gif'] — SVG excluded originalSha256 unverified MessageCard/index.tsx Added verifyBlobHash(plaintext, fileData.originalSha256) after decryption as defence-in-depth

nodeapp missing /blossom/ route

nodeapp/coordinators/{temple,lake,bazaar,freedomsats,alice}/locations.conf Added location /mainnet|testnet/{alias}/blossom/ with proxy_pass, proxy_http_version 1.1, Host $host, and client_max_body_size 12m to all 5 coordinators (10 location blocks total)

Checklist before merging

  • Install pre-commit and initialize it: pip install pre-commit, then pre-commit install. Pre-commit installs git hooks that automatically check the codebase. If pre-commit fails when you commit your changes, please fix the problems it points out.

@KoalaSat
KoalaSat requested a review from a team as a code owner August 21, 2026 13:14
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.

Security Analysis — Blossom Integration in RoboSats

1 participant