CTFd / CTFd/ctfcli

Password protected hosted instances at ctfd.io give 401 UNAUTHORIZED

Open
#186 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
215
Forks
95
Avg merge
2h 17m
Merged PRs (30d)
1

Description

Hey!

Noticed something strange. If a instance is password protected via the ctfd.io instance settings, the cli tool won't work. Just to be clear, we are talking about a Site password, not the registration password 👍

![Image](https://github.com/user-attachments/assets/dc312f07-87d9-4ada-94b3-325dac10e61b)

```
2025$ ctf challenge install forensics/bad_snakes
Installing challenges [------------------------------------] 0%
Installing 'Bad Snakes (1)' (forensics/bad_snakes/challenge.yml) ...

Traceback (most recent call last):
File "/home/n/.local/bin/ctf", line 8, in
sys.exit(main())
^^^^^^
File "/home/n/.local/pipx/venvs/ctfcli/lib/python3.11/site-packages/ctfcli/__main__.py", line 136, in main
ret = fire.Fire(COMMANDS["cli"], serialize=lambda r: None if isinstance(r, int) else r)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/n/.local/pipx/venvs/ctfcli/lib/python3.11/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/n/.local/pipx/venvs/ctfcli/lib/python3.11/site-packages/fire/core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
^^^^^^^^^^^^^^^^^^^^
File "/home/n/.local/pipx/venvs/ctfcli/lib/python3.11/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/n/.local/pipx/venvs/ctfcli/lib/python3.11/site-packages/ctfcli/cli/challenges.py", line 627, in install
challenge_instance.create(ignore=ignore)
File "/home/n/.local/pipx/venvs/ctfcli/lib/python3.11/site-packages/ctfcli/core/challenge.py", line 679, in create
r.raise_for_status()
File "/home/n/.local/pipx/venvs/ctfcli/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: UNAUTHORIZED for url: https://mnectf-2025.ctfd.io/api/v1/challenges
n
```

Solution is already documented in their docs, i can make a pull request if you want to? :)

https://docs.ctfd.io/tutorials/api/using-ctfd-api-site-pass/

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.