EH-1: humanize extension signed-fee undershoot errors for retail UI (#371) #895
No reviewers
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!895
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-371-fee-undershoot-user-copy"
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?
Summary
When Keplr (or another extension wallet) signs a fee far below the dApp envelope on LocalTerra, the Swap UI was showing the full developer diagnostic string — GitLab issue refs,
npm cishell instructions, rawulunaamounts, and Station-specific troubleshooting.This MR routes those errors through retail copy (
Transaction fee mismatch…) while keeping the detailed diagnostic inconsole.errorvia the existing broadcast catch path.Verification checklist
cd frontend-dapp && npm run test -- --run src/utils/__tests__/humanizeTerraTxError.test.ts— new#371case PASShumanizeUserFacingErrorstrips GitLab refs, uluna, CLI, Station copynpm run test -- --run src/utils/__tests__/humanizeUserFacingError.test.ts—#371case PASSTxResultAlert(Swap error surface) shows retail copy onlynpm run test -- --run src/components/ui/__tests__/TxResultAlert.test.tsx—#371case PASSnpm run test -- --run src/services/terraclassic/__tests__/terraBroadcast.test.ts— updated#371case PASSnpm run test -- --run src/utils/__tests__/extensionSignedFeeGuard.test.ts— unchanged, PASS/Swap (issue repro steps)make deploy-local-no-buildfailed at wrap-mapper (empty address string); chain deploy incomplete — not re-runFollow-ups
make setup-cloud-localterradeploy on a clean VM.changed the description
changed the description
Security review — MR !895
Commit reviewed:
f8e2cfc11dd96f03fcbcdf14f237b00fc4750098Scope: EH-1 — humanize extension signed-fee undershoot errors for retail UI (#371). Touches
extensionSignedFeeGuard.ts,humanizeTerraTxError.ts,terraBroadcast.ts, and related unit tests.Outcome:
FINDINGS: 0medium+Summary
Reviewed added/modified paths for injection, authn/authz bypass, secret leakage, XSS, and unsafe error surfacing. This MR only changes user-visible error copy: the post-sign fee undershoot guard still throws the full diagnostic (logged via
console.errorinbroadcastTerraExecuteContracts), whiletryHumanizeTerraTxMessagenow returns the static constantEXTENSION_SIGNED_FEE_USER_MESSAGEinstead of echoing the diagnostic string. TheterraBroadcastbypass that previously passed those errors through unhumanized was removed so UI and broadcast paths stay consistent.Controls verified:
TxResultAlert) uses React text interpolation — nodangerouslySetInnerHTML.Prefix-match note (below medium):
inner.includes(EXTENSION_SIGNED_FEE_UNDERSHOOT_PREFIX)could theoretically match an attacker-crafted chain error containing that exact dApp-internal substring, but the impact is limited to a benign misleading retail message — not fund loss, privilege escalation, or script execution.Inline threads: none (no medium+ findings).
Security review: no medium+ findings on this diff.
added 92 commits
mainb8238b02- Merge origin/main into fix/issue-371-fee-undershoot-user-copy.Compare with previous version
Resolved merge conflicts with
mainby merging latestorigin/maininto this branch.Conflicts resolved (4 files):
terraBroadcast.ts— kept main's split-sign/recovery broadcast path andisTerraTxTimeoutMessage; preserved #371 behavior (no raw fee-guard bypass before humanization).humanizeTerraTxError.ts— unified onEXTENSION_SIGNED_FEE_UNDERSHOOT_USER_MESSAGEfrom main.extensionSignedFeeGuard.ts— dropped duplicateEXTENSION_SIGNED_FEE_USER_MESSAGEalias.Sanity: 62 related frontend unit tests pass (
humanizeTerraTxError,humanizeUserFacingError,TxResultAlert,terraBroadcast,extensionSignedFeeGuard).changed the description
Security review — MR !895
Commit reviewed:
b8238b02375d2622c626a513b9e6b888e7997c97Scope: EH-1 — humanize extension signed-fee undershoot errors for retail UI (#371). This revision touches only Vitest coverage in
TxResultAlert.test.tsx,humanizeTerraTxError.test.ts, andhumanizeUserFacingError.test.ts(fixture expansion + new#371assertions). No production/runtime source files in the diff.Outcome:
FINDINGS: 0medium+Summary
Re-reviewed the MR diff and traced the error-surfacing path the tests exercise (
extensionSignedFeeGuard→terraWalletSignTxRaw/terraBroadcast→humanizeUserFacingError→TxResultAlert). The added tests only assert that legacy verbose diagnostic strings (GitLab refs,npm ci, rawuluna/gas figures) are replaced with the static retail constantEXTENSION_SIGNED_FEE_UNDERSHOOT_USER_MESSAGEbefore UI render.Controls verified (unchanged production paths referenced by tests):
extensionSignedFeeGuardreturns the hardcoded user message; detailed diagnostics go toconsole.warnonly.tryHumanizeTerraTxMessagemaps prefix/legacy diagnostic input to the same static string — no echo of wallet numeric fields or shell instructions in UI output.TxResultAlertrenders via React text interpolation (humanizeUserFacingError); nodangerouslySetInnerHTML.Prefix-match note (below medium, unchanged):
inner.includes(EXTENSION_SIGNED_FEE_UNDERSHOOT_PREFIX)could match a chain error containing that exact internal substring, but impact is limited to a benign misleading retail message — not fund loss, privilege escalation, or script execution.Inline threads: none (no medium+ findings).
Security review: no medium+ findings on this diff.
mentioned in commit
fe5c3c2fb5