Star Tower Chain
Official Website
  • 🗼StarTower
  • Get Started
    • Developing for Star Tower Wallet platform
      • Mobile (WalletConnect)
        • Android
          • Usage
          • One-click Auth
          • Verify API
          • Wallet Call API
        • iOS
          • Usage
          • One-click Auth
          • Link Mode
          • Verify API
          • Wallet Call API
      • Integration Guide
        • Usage Guide
        • Android Integration Guide
      • Developing the Library
        • Contributing
    • Content Security Policy (CSP)
  • StarTower
    • our construction
  • Resource Interaction Proof(RIP)
    • Pull Request Resources
  • study
  • Developer Support
Powered by GitBook
On this page
  • Overview​
  • CSP Guidance​
  • Testing and Deploying Your CSP​
  1. Get Started

Content Security Policy (CSP)

PreviousContributingNextour construction

Last updated 7 months ago

Overview

A Content Security Policy (CSP) is a security feature that helps protect web applications from various attacks like Cross-Site Scripting (XSS), clickjacking, and data injection. By specifying allowed content sources, CSPs minimize the risk of executing malicious content on your site.

CSP Guidance

AppKit

The following is a partial CSP that covers WalletConnect's libraries and services for . Note that you may need to define additional sources based on your application's requirements.

default-src 'self';
script-src 'self';
style-src https://fonts.googleapis.com;
img-src 'self' data: blob: https://walletconnect.org https://walletconnect.com https://secure.walletconnect.com https://secure.walletconnect.org https://tokens-data.1inch.io https://tokens.1inch.io https://ipfs.io;
font-src 'self' https://fonts.gstatic.com;
connect-src 'self' https://rpc.walletconnect.com https://rpc.walletconnect.org https://explorer-api.walletconnect.com https://explorer-api.walletconnect.org https://relay.walletconnect.com https://relay.walletconnect.org wss://relay.walletconnect.com wss://relay.walletconnect.org https://pulse.walletconnect.com https://pulse.walletconnect.org https://api.web3modal.com https://api.web3modal.org https://keys.walletconnect.com https://keys.walletconnect.org https://notify.walletconnect.com https://notify.walletconnect.org https://echo.walletconnect.com https://echo.walletconnect.org https://push.walletconnect.com https://push.walletconnect.org wss://www.walletlink.org;
frame-src 'self' https://verify.walletconnect.com https://verify.walletconnect.org https://secure.walletconnect.com https://secure.walletconnect.org;

info

You may need to list the RPC endpoints used by blockchain networks you have enabled (e.g. via the ) as part of your connect-src definition.

For a full of list of RPC sources used by wagmi/viem, please refer to .

Testing and Deploying Your CSP

Run through your standard user flows in a staging environment with CSP enforcement. This may include connecting to browser extension wallets, transacting, logging out, etc. Directives may need updates after SDK upgrades. Always test your CSP again before deploying updates to production.

Use the Content-Security-Policy-Report-Only header, which sends violation reports without enforcing policies. This helps assess the impact of CSP changes without affecting functionality.

First deploy your CSP in report-only mode. After validation, migrate to Content-Security-Policy for enforcement.

Configure report-uri or report-to to receive violation reports and set up a monitoring dashboard for review.

Test Your CSP in a Staging Environment

Using Report-Only Mode

Deployment

Monitoring

​
​
​
AppKit
@wagmi/chains package
Viem's chain definitions
​
​
​
​
​