I wrote a little blogpost on how you can mitigate the recent Pleroma vulnerabilities if you're using nginx:

https://webb.spiderden.org/2023/05/26/pleroma-mitigation/

@w Nice guide!
I only have one question: why reconfigure Pleroma to use the subdomain for uploads if I set up a redirect anyway? When permanent fix arrives I can just get rid of the subdomain, but if I reconfigure Pleroma, URLs in new posts would have the subdomain in them so I would have to keep it up (and its cert) forever so the links to images don't become broken.

@m0xee Because the issue is the resource itself being fetched on the root domain.
Follow

@w No, I get it, but if redirect fixes it for old posts, why won't it do the trick for new ones? Why is it necessary for newer post to contain direct links to media.my.domain, not the usual https://my.domain/media, that get redirected to media.my.domain?
Is it assumed that older posts don't contain the malicious script, but newer ones might? Is redirect treated differently from XSS perspective?

@w Ugh! Link parser ate the https://, but I think you get the idea 😅

@m0xee The reason you do this is for performance. When you do the direct it does two requests each time if you don't change it. Also some instance/client software might not follow the redirect.

@w I see, makes sense. But if it's a temporary fix, slight performance hit isn't that bad. I still hope that a more permanent fix arrives soon 😅
Hosting media on a separate domain might still make sense, but having that extra cert to worry about bugs me.

@w
BTW is there a reason behind media files being served by Pleroma itself, not handled statically by nginx. In my (most simple) configuration uploads are just a directory on the same host, I can just point nginx there to serve them. Are there other reasons it's done that way which I just don't see, besides other uploaders existing and media being hosted in the cloud in more complex configurations ?

@m0xee @w does pleroma control access to the media? I know some servers (spc included) require login to browse directly. S2s requests are authenticated so it could just be to allow an admin to prevent unauthenticated access

@thatguyoverthere Oh, yes, makes sense. It's not like that in my configuration, I just copied the link to an image and retrieved it with curl that doesn't have any session cookies, it worked. But you're right, in more complex configurations there might be some access control involved.
@w

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml