Conversation
Co-authored-by: numbers-official <181934381+numbers-official@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [Security] Add Content Security Policy and improve error handling
Add Content Security Policy and fix silent error swallowing in subscribe calls
Mar 18, 2026
The Content-Security-Policy was too restrictive for a Capacitor mobile app. connect-src only allowed *.numbersprotocol.io, which would silently block requests to bubble.io APIs (actions, orders, NUM price), GoPro local server (10.5.5.9), and AppsFlyer analytics at runtime. CSP for Capacitor apps requires a dedicated effort with comprehensive domain inventory and full QA coverage across all features.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The app had no CSP restricting WebView content sources, and 14+
.subscribe()calls had no error handler, silently discarding failures in security-sensitive operations (wallet transfers, auth, signup).Changes
src/index.html— Add Content Security PolicyAdds a CSP meta tag with explicit allowlists:
frame-srccovers the Bubble.io iframes used throughout the appimg-src/media-srcincludeblob:for camera capture outputobject-src 'none'blocks all plugin-based contentSubscribe error handlers — 5 files, 14 locations
Adds
errorcallbacks to all empty.subscribe()calls in:wallets/transfer/transfer.page.ts— transfer operations + route paramMapwallets/wallets.page.ts— iframe events, reload, clipboardsignup/signup.page.ts— translation init, form submitcontacts/contacts.page.ts— delete actiondata-policy/data-policy.page.ts— iframe eventsOriginal prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.