diff options
author | ryexandra <68085235+ryexandra@users.noreply.github.com> | 2020-07-14 07:17:25 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-14 09:17:25 -0400 |
commit | 29037b49952dd95a08639b27b08c8a8e68a13026 (patch) | |
tree | eed2656e786b389aa599667df496632421ad91bd /server/src/apub/fetcher.rs | |
parent | 52983907c4d1b7fda1182316cb631f9b5e913f5b (diff) |
Security/fix permission bugs (#966)
* secure the `EditPost` API endpoint
* Check user is moderator in BanFromCommunity
* secure the `EditComment` API endpoint
* pass orig `read` prob when not explicitly updating it.
* Block random users from adding mods.
* use cleaner logic from `EditPost`
* prevent editing a community by a mod from transfering ownership to them
* secure `read` action in `EditPrivateMessage`
* Add check in UserMention
* only let the indended recipient mark as read
* simplify booleans to satisfy clippy
* requested changes + cargo +nightly fmt
* fix to pass federation tests for deleting comments and posts
Co-authored-by: chiminh <chiminh.tutanota.com>
Co-authored-by: Hex Bear <buildadangtrain@protonmail.com>
Diffstat (limited to 'server/src/apub/fetcher.rs')
-rw-r--r-- | server/src/apub/fetcher.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/src/apub/fetcher.rs b/server/src/apub/fetcher.rs index 4251cb76..f20c9eab 100644 --- a/server/src/apub/fetcher.rs +++ b/server/src/apub/fetcher.rs @@ -4,7 +4,8 @@ use crate::{ blocking, request::{retry, RecvError}, routes::nodeinfo::{NodeInfo, NodeInfoWellKnown}, - DbPool, LemmyError, + DbPool, + LemmyError, }; use activitystreams::object::Note; use activitystreams_new::{base::BaseExt, prelude::*, primitives::XsdAnyUri}; @@ -21,7 +22,9 @@ use lemmy_db::{ post_view::PostView, user::{UserForm, User_}, user_view::UserView, - Crud, Joinable, SearchType, + Crud, + Joinable, + SearchType, }; use lemmy_utils::get_apub_protocol_string; use log::debug; |