-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Synapse doesn't limit data/time for http previews #8302
Comments
Looks like we only time out fetching response headers, not reading the body |
I can confirm, this issue still exists on Synapse/1.44.0 |
A side effect of this issue is that files and folders in the |
as a workaround, i have a nginx frontend in front of my icecast and adedd the following discussion to block synapse clients from hogging the feeds:
|
I guess another work around is to disable url previews completelly in url_preview_enabled: False |
Should be fixed by #11784. |
Shouldn't this DoS be considered as a security issue? |
This implements an allow list for content types for which Synapse will attempt URL preview. If a URL resolves to a resource with a content type which isn't in the list, the download will terminate immediately. This makes sense given that Synapse would never successfully generate a URL preview for such files in the first place, and helps prevent issues with streaming media servers, such as #8302. Signed-off-by: Denis Kasak dkasak@termina.org.uk
for what it's worth, that didn't actually work at all and a proper workaround is:
i'll note that I still see Synapse clients on my streams, latest of which being |
Description
I have an Icecast stream running and a while back decided to send a link to it to someone over Matrix. A couple of days later I check the admin panel and noticed the following:
It seems that, while attempting to make the preview for the url, synapse started listening to the stream and it never stopped, because the stream never ends. Now this is a very specific case which could be solved by me properly disallowing preview fetching on my home network, but imagine if there were other homeservers in that room.
This points to the fact that synapse doesn't properly limit itself when trying to generate http previews, causing it to keep busy forever. In fact, this seems to happen multiple times as at the time of writing there are 3 synapse clients listening to the stream.
Steps to reproduce
Expected Behaviour
It would probably be best if Synapse kills the "thread" when it notices it can't make the preview/it takes too long. Looking at the logs, it seems Synapse does notice that the stream is too large, but it still keeps listening:
Version information
Version: 1.19.1
Install method: debian package
The text was updated successfully, but these errors were encountered: