mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix: secure access to comment edits to user who owns the comment
Found along with the previous commit to be a security hole in our implementation. This commit resolves an issue regarding comment editing. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
7a52da5587
commit
15d016eb70
2 changed files with 18 additions and 0 deletions
|
@ -286,6 +286,8 @@ async def pkgbase_comment_post(
|
|||
|
||||
if not comment:
|
||||
raise HTTPException(status_code=HTTPStatus.BAD_REQUEST)
|
||||
elif request.user.ID != db_comment.UsersID:
|
||||
raise HTTPException(status_code=HTTPStatus.UNAUTHORIZED)
|
||||
|
||||
# If the provided comment is different than the record's version,
|
||||
# update the db record.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue