[#138] Finding 7: PresaleVestingPage — redact claim errors (no RPC key leak) #145
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#145
Loading…
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?
Parent: Split from #138 — Pre-deploy review pass 2 (Finding 7).
Severity: Low
Problem
frontend/src/pages/PresaleVestingPage.tsxrendersclaimError.messageraw from wagmi/viem into<StatusMessage>. Errors can embed full RPC URLs including API keys, gas estimation blobs, or revert data — leaking via screenshots, screen share, DevTools, or error reporting tools.friendlyRevertFromUnknownexists and is used on TimeCurve buy / referrals in places, but not here.References
frontend/src/pages/PresaleVestingPage.tsx(~L269)frontend/src/lib/revertMessage.tsfrontend/src/lib/revertMessage.test.tsdocs/frontend/presale-vesting.mddocs/testing/invariants-and-business-logic.md.cursor/skills/yieldomega-guardrails/SKILL.mdRecommended fix
friendlyRevertFromUnknown(err)beforesetClaimError/ display.import.meta.env.VITE_RPC_URL(and query-param patterns likealchemy.com/v2/keys if safe generically without breaking messages) before any user-visible string.error.messageraw renders on write surfaces (referrals, TimeCurve — grepStatusMessage+.message).Acceptance criteria
messageon PresaleVestingPage for claim failures.Verification checklist
changed title from
[#139] Finding 7: PresaleVestingPage — redact claim errors (no RPC key leak)to[#138] Finding 7: PresaleVestingPage — redact claim errors (no RPC key leak)mentioned in issue #138
mentioned in commit
ba9d72ec9cImplemented (merged to
main, commitba9d72e)Summary: Presale vesting
/vestingclaim failures no longer render raw wagmierror.message. Errors go throughfriendlyRevertFromUnknown, which now runsredactSensitiveUrlsInUserMessagefirst — stripping build-timeVITE_RPC_URLwhen present and matching common hosted-RPC URL shapes (Alchemy/v2/, Infura/v3/, QuickNode).Audit: Repo grep for
StatusMessage+ raw.messageon writes found onlyPresaleVestingPage; that surface is fixed.Docs / cross-links:
docs/testing/invariants-and-business-logic.md(Claim error privacy, anchorpresale-vesting-claim-error-redaction-gitlab-145),docs/frontend/presale-vesting.md,docs/frontend/wallet-connection.md,docs/testing/manual-qa-checklists.md#manual-qa-issue-145,skills/README.md,.cursor/skills/yieldomega-guardrails/SKILL.md§28.Tests:
frontend/src/lib/revertMessage.test.ts(Vitest).Verification checklist for @brouie
/vesting, trigger aclaimfailure withVITE_RPC_URLcontaining an obvious fake key — DOM / screenshot shows no full URL or key substring; expect[RPC URL redacted]or mapped friendly revert text.StatusMessage(existing landmark / semantics unchanged).npx vitest run src/lib/revertMessage.test.tspasses.Leaving issue open per maintainer workflow.
@PlasticDigits — verification PASS on
ba9d72e. walked your checklist:npx vitest run src/lib/revertMessage.test.tsgreen: 8/8 PASS — covers Alchemy URL (HTTP + WSS), Infura URL, QuickNode, custom-fragment redaction viaextraKnownRpcUrlSubstrings, the buy-submit hint pass-through, and a wagmi-style error with embedded Alchemy URL flowing throughfriendlyRevertFromUnknown.PresaleVestingPage.tsxL271 confirmed:{friendlyRevertFromUnknown(claimError)}replaces the prior raw{claimError.message}. import at L12. claim failure surface now redacted before DOM render.revertMessage.tsL5-39REDACTED_RPC_URL_MARKER+redactSensitiveUrlsInUserMessage— stripsVITE_RPC_URLexact substrings (longest-first), pattern-matches Alchemy v2 (HTTP + WSS), Infura v3, QuickNode hosted URLs.friendlyRevertFromUnknownL116-131 collapses viem BaseError/Error/unknown → string, runs redaction, then maps viafriendlyRevertMessage, falls through to a 200-char tail.StatusMessagelandmark, no semantic change.PresaleVestingPagehad the raw.messageon a write surface, and that's now fixed. no other surfaces leak the URL.ready for close on your side.
mentioned in issue #325