Skip to content

Feature request: [SECURITY] prevent client side forgery of game results and ui daily task updates. #580

Open

Description

@PlayJeri

What do you want to see in the API?

Currently the API trusts that the requests to UIDailyTask updates and Battle results are legitimate. But these endpoints are easily abusable by a logged in player. With a valid JWT you could send requests to these endpoints as much as you want so you could fake won battles and completed tasks. To prevent this we need some kind of validation system between the game and API.

How do you think this should work?

  • The Game and Api should share a secret key.
  • When game completes an action (battle or task) the game creates an JWT containing the relevant DTO as the payload and signs the token with the shared secret.
  • The Game should also add a session ID (randomly generated value) to the token so Api can validate that the same token isn't used multiple times.
  • This JWT should be required for requests to these endpoints ( /gameData/battle, /dailyTasks/uiDailyTask).
  • used Session IDs should be saved on API to redis with TTL matching with the token.
  • API verifies the JWT signature using the shared secret and check if session ID exists in redis.

Activity

  1. removed their assignment
    on Jun 29, 2025
  2. self-assigned this
    on Apr 19, 2026
  3. CapoMK25 commented on Apr 19, 2026

    @CapoMK25
    Collaborator

    Assigned to myself just in case.

  4. removed their assignment
    on Apr 23, 2026
  5. self-assigned this
    on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

featureNew feature to add

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions