Skip to content

feat: dApp Store readiness, security-audit fixes and dependency updates - #13

Merged
operatoruplift merged 22 commits into
mainfrom
feat/store-readiness
Oct 25, 2026
Merged

operatoruplift merged 22 commits into
mainfrom
feat/store-readiness

Conversation

@operatoruplift

@operatoruplift operatoruplift commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

What this PR ships

Everything Allowance needs for its Solana dApp Store listing, plus the fixes from the 16 October 2026 security audit, in one branch. The kit's own decision (docs/dapp-store/listing.md) is to hold the listing until a live operator server and a reviewer login exist.

Store readiness (the original scope): privacy and terms pages that meet Developer Agreement §10.6, an English-only Android shell, and the listing kit under docs/dapp-store/.

Android shell hardening (android/): every external launch is guarded, so a phone without a wallet or mail app shows a short message instead of closing the app; intent: URLs lose component, selector, extras and URI grants and must be BROWSABLE; downloads work (DownloadManager for https, a two-method page bridge for blob: and data:); mixed content is never allowed, third-party cookies and file access are off, popups need a user gesture, and the backup rules exclude everything.

Security audit fixes

  • A-1 The direct rail reads the recipient account and refuses token accounts, mints and programs; a program-owned account needs an admin approval signed with allowProgramOwnedRecipient.
  • A-2 The MCP bridge holds no payer key: paid tools are forwarded to the backend over loopback with MCP_BACKEND_TOKEN; ALLOWANCE_MCP_LOCAL_SIGNER=1 restores the old behaviour deliberately.
  • A-4 Sessions persist only at sign-in (anonymous CSRF is a signed double-submit cookie), expired rows are pruned every 15 minutes, /api and /api/login are rate-limited, and lockout is per address.
  • A-5 The merchant's daily quota counts only facilitator-verified payments.
  • A-6 .gitignore covers key-shaped files; a SHA-pinned gitleaks job runs in CI; absolute local paths are scrubbed from the docs.
  • A-7 PAYMENT_NETWORK is exactly devnet or mainnet-beta; .env.example defaults to devnet.
  • public/sitemap.xml and a robots.txt that references it; /privacy and /terms are rewritten with status 200.

Dependencies: @modelcontextprotocol/client 2.3.1, @modelcontextprotocol/server 2.4.0, vite 8.3.5, and body-parser, fast-uri, ip-address and proxy-addr through npm audit fix. The remaining advisories are on the @x402/* packages, which have no patched release.

Environment and operator steps

MCP_BACKEND_TOKEN (openssl rand -hex 32) in the private .env read by both the backend and the bridge; optional MCP_BACKEND_URL. Change any live PAYMENT_NETWORK=mainnet to mainnet-beta. Re-approve a vault PDA with --allow-program-owned if one is paid.

Verification

npm run typecheck, npm run lint and npm test (376 tests) pass; npm run build passes; the Android shell compiles as an unsigned release build; CI runs the production-image job and the new gitleaks job.

Addendum, 25 October 2026

  • vitest 5.0.5 (the @vitest/mocker advisory), which retires Dependabot's grouped PR.
  • The container verifier now expects the anonymous CSRF cookie that a signed-out visitor receives since A-4.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw

operatoruplift and others added 6 commits October 8, 2026 01:25
Both deploy targets serve the client with script-src 'self'. Zod 4
probes for eval with a caught `new Function` when it first builds an
object schema, and Chrome reports that probe as a CSP violation and a
console error on every page, the live rehearsal included. Configure Zod
as jitless before any schema module loads; parsing behaves the same and
the probe never runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
Add /privacy and /terms as real client routes. Both deploy targets read
the one route list, so the static rehearsal's Vercel rewrite and the
Express server serve them as pages, and the documents keep the
rehearsal's connect-src 'none' policy: they render from static text and
need no network.

The privacy policy describes what the code does today: the public site's
single localStorage key and service-worker cache, the Android shell, and
what a live operator deployment stores (Argon2id-checked sessions in
express-session, per-IP sign-in counts, the SQLite journal of policies,
receipts and mandates, payment records with wallet addresses and
signatures) and which services receive data (RPC provider, x402
facilitator, OpenAI when configured). It covers retention, the backup
and restore runbook, security, 18+, changes and contact.

The terms describe a developer tool for an operator's own dedicated
payer, quote the threat model on application-enforced limits, and carry
the Solana dApp Store Developer Agreement section 10.6 clause.

The site footer now renders once for every page, the walkthrough,
policy lab and console included, with a legal row linking both pages.
The contact is VITE_SUPPORT_EMAIL when set at build time, otherwise the
GitHub issue tracker.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
… guide

The APK declared 86 locales, all from AndroidX libraries the app never
translates. Add the AGP 9 locale filter and an explicit values-en
resource, so aapt2 now reports only `'--_--' 'en'`: the default
configuration and English. The resource table shrinks from 483 KB to
34 KB.

docs/seeker-and-pwa.md named WEB_SHELL_KEYSTORE_PASSWORD and
WEB_SHELL_KEY_PASSWORD, which Gradle never reads. Replace them with the
route the build script accepts, verified with a throwaway key: passwords
in the environment, the keystore path and alias as Gradle properties.
Warn that a missing property still builds, but writes an unsigned APK.
Replace the /rwa deep-link example with Allowance routes, update the
dApp Store facts (Portal, KYC/KYB, extension wallet, fees, signed APK,
text and graphic limits, review time), record the download gap, and add
the store listing decision.

The privacy policy now states the shell's permissions as aapt2 reports
them. A test keeps the filter and the documented property names in step
with the build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
docs/dapp-store/listing.md holds paste-ready listing text within the
Portal limits (name 9 of 25 characters, subtitle 24 of 30, a
description that presents the app as a no-spend rehearsal plus a
self-hosted operator console), the links, contact, language, token,
copyright and country answers, reviewer notes, and the recommendation to
hold the listing until a live server exists.

The 1200 x 600 banner is composed in banner.html from the brand fonts,
the A mark and the sky art plate, and repeats the landing page's own
policy plan. The six 1080 x 1920 screenshots come from the live site at
a 360 x 640 viewport, scale 3, with phone emulation and the service
worker blocked: the landing page, the policy lab after an edit, the
walkthrough paused mid-run, its completed receipt, the developer guide
and the console workspace.

`npm run store:kit` regenerates both and fails if a file is the wrong
size, a screenshot reaches 3 MB or the brand fonts did not load. A test
checks the committed sizes, the listing limits and that every public-site
link in the kit and the Seeker guide is a page the site serves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
Allowance is not entered in CLOCK IN, so the listing decision no longer
cites its prize rule as a reason to list before a live server exists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
The footer check loaded eleven pages inside one test, so on a slow
runner the shared 60-second budget ran out before the last pages loaded.
One test per page gives each load its own budget and names the page
that lost its links.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
@vercel

vercel Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
allowanceonsolana Ready Ready Preview Oct 25, 2026 1:35pm UTC

Request Review

These projects are not entered in Solana Mobile × RadiantsDAO CLOCK IN, so the
store guide no longer frames the listing as a prize requirement or keeps the
hackathon checklist.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
The Android shell no longer allows backup, so the WebView's session and local
storage are not copied to Google or to a new phone; the privacy page's
"What stays on your device" section is now true in the app as well.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
operatoruplift and others added 12 commits October 17, 2026 10:17
…loads, stop mixed content

The Web Shell template handed every link to startActivity without a catch, so a phone with no
wallet or mail app closed the app the moment Use my wallet or a support link was tapped, and
intent: URLs were started with their component intact. Downloads were dropped entirely, so the
JSON and CSV exports did nothing on a Seeker.

- LinkOpener catches every launch and shows a short message instead of crashing. intent: URLs
  lose component, selector, extras and URI grants and must be BROWSABLE. Only https, mailto,
  solana-wallet and intent leave the shell; everything else is blocked.
- WebShellDownloads saves https downloads through DownloadManager and blob: and data: downloads
  through a two-method page bridge that only creates new files under Downloads.
- Mixed content is never allowed (localhost stays a secure context for Mobile Wallet Adapter),
  third-party cookies and file or content access are off, and popups need a user gesture.
- Backup and data-extraction rules exclude everything explicitly instead of the template stubs.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
The direct rail accepted any 32-byte base58 string as a recipient and
created an associated token account for it, so a token-account address or
the USDC mint pasted as a recipient would send funds to an account nobody
can sign for. readTransferPreconditions now reads the recipient account
itself and refuses token accounts (Token and Token-2022), mints and
executable programs; any other program-owned account is refused unless an
administrator approval carried the new allowProgramOwnedRecipient flag,
which is part of the signed approval text, defaults to off, is stored with
the recipient and is read again before every payment. The refusal stays on
the released receipt (HTTP 409 DIRECT_RECIPIENT_ACCOUNT, MCP
RECIPIENT_REJECTED), the signing script gained --allow-program-owned, and
the mandate form says a recipient is a wallet address, not a token account.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
The stdio bridge built both payment services with the payer key inside the
agent client's process tree. It now runs its runtime without any key
source (PAYER_SECRET_FILE and PAYER_SECRET_JSON are blanked in its
configuration and removed from its environment) and forwards every paid
tool, execute_guarded_payment and the x402 purchases, to the backend over
two new loopback routes, POST /api/bridge/mandates/:id/payments and
POST /api/bridge/runs/:id/purchases. Those routes authenticate with the
shared MCP_BACKEND_TOKEN (no session, cookie or CSRF token), stay off until
it is set, refuse callers that came through the reverse proxy, and reuse
the same DirectPaymentService and runPaidTool the operator API uses, so the
ledger still checks the human grant inside each reservation and signing
claim. Errors cross the boundary as a typed envelope and are rebuilt into
the original classes so the agent sees the same codes as before. The bridge
says on stderr where the key is; ALLOWANCE_MCP_LOCAL_SIGNER=1 restores the
in-process signer for isolated local tests only, and docs/mcp.md,
docs/configuration.md and .env.example now describe what is true.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…imit /api, lock out per address

Every cookie-less visit to /api/session wrote a session row, because the
CSRF token for a visitor lived in the session. The token now travels in an
HttpOnly cookie signed with the session secret and is echoed back in the
x-csrf-token header (a signed double-submit cookie), so nothing is persisted
until the operator signs in; a signed-in session keeps the session-bound
token. Expired sessions and lapsed lockout counters are pruned at start and
every fifteen minutes by a timer the server stops on shutdown, not only in
startup recovery. express-rate-limit now fronts /api (300 requests a minute
per address) and /api/login (20 per fifteen minutes) with draft-8 headers.
The sign-in lockout counts per address only, so an outsider can no longer
lock the operator out by exhausting a global counter, and a successful
sign-in clears that address's counter. Tests cover the zero-row visitor,
the forged cookie, per-address lockout, the limiters and the pruning timer.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
The x402 merchant counted every receipt row created in the last day toward
its 1,000-per-day verification quota, including rows written before the
facilitator verified the payment. An outsider with a throwaway key could
send well-formed payloads that fail verification and fill the quota, so the
operator's own runner was refused. The quota now counts only receipts whose
status is past verification (verified, settling, settled, unknown); rejected
payloads and verifications that never completed no longer consume it. The
counting query is a named helper with a unit test over every status.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…ub local paths

.gitignore now covers *.pem, *payer*.json, *keypair*.json, id.json and
*.key wherever they are written, and the !.env.example exception follows
the last .env* rule so the template stays tracked while every other env
file is ignored; no tracked file matches the new rules. CI gains a
`secrets` job that checks out the full history and runs gitleaks-action
pinned to commit ff98106e4c7b2bc287b24eaf42907196329070c7 (v2.3.9) with the
read-only workflow token and PR comments off. The implementation audit no
longer embeds absolute paths from the author's machine; its evidence and
brand links are relative to the repository.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
Mechanical Prettier output under the repository's own .prettierrc.json:
long lines in server/app.ts and server/index.ts are wrapped. No code
changes. The formatter ran outside the fix commits, so this is kept apart
from them.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…devnet defaults

PAYMENT_NETWORK accepted `mainnet` or `devnet` and the template defaulted
to mainnet. The variable now accepts exactly `devnet` or `mainnet-beta`,
the spellings Solana uses for its clusters; `mainnet` and any other
variant refuse to start, so a typo can never select a cluster, while an
unset value keeps the inert mainnet default in which neither payment rail
can be enabled. MAINNET_PAYMENTS_ACKNOWLEDGED stays the second gate for
both rails. DATA_NETWORK accepts `mainnet-beta` as well as the older
`mainnet`. .env.example is now a devnet configuration with the mainnet
lines commented out; render.yaml, the browser harness, the smoke-command
message and the configuration, live-setup and README docs use the new
spelling, and the network tests cover the refused spellings.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
robots.txt allowed crawling but named no sitemap, so the store-readiness
robots audit failed. public/sitemap.xml now lists the home page and the
two legal pages the listing links to, at the public origin, with the
legal pages' last-updated date, and robots.txt points at it. A new test
pins both files, checks every sitemap address is a route the router
serves, and asserts that /privacy and /terms are rewritten to the shell
with status 200 on the static rehearsal (after the filesystem phase and
before the error phase) and are pages for the Node server, while the two
new files stay plain files. vercel.json is unchanged: the rewrites live in
the build-output route table that scripts/rehearsal-config.ts emits.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…rk test

Prettier re-wrapped two expressions after the previous edits; no behaviour changes.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
A second Next.js advisory published after 16.3.8 is fixed in 16.4.3. The other
direct dependencies named by npm audit move to their patched releases where the
fix stays within the current major; what remains is either the React Native
chain that Mobile Wallet Adapter pulls in or has no patched release yet.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
@operatoruplift operatoruplift changed the title feat: dApp Store readiness: legal pages, English-only shell, listing kit feat: dApp Store readiness, security-audit fixes and dependency updates Oct 24, 2026
…-out /api/session

Since sessions are persisted only at sign-in, an anonymous visitor receives the
signed double-submit CSRF cookie (__Host-allowance-csrf) instead of a session
cookie. The container verifier still asserted the old name, so the
production-image job failed on the first push of this branch.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
Patches the @vitest/mocker advisory that Dependabot opened grouped PRs for; test
runner only, nothing shipped to users changes.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
@operatoruplift
operatoruplift merged commit 133121f into main Oct 25, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — 26ee0659 Deployed Oct 25, 2026 by vercel[bot]
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