webdevcody / webdevcody/code-racer

[BUG]: Directly posting to API creates unvalid races

Open
#648 1 comment 0 reactions 1 assignee View on GitHub

@bkbCodes is already working on this.

Since Aug 16, 2023.

bug
Dominant language
TypeScript
Stars
697
Forks
594
PR merge metrics
No merged PRs in 30d

Description

Description

I've encountered a bug in the web application that you can create new finished races to show up in dashboard with same snippet id by posting to 'https://code-racer-eight.vercel.app/race/practice' directly. This allows users to create multiple races by using the same snippet id.

Also system only checks if the cpm is less than or equal 10k and accuracy is less than or equal to 100. Other than that there is no validation to check the cpm and accuracy of races that have been posted. Any post using same headers allows users to create races with fake results. Steps i followed to be able to post any cpm and accuracy ratings:

  1. Copy the valid request from the network panel of devtools by playing a random race.
  2. Find the snippet id by refreshing the page after the snippet is loaded. (It is in the last script tag which contains self.__next_f)
  3. Send request after changing the snippetId value to the new snippet id.

inifinite-race

(optional) What browsers are you seeing the problem on?

No response

Code of Conduct
  • I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.