Skip to content

fix: guard demo local faucet fetch behind non-PROD build - #884

Open
AntonioVentilii wants to merge 1 commit into
mainfrom
av/localhost-fetch-security-a86570
Open

fix: guard demo local faucet fetch behind non-PROD build#884
AntonioVentilii wants to merge 1 commit into
mainfrom
av/localhost-fetch-security-a86570

Conversation

@AntonioVentilii

Copy link
Copy Markdown
Collaborator

Context

A code-review pass flagged the browser fetch() to http://localhost:5999/ledger/transfer/ in the demo's Get ICP button as a web-to-localhost trust-boundary concern.

Investigation showed it is not a real vulnerability: localhost:5999 is a local-only Juno satellite Docker container (see demo/docker-compose.yml) that acts as a test-ICP faucet for local development and E2E. It only exists on a developer's own machine, deals in fake ICP on a local replica, and simply fails to resolve in production.

Change

Still worth tidying: the call was issued unconditionally. This guards it behind the existing PROD flag so the loopback request can never fire from a production build. Two-line, behavior-preserving for local dev/E2E.

Test plan

  • Local dev / E2E: faucet still called, balance reload unchanged.
  • Production build: fetch is skipped; emit still fires.

@AntonioVentilii
AntonioVentilii requested a review from a team as a code owner July 16, 2026 08:17
@zeropath-ai

zeropath-ai Bot commented Jul 16, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 756949c.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► demo/src/wallet_frontend/src/lib/GetICP.svelte
    Implement PROD guard around local faucet call

@AntonioVentilii
AntonioVentilii force-pushed the av/localhost-fetch-security-a86570 branch from 238d0dd to a2ffec7 Compare July 16, 2026 10:17
@AntonioVentilii AntonioVentilii changed the title fix(demo): guard local faucet fetch behind non-PROD build fix: guard demo local faucet fetch behind non-PROD build Jul 16, 2026
The 'Get ICP' button issued a browser fetch() to the local-only Juno
satellite faucet (localhost:5999) unconditionally. Guard it behind !PROD
so the loopback request can never fire from a production build.
@AntonioVentilii
AntonioVentilii force-pushed the av/localhost-fetch-security-a86570 branch from a2ffec7 to 756949c Compare July 16, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant