🔒 [SECURITY] Multiple critical vulnerabilities discovered in StablePay SDK

Open
#25 0 comments 0 reactions 0 assignees View on GitHub

@WhiteWolf217 is already working on this.

Since Dec 13, 2025.

  • #26 by @WhiteWolf217 — open

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript

Research direction

Start by reviewing the open pull request #26 and the affected components named in the report: stablepay-sdk/src/widget/TransactionReview.jsx, stablepay-sdk/src/core/Transaction.js, and djed-sdk/src/helpers. js. The issue lists seven security concerns and suggested actions; determine their current status and scope before proposing work. Done means the relevant vulnerabilities are addressed and verified, but the issue does not specify tests or acceptance criteria.

Written by the indexing model from the issue text.

Description

🔒 Security Vulnerabilities Report

During a security audit of the StablePay SDK, I've identified 7 security vulnerabilities that need immediate attention:

Critical Issues (4):
  • ❌ No address validation - Funds can be permanently lost if sent to zero address (0x0000... 0000)
  • ❌ XSS vulnerabilities - User input is not sanitized, allowing cross-site scripting attacks
  • ❌ Hardcoded UI fee address - No flexibility for deployment configuration
  • ❌ Fixed gas limit - Hardcoded to 500,000, causing transaction failures during network congestion
Medium Issues (2):
  • ⚠️ No rate limiting - System vulnerable to DoS attacks via transaction spam
  • ⚠️ No amount validation - Allows negative amounts, overflow attacks, NaN/Infinity values
Low Issues (1):
  • ⚠️ Missing security audit logging - Security events are not being tracked

📊 Risk Assessment

  • CVSS Scores: Critical vulnerabilities range from 7.5 to 9.1
  • Impact: Potential fund loss, account compromise, service disruption
  • Likelihood: High for user-facing vulnerabilities

🎯 Affected Components

  • stablepay-sdk/src/widget/TransactionReview.jsx
  • stablepay-sdk/src/core/Transaction.js
  • djed-sdk/src/helpers. js
  • Multiple components accepting user input

📋 Recommended Actions

  1. Implement input validation for addresses (format, zero address, blacklists)
  2. Add XSS sanitization for all user inputs
  3. Make UI address configurable via environment variables
  4. Implement dynamic gas estimation with safety buffer
  5. Add rate limiting to prevent DoS attacks
  6. Validate transaction amounts
  7. Add security event logging

Dominant language
JavaScript
Stars
16
Forks
29
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from StabilityNexus/StablePay

All issues in StabilityNexus/StablePay

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.