CVE-2024-52805, CVE-2024-52815, CVE-2024-53863 Backport fixes from v1.120.1

Source: Fedora 40: matrix-synapse 2024-995720f767 Security Advisory Updates