Skip to content

Feature/verify key decoder defense#653

Open
godamongstmen897 wants to merge 3 commits into
DXmakers:mainfrom
godamongstmen897:feature/verify-key-decoder-defense
Open

Feature/verify key decoder defense#653
godamongstmen897 wants to merge 3 commits into
DXmakers:mainfrom
godamongstmen897:feature/verify-key-decoder-defense

Conversation

@godamongstmen897
Copy link
Copy Markdown
Contributor

Summary

Closes #464. Implements defensive input validation and normalizing strategies inside the Web3 signature decoding routine to guarantee the backend rejects malformed raw bytes gracefully without panicking.

What Changed

  • Defensive Normalization: Patched decodeSignature inside backend/src/routes/auth.ts to automatically strip spaces and 0x prefixes, evaluating multi-format variations safely (hex, base64, base64url).
  • Invariant Enforcement: Added explicit buffer size-checking constraints to ensure decoded payloads align exactly with Ed25519 standard expectations (64 bytes) prior to signature parsing.
  • Exception Boundary: Encapsulated malformed decoding faults within structured exceptions, converting unhandled runtime errors into clean, standard HTTP 401 Unauthorized responses.
  • Verification Suites: Updated backend/test/run-tests.ts with explicit negative test vectors to verify that passing corrupted bytes triggers controlled rejections.

Testing & Validation

  • Verified type compatibility and build profiles locally using npm run build.
  • Validated negative assertions and bounds checks pass through structural mocks.

Closes #464

Copilot AI review requested due to automatic review settings May 29, 2026 14:44
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

@godamongstmen897 is attempting to deploy a commit to the mAzI's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

@soomtochukwu soomtochukwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • If you could fix the merge conflict(s) ASAP
  • see that the CI checks pass

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.

[BE-W3A-110] Web3 Signature Security and Auditing - Step 110

3 participants