Skip to content

Expert unlock leaks across sessions via module-level _SPECS state #22

Description

@CyberSunil

_SPECS in challenges/expert_vault.py is module-level global state. Once any player submits the correct key, _SPECS is not None for the entire process, and is_loaded() returns True for every subsequent visitor until restart.

Since the app runs under gunicorn with a single worker, one successful unlock likely opens the expert tier to everyone hitting that instance.

Needs checking: which routes in app.py gate on is_loaded() rather than on the individual player's session. If any serve expert content based on the global, the tier is effectively unlocked for all users after the first successful unlock.

Related, lower priority:

  • _verify uses == for key comparison; should use hmac.compare_digest
  • _VALID_KEY holds the key in cleartext in module globals; consider storing a hash
  • No rate limiting on unlock attempts

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions