Skip to content

[Bug]: F-33 An uploaded SVG favicon is served as application/octet-stream, the web app manifest icon fails #65089

Description

@nicolassp

⚠️ This issue respects the following points: ⚠️

  • This is not a troubleshooting question, general support matter, or webserver/proxy problem, but likely a bug (if unsure, ask the Community Help Forum).
  • This issue is not already reported on Github OR solved at the Community Help Forum (I've searched!).
  • I'm using a maintained major version of Nextcloud Server and tested against the latest patch level. (Supported major versions and current patch levels).
  • I agree to follow Nextcloud's Code of Conduct.
  • I've tried my best to provide clear reproduction steps that someone unfamiliar with this bug could use to reproduce it.

Bug description

F-33 · An uploaded SVG favicon is served as application/octet-stream, the web app manifest icon fails

Repository nextcloud/server
Severity Low (PWA install and home screen icons broken, console error on every page)
Component apps/theming/lib/Controller/IconController.php (getTouchIcon(), getFavicon()), ThemingController::getManifest()
Affects 35.0.1 (production instance with an SVG favicon uploaded in Theming)
Verified Chrome DevTools on a production instance; unit tests

What happens

Chrome logs on every page:

Error while trying to use the following icon from the Manifest:
https://<host>/apps/theming/icon/files?v=29 (Download error or resource isn't a valid image)

The response of /apps/theming/icon/files is 200 with Content-Type: application/octet-stream.

Cause

The uploaded original is stored in app data without an extension (images/favicon). Its filecache
MIME type is therefore application/octet-stream. ThemingController::getImage() already handles
this and sends the MIME type stored at upload time (faviconMime), with a comment that explains it.
IconController does not:

  • getTouchIcon() sends $iconFile->getMimeType(), which is application/octet-stream for the
    original. It also asks for the image with $useSvg = true, so it never gets the PNG rendering of
    an SVG favicon, even when Imagick can produce one.
  • getFavicon() sends image/x-icon for any uploaded favicon, also for SVG and PNG uploads.
  • The manifest declares the touch icon as image/png, 512x512, and the favicon as
    image/svg+xml, 16x16. With an uploaded SVG favicon and no SVG support in Imagick, both URLs
    return the SVG.

Browsers do not sniff SVG, so an SVG sent as application/octet-stream is rejected.

Steps to reproduce

Steps to reproduce

  1. Theming → upload an SVG as favicon. Imagick without SVG support (the default nextcloud:fpm image) shows it best.
  2. Open any page with DevTools → Console, or open /apps/theming/icon/core and check the Content-Type.

Expected behavior

Fix

  • getTouchIcon() asks for the PNG rendering (getImage('favicon', false)), like getFavicon().
  • Both send the stored MIME type for the original and getMimeType() for converted files, the same
    rule as ThemingController::getImage(). Fallbacks: image/png and image/x-icon.
  • The manifest declares image/svg+xml with sizes: any when an SVG favicon is served as SVG, and
    the real type of an uploaded raster favicon.
  • Tests for an SVG original in both actions and for the manifest; openapi.json regenerated
    (getFavicon can now return other image types).

Nextcloud Server version

35

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

No response

Activity

  1. added theissue type on Oct 3, 2026
  2. added
    0. Needs triage
    on Oct 3, 2026
  3. susnux commented on Dec 3, 2026

    @susnux
    Contributor

    Confirmed on current master; a fix is proposed in #66822.

  4. added
    2. developing
    and removed
    0. Needs triage
    on Dec 3, 2026
  5. moved this from To triage to In progress in 🧑‍🤝‍🧑 Server Community triageon Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions