CTFd / CTFd/CTFd

User/Session Management via Rest API

Open
#1,541 1 comment 0 reactions 0 assignees View on GitHub
plugin idea
Dominant language
Python
Stars
6.8k
Forks
2.8k
Avg merge
1d 6h
Merged PRs (30d)
5

Description

**Environment**:
docker ctfd/ctfd latest:
**Issue**
After reviewing the recently released swagger documentation covering the api endpoints it seems that there are no endpoints handling user/session management, such as generating and fetching a users api bearer token. There are GET and POST /token endpoints, but as far as I can tell there's no way to authenticate to them in the first place, so any calls you make to these endpoints just return 200 OK and the html of the home page instead of 401 Unauthorized.
If it were possible to deploy ctfd via an api call (creating the admin user in the process), generate and fetch the admin users api token (via the api authenticating with the admins username and password that was just set) via another api call, and use that token to create more users and fetch their api tokens (again using the same endpoint) this system would become very robust very quickly. This functionality would allow ctfd to shine in educational environments by allowing the admin to quickly and easily deploy the ctf, create the users, fetch their api tokens, and create their challenges. If one were to randomly generate a"flag" for any given challenge and trigger the submission of that challenge via a specific users api token, then the flag itself becomes an arbitrary secret and shifts the focus of the challenge from "finding a flag" to actually solving the challenge. I've managed to get a proof of concept of this use case working, however unfortunately I've had to resort to selenium to perform the initial ctfd setup, create users, and fetch api tokens.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.