Summary
100% of all REPORTED Findings have been addressed
- 5Acknowledged
- 11Risk Accepted
- 16Solved
- 32All Findings
- Critical4
- 4Solved
- High3
- 2Solved
- 1Risk A.
- Medium11
- 7Risk A.
- 4Solved
- Low9
- 6Solved
- 3Risk A.
- Informational5
- 5Ack.
INTRODUCTION#
Makachain engaged Halborn to conduct a Red Team Exercise against MakaPay, a cross-chain cryptocurrency payment platform that enables merchants to accept payments on multiple EVM chains (Ethereum, Polygon, BSC, Base) while managing gas fees through a single balance on the MAKA chain. The assessment targeted the production deployment at app.makapay.io and its backend infrastructure.
The platform architecture consists of:
Convex Backend (~40,000 lines): Serverless functions handling payment processing, fee calculation, referral commissions, recovery operations, vault custody, POS terminals, and Telegram bot integration. Deployed at
knowing-guineapig-268.convex.cloud.Next.js Application (~56,000 lines): Merchant dashboard, customer payment pages, REST API routes (
/api/v1/*,/api/pos/*,/api/vault/*), admin panel, and Telegram Mini App.Smart Contracts (Solidity/Foundry): GasTank, PaymentWalletFactory (CREATE2), TrustedOracle — deployed across MAKA chain and payment chains.
Agents Service (Mastra): AI-driven operational tooling with Convex admin key and GitLab write access.
Authentication is provided by Clerk (JWT-based), with the Convex backend accepting tokens via the convex audience template. The platform uses a single hot wallet (GAS_TANK_PRIVATE_KEY) to sign on-chain transactions across all supported chains for payment settlement, recovery, referral payouts, and gas-tank operations.
The engagement combined source-code review of the makapay-main repository with live dynamic testing against the production environment using Burp Suite and browser-based exploitation. All Critical and High findings were confirmed with production evidence.
The MakaPay platform contains Critical vulnerabilities that allow an anonymous attacker to drain the platform's operational hot wallet without any authentication, at near-zero cost. Three independent attack paths to treasury drain were identified and confirmed on production:
Unauthenticated Earnings Minting: A development utility function (
seedReferralEarningsForEmail) is deployed to production as a public, unauthenticated endpoint. Any anonymous caller can insert withdrawable referral earnings into any user's account by supplying their email address. We executed this 3 times on production, successfully minting 9 earnings records with zero credentials.Hot-Wallet Gas Drain: A recovery function (
forceProcessWithHighGas) signs on-chain transactions with the platform hot wallet using attacker-controlled gas price parameters. It is publicly callable without authentication. An attacker can set gas to extreme values (millions of gwei) and burn the hot wallet's entire ETH/POL/BNB balance in a single call.Commission Fabrication: The payment creation API accepts arbitrary fee percentages and agent markup values from the client without server-side validation. An attacker sets
feeAmount: 0(collects no on-chain fee) butfeePercentage: 99.99%andagentMarkupPercentage: 99.99%. On settlement, the platform computes commissions from these stored values and pays ~90% of the stated amount from its hot wallet to the attacker's referrer account. We created 100 such payments on production — all accepted without rejection.
Beyond the treasury-drain paths, the engagement uncovered a systemic authorization failure across the Convex backend: dozens of public functions that handle sensitive data or state-changing operations perform no authentication check whatsoever. This enabled confirmed production exploitation of:
Full payment history and customer PII (email addresses) readable by any anonymous internet user
The entire merchant referral graph and commission rates exposed without authentication
Telegram Mini App endpoints returning any merchant's data by userId parameter
Alchemy webhook payment-crediting function callable directly, bypassing HMAC signature verification
Overall Security Posture: CRITICAL. The platform's on-chain fund-movement logic (CREATE2 settlement) is architecturally sound — payment wallets correctly sweep to the stored merchant address. However, the off-chain accounting, commission, and operational layers that surround it are fundamentally broken from an access-control perspective. The hot wallet is the single point of failure, and multiple confirmed paths exist to drain it.
SCOPE#
The assessment covered the following components of the MakaPay platform:
Source Code Review#
Repository:
makapay-main(provided by client)Convex Backend:
frontend/convex/**/*.ts— 72 files, ~40,000 lines. Payment processing, fee calculation, referral system, recovery/withdrawal, vault, POS, Telegram, webhooks, sanctions screening, migrations.Next.js API Routes:
frontend/src/app/api/**— 34 route handlers covering the public API (v1), POS auth/payments, vault, webhooks, oracle, admin.Frontend Application:
frontend/src/**— React components, hooks, server actions, admin panel, Telegram Mini App.Shared Configuration:
frontend/shared/**— Network configs, contract ABIs, fee config, token registries, PIN security utilities.Agents Service:
agents/src/**— Mastra AI tools (onchain, convex, gitlab, axiom), workflows, and skills.Deployment Scripts:
scripts/**,contracts/**(Foundry project).
Live Dynamic Testing#
Production URL:
https://app.makapay.ioConvex Deployment:
knowing-guineapig-268.convex.cloud(API) /.convex.site(HTTP routes)Clerk Instance:
clerk.makapay.ioTest Accounts:
alpcan.onaran+sales@halborn.com(sales_agent role),alpcan.onaran+user@halborn.com(merchant role)Tools: Burp Suite (raw HTTP), Cursor IDE integrated browser (authenticated flows), ConvexHttpClient (direct API calls)
Out of Scope#
Smart contract Solidity code (covered in a separate engagement)
Mobile applications
Third-party integrations (Clerk, Alchemy, deBridge) internal security
Social engineering and physical access
METHODOLOGY#
The engagement followed a hybrid approach combining white-box source review with black-box/grey-box dynamic testing against the live production environment.
Phase 1: Architecture Mapping and Threat Modeling#
Mapped the full repository structure to classify frontend vs. backend code
Identified the authentication model (Clerk → Convex JWT, API keys, POS PIN sessions)
Established the critical insight that Convex
query/mutation/actionexports are publicly callable by any network client unless the handler itself validatesctx.auth.getUserIdentity()Confirmed the Clerk middleware (
proxy.ts) does NOT callauth.protect()— each function must self-authenticateMapped all hot-wallet signing paths and privilege boundaries
Phase 2: Systematic Source Review (6 Parallel Deep Dives)#
Payments Core: payment creation, processing, settlement, fee calculation, confirmation tracking
Webhooks & External Input: Alchemy, Clerk, Telegram webhooks; signature verification; injection surfaces
Recovery & Withdrawals: hot-key signing functions, recipient control, gas-tank operations
REST API Routes: every Next.js route handler auth/authz, admin determination, POS PIN flow
Referrals & Commissions: earning crediting, self-referral, withdrawal, plan payments, faucet
POS, Vault, Telegram, Agents: PIN security, session management, initData verification, AI tool capabilities
Phase 3: Dynamic Confirmation on Production#
Extracted the Convex deployment URL from client-side JavaScript bundles
Sent unauthenticated requests via Burp Suite to every identified public function
Logged into test accounts via the integrated browser to obtain Convex JWTs
Proved the auth/no-auth delta: admin-gated functions correctly reject non-admins, while vulnerable functions execute for anyone
Created 100 malicious payment records with fabricated commission parameters to prove no input validation or rate limiting exists
Minted referral earnings on production accounts with zero authentication to prove the end-to-end impact
Phase 4: Exploitation Safety Boundaries#
To avoid impacting production merchants:
All fund-movement exploits used non-existent payment IDs or dead/burn addresses
The
forceProcessWithHighGasproof used a fake payment ID (returned "Payment not found" without signing)No real merchant data was modified, no real funds were moved, no POS terminals were disrupted
Test payments were created only under our own controlled accounts
Remediation Validation#
Following the initial assessment, a remediation review of the fixes implemented by the client was performed. Each remediation was verified through dynamic testing against the live environment, using an authenticated test merchant account and a valid API key, with responses compared against a known good control call to confirm the observed behavior. Source code was not available during this stage, so verification was based on externally observable behavior. Where a recommendation extended beyond what could be observed externally.
FINDINGS SUMMARY#
The engagement identified 4 Critical, 5 High, 9 Medium, and 10 Low/Informational findings across the MakaPay platform.
Critical Findings (Confirmed on Production)#
| ID | Title | Root Cause | Impact |
|---|---|---|---|
| HAL-01 | Unauthenticated Referral Earnings Minting | Dev utility deployed as public action, no auth | Hot wallet drain (testnet-bounded amounts) |
| HAL-02 | Hot-Wallet Gas Drain via forceProcessWithHighGas | Recovery action public, no auth, uncapped gas | Hot wallet native token drain (ETH/POL/BNB) |
| HAL-03 | Commission Fabrication via Client-Controlled Fee Fields | No server-side validation of fee/markup inputs | Unlimited hot wallet drain via referral withdrawals |
| HAL-04 | Unpaid Payments Marked Completed + Signed Webhooks | No on-chain settlement verification | Merchant system deception, stuck funds |
High Findings#
| ID | Title | Confirmed |
|---|---|---|
| HAL-05 | Alchemy Webhook HMAC Bypass (processAddressActivity public) | Yes (prod) |
| HAL-06 | Telegram Mini App IDOR — Payment History & Customer PII | Yes (prod) |
| HAL-07 | Platform-Wide Data Exposure (tempSearchByDescription, getPaymentById, merchantAnalytics) | Yes (prod) |
| HAL-08 | API Keys Stored in Plaintext | Code-confirmed |
| HAL-09 | POS PIN Login — No Brute-Force Protection | Code-confirmed |
Systemic Root Cause#
The single architectural flaw driving the majority of findings: Convex public functions are network-callable by any client, and a significant number of security-sensitive functions (fund crediting, hot-key signing, data queries) were deployed without ctx.auth.getUserIdentity() checks. The Clerk middleware does not enforce blanket protection. This pattern accounts for 7 of the 9 Critical+High findings.
Scope#
Findings Overview#
# | Title | Severity | Score | Status |
|---|---|---|---|---|
HAL-01 | Unauthenticated Referral Earnings Minting Allows Platform Hot Wallet Drain | Critical | 10.0 | Solved08/11/2026 |
HAL-02 | Unauthenticated Public Action Signs Hot-Wallet Transactions with Attacker-Controlled Gas Price | Critical | 10.0 | Solved08/11/2026 |
HAL-03 | Client-Controlled Fee Fields Enable Unlimited Commission Fabrication and Platform Treasury Drain | Critical | 9.6 | Solved08/11/2026 |
HAL-04 | Unpaid Payments Can Be Marked as Completed and Used to Trigger Signed Webhooks | Critical | 9.1 | Solved08/11/2026 |
HAL-05 | Telegram Mini App IDOR Exposes All Merchants' Payment History and Customer PII Without Authentication | High | 8.2 | Solved08/12/2026 |
HAL-06 | RPC debug_dumpBlock and debug_traceTransaction Enabled on Public Endpoint | High | 7.5 | Risk Accepted08/10/2026 |
HAL-07 | Webhook SSRF With Response Body Disclosure | High | 7.1 | Solved08/12/2026 |
HAL-08 | Unverified Email Addresses Reserve the Identifier Globally Enabling Email Squatting and Denial of Registration | Medium | 6.3 | Risk Accepted08/10/2026 |
HAL-09 | Missing Rate Limiting on Payment and Vault APIs | Medium | 5.4 | Risk Accepted08/10/2026 |
HAL-10 | Production JWT Accepted by Sandbox Convex Deployment | Medium | 5.4 | Risk Accepted08/10/2026 |
HAL-11 | Inconsistent Authentication and Input Validation in Payment Listing API | Medium | 5.3 | Risk Accepted08/10/2026 |
HAL-12 | Public Payment Page Exposes Internal Payment Data | Medium | 5.3 | Risk Accepted08/10/2026 |
HAL-13 | Unsafe redirectUrl Values Accepted During Payment Creation | Medium | 4.6 | Solved08/12/2026 |
HAL-14 | customPriceUsd Accepts Negative Values, Zero, and NaN | Medium | 4.3 | Solved08/12/2026 |
HAL-15 | Duplicate orderId Accepted Within Same Merchant Account | Medium | 4.3 | Solved08/12/2026 |
HAL-16 | Sandbox Convex Deployment Leaks Source File Paths in Errors | Medium | 4.3 | Risk Accepted08/10/2026 |
HAL-17 | Chain Deployment Data Leaks Internal User IDs and Third-Party RPC URLs | Medium | 4.3 | Solved08/12/2026 |
HAL-18 | Session Cookie (__session) Lacks HttpOnly Flag | Medium | 4.2 | Risk Accepted08/10/2026 |
HAL-19 | Payment Verification Endpoint Leaks Payment ID Existence | Low | 3.7 | Solved08/12/2026 |
HAL-20 | Account Enumeration via Clerk Sign-In Endpoint | Low | 3.7 | Risk Accepted08/10/2026 |
HAL-21 | Insufficient Sign-In Rate Limiting (6 Attempts Before Throttle, No CAPTCHA) | Low | 3.7 | Risk Accepted08/10/2026 |
HAL-22 | Missing Re-Authentication on Email Address Addition Enables Account Takeover from Session Compromise | Low | 3.1 | Risk Accepted08/10/2026 |
HAL-23 | Control Characters and Raw HTML Stored in orderId | Low | 3.1 | Solved08/12/2026 |
HAL-24 | blockConfirmations Accepts Zero and Fractional Values | Low | 3.1 | Solved08/25/2026 |
HAL-25 | Backend Library Version (viem@2.45.0) Disclosed in Payment Amount Error | Low | 3.1 | Solved08/12/2026 |
HAL-26 | Webhook Signing Secret Exposed in API Response | Low | 3.1 | Solved08/25/2026 |
HAL-27 | Missing Security Headers (CSP, X-Frame-Options, HSTS, Referrer-Policy) | Low | 3.1 | Solved08/25/2026 |
HAL-28 | Sensitive Dashboard Pages Cached for 1 Year (s-maxage=31536000) | Informational | 0.0 | Acknowledged08/10/2026 |
HAL-29 | TLS 1.0 and TLS 1.1 Accepted (Deprecated Protocols) | Informational | 0.0 | Acknowledged08/10/2026 |
HAL-30 | Verbose Error Headers Leak Auth State and Framework Internals | Informational | 0.0 | Acknowledged08/10/2026 |
HAL-31 | IP-Based Rate Limit Creates Denial-of-Service Vector on Login | Informational | 0.0 | Acknowledged08/10/2026 |
HAL-32 | Convex Deployment URL and Internal Architecture Exposed in JS Bundles | Informational | 0.0 | Acknowledged08/10/2026 |
Disclaimer#
Halborn strongly recommends conducting a follow-up assessment of the project either within six months or immediately following any material changes to the codebase, whichever comes first. This approach is crucial for maintaining the project’s integrity and addressing potential vulnerabilities introduced by code modifications.
