Skip to content
Access control Write-up Beginner

How I Found a Way to Submit LeetCode Premium Problems as a Free U

The backend did not verify whether a free user was authorised to submit a solution to a Premium problem, so a user could swap the question identifier in a submission request to a Premium one and have it accepted. This also allowed earning LeetCode Coins for restricted contest problems without a subscription.

Shreyas Mahajan Follow

Published on medium.com

It all started while I was practicing on a normal LeetCode question — one of the classic ones like “Two Sum”. I had Burp Suite running in the background, as I often do when poking around platforms out of curiosity.

Shreyas Mahajan, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

A free user could submit solutions to Premium problems and earn LeetCode Coins for restricted contest questions, giving an unfair contest advantage and undermining the subscription model.

What the attacker needed

A free LeetCode account; ability to intercept HTTP requests

The fix

The bug was fixed by the team.

How it was found

  1. Open a normal LeetCode question and intercept the submission request.
  2. Replace the normal question's identifier with that of a Premium question.
  3. Send the modified request and observe that the submission is accepted.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

LeetCode has paid 'Premium' questions. The website hides these from free users, but the server that receives your submitted answer did not check whether you were allowed to answer that particular question. By changing which question the answer was for, a free user could submit answers to paid questions and even earn rewards.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.