Skip to content

fix: scrub RPC URLs and contract addresses from 500 error responses - #215

Merged
collinsezedike merged 1 commit into
mainfrom
fix/sanitize-500-errors
Jun 21, 2026
Merged

collinsezedike merged 1 commit into
mainfrom
fix/sanitize-500-errors

Conversation

@collinsezedike

@collinsezedike collinsezedike commented Jun 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Added sanitizeTxError(err, fallback) helper to @meridian/shared that extracts only the first line of an error message and drops it if it contains an RPC URL or Stellar contract address
  • Replaced all raw err.message exposures in the four Vercel tx handlers and the Fastify tx route with sanitizeTxError, keeping user-facing messages (e.g. "All required trustlines already exist") while scrubbing deployment details

Test plan

  • sanitizeTxError unit tests in packages/shared/src/utils.test.ts cover: non-Error values, multi-line messages, RPC URL in first line, C-address in first line, empty message, and clean user-facing message
  • All 10 tests in packages/shared pass

Closes #180

@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
meridian Ready Ready Preview, Comment Jun 21, 2026 2:58pm

@collinsezedike
collinsezedike merged commit b12bd67 into main Jun 21, 2026
5 checks passed
@collinsezedike
collinsezedike deleted the fix/sanitize-500-errors branch June 21, 2026 15:00

This branch was successfully deployed

1 active deployment
Preview — a1f6a980 Deployed Jun 21, 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.

[Fix] internal Blend SDK errors leak deployment details in 500 response body

1 participant