IPFS Subdomain = Security Risk
Published at Apr 6 2025

Never Host IPFS on the Same Domain as Your App

If your main app runs on example.com, never host your IPFS gateway on ipfs.example.com. It's a security time bomb.

Why? Because if someone uploads a malicious XSS payload—say, an HTML image or script file—and it lands at something like ipfs.example.com/ipfs/xss-image, your browser sees that as the same origin. Which means:

Boom—your app is compromised. Game over.

Best practices

Security starts at the domain level. Don't let decentralized storage punch a hole in your centralized app. We follow the same on Hey.