Demindiro / agreper

Minimal, no-JS web forum software
https://forum.agreper.com/
GNU Affero General Public License v3.0
654 stars 27 forks source link

Missing Admin Checks #2

Closed underscore-zi closed 1 year ago

underscore-zi commented 1 year ago

Hey,

Looks like you fail to check for the admin role in a couple places:

As such both endpoints can be requested directly, without being logged in. Allowing for anyone to register an account regardless of whether public registration is enabled, and potentially give themselves admin privileges.

As I didn't setup a test environment for myself (would be nice if you had a Dockerfile). I didn't test the admin_set_role endpoint but I was able to register an account using the first endpoint (rather than the usual registration endpoint with a captcha) on your public instance. So I have little reason to think the second one wouldn't also work.

Demindiro commented 1 year ago

Thanks! I completely missed that.