diff options
author | Frederick Muriuki Muriithi | 2024-06-06 10:10:38 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-06-06 10:10:38 -0500 |
commit | 7d0c5cf8d2ab49f6a98c0a15189da5b7fa1695fd (patch) | |
tree | b2ff3631265cd613e0a61b99a9645ca58873cc31 /gn2/wqflask/oauth2 | |
parent | 00e9a91e7a43a6e56fc45407b09cf291bfbbf5e9 (diff) | |
download | genenetwork2-7d0c5cf8d2ab49f6a98c0a15189da5b7fa1695fd.tar.gz |
Deactivate the "create_role" function
The `create_role` function could lead to privilege escalation. This
commit deactivates it completely to prevent the chance of that
happening.
Diffstat (limited to 'gn2/wqflask/oauth2')
-rw-r--r-- | gn2/wqflask/oauth2/roles.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gn2/wqflask/oauth2/roles.py b/gn2/wqflask/oauth2/roles.py index 2fe35f9b..ee75475e 100644 --- a/gn2/wqflask/oauth2/roles.py +++ b/gn2/wqflask/oauth2/roles.py @@ -93,7 +93,12 @@ def create_role(): def __create_success__(*args): flash("Role created successfully.", "alert-success") return redirect(url_for("oauth2.role.user_roles")) - return oauth2_post( - "auth/group/role/create",data={ - "role_name": role_name, "privileges[]": privileges}).either( - __create_error__,__create_success__) + + raise DeprecationWarning( + f"The `{__name__}.create_role(…)` function, as is currently, can " + "lead to unbounded privilege escalation. See " + "https://issues.genenetwork.org/issues/gn-auth/problems-with-roles") + # return oauth2_post( + # "auth/group/role/create",data={ + # "role_name": role_name, "privileges[]": privileges}).either( + # __create_error__,__create_success__) |