Skip to content

fix(lhf-004): add input validation to payment endpoint#3353

Open
patchninja-my wants to merge 1 commit into
SecureBananaLabs:mainfrom
patchninja-my:fix/lhf-004-payment-validation
Open

fix(lhf-004): add input validation to payment endpoint#3353
patchninja-my wants to merge 1 commit into
SecureBananaLabs:mainfrom
patchninja-my:fix/lhf-004-payment-validation

Conversation

@patchninja-my
Copy link
Copy Markdown

@patchninja-my patchninja-my commented Jun 1, 2026

Fixes

🟠 LHF-004: Payment endpoint lacks input validation

What changed

  • Added validators/payment.js with Zod schema
  • Updated paymentController.js to validate before processing

Validation

Field Rule
amount Required, positive, max 999999
currency usd/eur/gbp/cny, default usd

Bounty Claim

/bounty $100
Wallet: TRON TKaPPxtvKDfMJkset12MzEhrF9hwrtmMPi

Closes #3358

- Add Zod schema for payment requests (amount, currency, description)
- Validate positive amount with reasonable max
- Restrict currency to known values
- Return 400 with specific error messages on invalid input
github-actions Bot added a commit that referenced this pull request Jun 1, 2026
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.

[LHF-004] Add input validation to payment endpoint

1 participant