Secured images are public when revision is added in the url

Hi everyone,

My company and I have recently started using xWiki for a project where we need to ensure that information remains secure. We require a public URL for our setup. After evaluating various options, xWiki seemed to be the only platform that could keep attachments and images secure.

Our setup involves Docker, with NPM serving as a reverse proxy (including the CrowdSec agent and handler). We are using Keycloak as our authentication provider to enforce 2FA.

Everything appears to be functioning correctly, but we’ve encountered an issue with attachment security. For instance, when an image is added, it remains publicly accessible if the revision is included in the URL. Here’s what we’ve observed:

We’re unsure if this is a bug or if there’s a setting we might have missed to prevent this behavior. It seems related to the SSO session timeout in Keycloak, which is set to 30 minutes. However, if an image is uploaded and accessed from a private browser window or a different computer, there should be no active SSO session.

We would greatly appreciate any insights or guidance on this issue (Because I’m lost :slight_smile: ). Thank you in advance for your help!

I’m testing and thinking: Maybe the reason is NPM, I’m not sure if I enabled caching there. I have no access to NPM from where I am, so I’ll check at home.

If you suspect that you’ve found a security vulnerability, please don’t publish information about it but report it privately. Thank you very much for your cooperation and keeping everybody safe by following responsible disclosure practices!

Apart from that, if you have any kind of caching in front of XWiki, this could of course explain the observed behavior.

I’m sorry. That was naive of me.

I’ve done some more testing. It was caching in the reverse proxy. So problem solved!

Thanks for your reply and sorry again.