bug: CSP blocks API calls when accessing frontend from non-localhost #2
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic#2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Content-Security-Policy in index.html only allows http://localhost:* and http://127.0.0.1:*. When accessing the frontend from a remote IP (e.g. VPS), all contract queries are blocked.
connect-src needs to include the host IP or use a wildcard for development.
Quick fix: add http://:* to the connect-src directive in index.html.
mentioned in issue #1
For security reasons the quick fix isnt acceptable, instead we should investigate options for dev only environments to whitelist an ip address
mentioned in issue #18
mentioned in commit
42392b8bc7Fix pushed to main in
42392b8. ThecspDevHostsVite plugin now auto-detects the machine's network interface IPs and injects them into the CSPconnect-srcdirective duringvite dev. Production builds are unaffected.@Brouie — could you verify this resolves the issue on your VPS setup?
Verified fixed — CSP auto-detects VPS IP via cspDevHosts Vite plugin. Frontend works without manual CSP patch.
mentioned in commit
ecdb4fe1d3mentioned in issue #49
mentioned in issue #50
mentioned in issue #445
mentioned in merge request !1046
PlasticDigits referenced this issue2026-09-04 03:50:07 +00:00