Skip to content

[BUG] iOS app requests thumbnails for non-previewable file types, causing 404 bursts that trigger IDS bans #72

Closed

Description

@mariuniverse

Note: logs and reproduction steps are from my own instance. The write-up and
research were done with AI assistance.

Steps to reproduce

  1. Create a folder in a personal space containing several non-previewable files (e.g. ~8 PDF and DOCX files) plus one JPG.
  2. Open the folder in the web UI and observe the server access log — a preview is requested only for the JPG.
  3. Open the same folder in the iOS app and observe the server access log — a preview is requested for every file, and several files are requested twice.

Expected behavior

The iOS app should filter by mime type before requesting thumbnails, the way the web client does, and should not issue duplicate preview requests for the same file within a single folder load.

Actual behavior

The iOS app requests ?preview=1 for every file in the folder regardless of type. The thumbnails service cannot generate previews for PDF or DOCX, so each request returns HTTP 404 (documented behavior). Opening one folder of ~8 documents produces 12+ 404 responses within roughly 2 seconds.

This is enough to trip intrusion detection watching the reverse proxy. In my case CrowdSec's crowdsecurity/http-probing scenario fired on 11 events and issued a 7-day IP ban. Because the ban is enforced at the reverse proxy, it blocks every service behind that proxy, not just OpenCloud. Each subsequent app refresh re-triggers the ban immediately, so the app is effectively unusable from outside a whitelisted network.

Differences observed between the two clients against the same folder and server:

  web iOS
requested size x=36&y=36 x=180&y=180
processor parameter thumbnail absent
file types requested images only all types
duplicate requests no yes

Client

OpenCloud app version: 1.2.3

Server configuration

OpenCloud version: 7.4.0

Deployment: Docker Compose, external reverse proxy (Traefik), external OIDC provider (Authelia), default POSIX storage driver.

Logs

OpenCloud server error log

Web client — one preview request, image only:

GET /dav/spaces/<SPACE_ID>/<IMAGE>.jpg?scalingup=0&preview=1&a=1&processor=thumbnail&c=<HASH>&x=36&y=36 HTTP/2.0" 200 5183

No preview requests were issued for the PDF/DOCX files in the same folder listing.

iOS app — one preview request per file, all types, with duplicates:

GET /dav/spaces/<SPACE_ID>/<FILE_A>.docx?y=180&preview=1&scalingup=0&x=180&c=<HASH>&a=1 HTTP/2.0" 404 263
GET /dav/spaces/<SPACE_ID>/<FILE_B>.pdf?y=180&preview=1&scalingup=0&x=180&c=<HASH>&a=1 HTTP/2.0" 404 317
GET /dav/spaces/<SPACE_ID>/<FILE_C>.pdf?y=180&preview=1&scalingup=0&x=180&c=<HASH>&a=1 HTTP/2.0" 404 244
GET /dav/spaces/<SPACE_ID>/<FILE_A>.docx?y=180&preview=1&scalingup=0&x=180&c=<HASH>&a=1 HTTP/2.0" 404 263   <-- duplicate
GET /dav/spaces/<SPACE_ID>/<FILE_D>.pdf?y=180&preview=1&scalingup=0&x=180&c=<HASH>&a=1 HTTP/2.0" 404 271
GET /dav/spaces/<SPACE_ID>/<FILE_E>.docx?y=180&preview=1&scalingup=0&x=180&c=<HASH>&a=1 HTTP/2.0" 404 253
GET /dav/spaces/<SPACE_ID>/<FILE_B>.pdf?y=180&preview=1&scalingup=0&x=180&c=<HASH>&a=1 HTTP/2.0" 404 317   <-- duplicate
GET /dav/spaces/<SPACE_ID>/<FILE_F>.pdf?y=180&preview=1&scalingup=0&x=180&c=<HASH>&a=1 HTTP/2.0" 404 261
GET /dav/spaces/<SPACE_ID>/<FILE_G>.pdf?y=180&preview=1&scalingup=0&x=180&c=<HASH>&a=1 HTTP/2.0" 404 262
GET /dav/spaces/<SPACE_ID>/<FILE_H>.pdf?y=180&preview=1&scalingup=0&x=180&c=<HASH>&a=1 HTTP/2.0" 404 263
GET /dav/spaces/<SPACE_ID>/<FILE_I>.pdf?y=180&preview=1&scalingup=0&x=180&c=<HASH>&a=1 HTTP/2.0" 404 250
GET /dav/spaces/<SPACE_ID>/<FILE_J>.pdf?y=180&preview=1&scalingup=0&x=180&c=<HASH>&a=1 HTTP/2.0" 404 246

All within a ~2 second window. Domains, IPs, space IDs and filenames redacted.

Resulting CrowdSec decision:

| Source   | Scope:Value    | Reason                     | Action | Events | expiration |
| crowdsec | Ip:<REDACTED>  | crowdsecurity/http-probing | ban    | 11     | 167h59m    |

Related

Additional note

The server returning 404 for unsupported types is documented behavior, so the server side is arguably correct here and this looks like a client-side issue. Worth flagging separately, though: returning 404 for "no preview available" makes ordinary browsing indistinguishable from path probing at the proxy layer, which is what turns a cosmetic gap into a lockout. A 204 or an explicit "not previewable" response would avoid that for every client at once.

Activity

  1. self-assigned this
    on Aug 20, 2026
  2. guruz commented on Aug 20, 2026

    @guruz
    Collaborator

    Thank you, nice find.

    Web UI probably checks
    <oc:has-preview>1</oc:has-preview>

    Android PR on way opencloud-eu/android#217
    iOS will follow.

    with duplicates:

    Should be also fixed by checking the has-preview..

  3. guruz commented on Aug 26, 2026

    @guruz
    Collaborator

    . The thumbnails service cannot generate previews for PDF or DOCX, so each request returns HTTP 404 (documented behavior)

    BTW, opencloud-eu/reva#214 mentions libvips which can create PDF thumbnails maybe?
    There is a related issue: opencloud-eu/opencloud#1646 (comment)

    https://docs.opencloud.eu/docs/dev/server/services/thumbnails/information/#using-libvips-for-thumbnail-generation

  4. guruz commented on Sep 5, 2026

    @guruz
    Collaborator

    @mariuniverse Could you please try this with the 1.2.4, Build (5) (not 4!) testing build from Testflight? Please report back.
    https://testflight.apple.com/join/2F5wWTGV

  5. guruz commented on Sep 8, 2026

    @guruz
    Collaborator

    @mariuniverse Any news? thanks

  6. mariuniverse commented on Sep 8, 2026

    @mariuniverse
    Author

    @mariuniverse Any news? thanks

    Hello,

    Sorry, I haven't had time to test it yet — I'll try to get to it this week.

    In the meantime, I made a workaround for myself using the Nextcloud CrowdSec config and Claude to create exceptions for the app, like so:

    yaml
    expression:

    • evt.Meta.http_status == '404' && evt.Meta.http_verb == 'GET' && evt.Parsed.request contains '/dav/spaces/' && evt.Parsed.http_args contains 'preview=1'
    • evt.Meta.http_status == '404' && evt.Meta.http_verb == 'GET' && evt.Meta.http_path startsWith '/remote.php/dav/avatars/'

    This keeps the IDS from banning the mobile app. I'll still try to test the actual fix this week. Thanks!

  7. guruz commented on Sep 21, 2026

    @guruz
    Collaborator

    @mariuniverse Great you found a workaround.

    1.2.4 should fix the situation for file thumbnails..

    evt.Meta.http_status == '404' && evt.Meta.http_verb == 'GET' && evt.Meta.http_path startsWith '/remote.php/dav/avatars/'

    Was this one hit several times (= too often) too? Then this is a different bug than the file previews..

  8. moved this from In Progress to Needs Review in OpenCloud Team Boardon Oct 15, 2026
  9. guruz commented on Oct 15, 2026

    @guruz
    Collaborator

    I'll close this now as I don't think there is issues with avatars :)

    Still curious if you can reproduce the issue in latest version without crowdsec adjustments...

  10. moved this from Needs Review to Done in OpenCloud Team Boardon Oct 15, 2026
  11. closed this as completedby moving to Done in OpenCloud Team Boardon Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions