forbid requesting room directories or media of forbidden servers

This commit is contained in:
Jade Ellis 2025-01-18 15:40:43 +00:00
parent 371103fb35
commit 81a797945b
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2
4 changed files with 13 additions and 1 deletions

View file

@ -427,6 +427,10 @@ fn check_fetch_authorized(&self, mxc: &Mxc<'_>) -> Result<()> {
.config
.prevent_media_downloads_from
.contains(mxc.server_name)
|| self
.services
.moderation
.is_remote_server_forbidden(mxc.server_name)
{
// we'll lie to the client and say the blocked server's media was not found and
// log. the client has no way of telling anyways so this is a security bonus.