Skip to content

Harden wallet_connect.html with CSP, integrity checks, & network allowlist #141

Description

@ibrahimmosouf-png

Harden wallet_connect.html with CSP, integrity checks, & network allowlist

Labels: security, frontend, priority/high
Difficulty: Medium · Effort: M
Backlog slot: 54

Problem Statement

wallet_connect.html is a 110-line single-file demo with hard-coded styles, inline JS, and a permissive Freighter detection (typeof window.freighter !== 'undefined'). No Content Security Policy, no SRI.

Why it Matters

  • A UI shipped alongside a financial contract should at least have basic hardening.

Technical Context

  • Inline scripts (no CSP) → XSS-prone.
  • If a service worker / extension that polls window.freighter is compromised, user address can be exfiltrated.

Expected Outcome

  1. Move JS to external file w/ SHA-256 pin.
  2. Add <meta http-equiv="Content-Security-Policy">.
  3. Validate Stellar address with StrKey library before accepting.
  4. Disallow custom regex that doesn't check ED25519 checksum.

Acceptance Criteria

  • CSP-tested, SRI-tested.
  • Address-format validation covers prefixed (G,S) and ED25519 checksum.

Files Likely Affected

  • wallet_connect.html
  • New: wallet_connect.js

Dependencies

None.


Activity

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

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26frontendImported from .github/ISSUES_TO_CREATE.mdpriority/highImported from .github/ISSUES_TO_CREATE.mdsecurityImported from .github/ISSUES_TO_CREATE.md

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions