paritytech / paritytech/host-rust-core

iOS TrUAPI container blocks every cross-origin fetch, even after a Remote domain grant

Open
#782 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
10
Forks
3
Avg merge
1d 10h
Merged PRs (30d)
148

Description

TLDR

A product requests Remote permission for a domain. The host prompts, the user allows, and requestRemotePermission returns granted. The host settings screen shows the domain as allowed. The next fetch to that domain still fails with TypeError: Network access is not allowed.

Cause

The TrUAPI lockdown script js/container/src/index.ts (built into ios/truapi-host as truapi-container.js) allows same-origin fetch only (lines 56-67) and deletes XMLHttpRequest. It never reads the stored Remote grants.

Reproduction

Use 3rd-party-fetch.paseo. It queries a public API endpoint before and after a Remote grant and prints every result.

  1. Open 3rd-party-fetch.paseo in a testnet iOS build with "TrUAPI Runtime" ON.
  2. Tap "Request permission" and allow the prompt. The log shows Remote granted.
  3. Tap "Fetch". The log shows FAILED: TypeError: Network access is not allowed.
  4. Set "TrUAPI Runtime" OFF, restart, repeat. The fetch returns 200 OK.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in js/container/src/index.ts, especially the lockdown logic around lines 56-67, and compare it with the built truapi-container.js in ios/truapi-host. Use 3rd-party-fetch.paseo in a testnet iOS build to reproduce the failure before and after a Remote grant. Done means an allowed domain fetch succeeds while the TrUAPI Runtime remains enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, typescript
Domain
api, mobile, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.