CVE-2024-32871: Pimcore/pimcore Flooding Server With Thumbnail Files Vulnerability

HIGH
Advisory Identifier: GHSA-277c-5vvj-9pwx
CVSS 7.5
CWE-770
Published
Advisory Summary

CVE-2024-32871 is a HIGH (CVSS 7.5) flooding server with thumbnail files vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Pimcore/pimcore libraries in the Packagist ecosystem. The issue involves flooding server with thumbnail files. Remediation is available by upgrading affected packages to version 11.2.4.

CVE-2024-32871 at a Glance

CVE Identifier CVE-2024-32871
GHSA Identifier GHSA-277c-5vvj-9pwx
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product Pimcore/pimcore
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2024-32871

To remediate this vulnerability, upgrade all affected Pimcore/pimcore dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pimcore/pimcore fixed: 11.2.4
Upgrade pimcore/pimcore to 11.2.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for pimcore/pimcore

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-32871, inspect your project dependencies for Pimcore/pimcore:

inspect dependencies for pimcore/pimcore

Analyze the terminal output to locate any version of Pimcore/pimcore in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 11.2.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In Pimcore/pimcore, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

# Details ## 1. All Imagick supported Fileformats are served without filtering The Thumbnail endpoint does not check against any filters what file formats should be served. We can transcode the image in all formats imagemagick supports. With that we can create Files that are much larger in filesize than the original. For example we can create a .txt file for all thumbnails, and we get the text representation of the image. We can demonstrate that with the pimcore demo: This Thumbnail is found on the Frontend: https://demo.pimcore.fun/Sample%20Content/Background%20Images/317/image-thumb__317__standardTeaser/11.8c64bd89.avif (12kb Filesize) We can generate a text representation by simply changing the file extension: https://demo.pimcore.fun/Sample%20Content/Background%20Images/317/image-thumb__317__standardTeaser/11.8c64bd89.txt (4.59mb Filesize) Other (large) fileformats we tested: ftxt, dip, bmp, bmp3, bmp2, farbfeld, cmyk, cmyka, ycbcr, ycbcra and many more (just check imagemagick supported formats) With that we can fill the available space of a server really easy. With formats like yaml or json we can also expose exif data of the original image file - could be a concern with gps data in user uploaded images. ### TLDR - we can generate all imagemagick supported formats with all thumbnail configs - all configs were the format is set to "auto (Web-optimized)" are vulnerable - private (exif) data can be exposed. - We can flood the the server with a bunch of files that are a multiple magnitudes of the original thumbnail size (see txt example), for all thumbnail configs, with every image that we find (scriptable) ### Proposed Solution Implement a list of allowed formats that the developer can modify if needed, if a file is requested in another format than listed, pimcore should return either "/bundles/pimcoreadmin/img/filetype-not-supported.svg" or a 404. ```yaml pimcore: thumbnails: allowed_formats: ['jpg', 'png', 'avif', 'webp', 'gif'] ``` For non-maintained Pimcore versions (<11), the webserver config could be used to only serve files that should be allowed. ## 2. Non Web optimized file formats (ORIGINAL, JPG, PNG) creates duplicated files on Server With Thumbnail config that are configured to serve non web optimized file formats (such as ORIGINAL, jpg, png, print, etc) we can create files with arbitrary file formats that are saved to disk. For example, the thumbnail configuration "print_backgroundimage" (in the pimcore demo) can be used to create files such as: https://demo.pimcore.fun/Car%20Images/jaguar/3/image-thumb__3__print_backgroundimage/auto-3095119.aaa https://demo.pimcore.fun/Car%20Images/jaguar/3/image-thumb__3__print_backgroundimage/auto-3095119.aab https://demo.pimcore.fun/Car%20Images/jaguar/3/image-thumb__3__print_backgroundimage/auto-3095119.aac Each request creates a new copy of the original (jpg) thumbnail file. The server can be flooded with a bunch of files. Code for this mechanism is here: https://github.com/pimcore/pimcore/blob/11.x/models/Asset/Service.php#L621-L623 ### Proposed Solution Use same filtered list from "All Imagick supported Fileformats are served without filtering" and do not copy the arbitrary file to disk, just serve the original image file under the "new" name. ## 3. Scaling Factor is not limited and can be modified via url We can scale each thumbnail to an arbitrary factor with @<float>x added to the request url. For example: https://demo.pimcore.fun/Sample%20Content/Background%20Images/317/image-thumb__317__standardTeaser/11.8c64bd89@1x.avif https://demo.pimcore.fun/Sample%20Content/Background%20Images/317/image-thumb__317__standardTeaser/11.8c64bd89@1.01x.avif https://demo.pimcore.fun/Sample%20Content/Background%20Images/317/image-thumb__317__standardTeaser/11.8c64bd89@1.08x.avif https://demo.pimcore.fun/Sample%20Content/Background%20Images/317/image-thumb__317__standardTeaser/11.8c64bd89@2x.avif If the thumbnail config allows "forced" resizing, we could also do something like: https://demo.pimcore.fun/Sample%20Content/Background%20Images/317/image-thumb__317__standardTeaser/11.8c64bd89@192x.avif Each request will create a new file, flooding the server with more files. If the factor is big enough, we can also max out the CPU with a single request for quite some time (only really a problem with "forced") In combination with the first vulnerability we can also generate (large) text files for scaled images: https://demo.pimcore.fun/Sample%20Content/Background%20Images/317/image-thumb__317__standardTeaser/11.8c64bd89@4x.txt (6.6 mb filesize) ### Proposed solution Limit scale factors with an allowlist: ```yaml pimcore: thumbnails: allowed_scale_factors: [1.25, 1.5, 2, 4] ``` # Impact All Pimcore Instances are affected, as far as we can see, also all versions

CVE-2024-32871 Affected Pimcore/pimcore Versions

1 component(s)
Fixed Versions:
11.2.4
Product / Package Ecosystem Affected Versions Fixed Version
pimcore/pimcore
Packagist
≥ 11.0.0
< 11.2.4
11.2.4

References

Frequently Asked Questions

What is CVE-2024-32871?
CVE-2024-32871 is a security vulnerability in Pimcore/pimcore involving Flooding Server with Thumbnail files under CWE-770: Allocation of Resources Without Limits or Throttling.
Which Pimcore/pimcore versions are affected?
Affected versions include releases prior to 11.2.4 across affected packages: pimcore/pimcore.
What version fixes CVE-2024-32871?
Upgrading to 11.2.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pimcore/pimcore affected?
Yes, pimcore/pimcore is affected in releases prior to 11.2.4. Upgrade your dependency to 11.2.4 or later.
What is the CVSS score of CVE-2024-32871?
CVE-2024-32871 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2024-32871?
CVE-2024-32871 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check Packagist dependencies for CVE-2024-32871?
Run the dependency tree command: 'inspect dependencies for pimcore/pimcore'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-277c-5vvj-9pwx",
  "modified" : "2024-06-04T17:18:22Z",
  "published" : "2024-06-04T17:18:22Z",
  "aliases" : [ "CVE-2024-32871" ],
  "summary" : "Flooding Server with Thumbnail files",
  "details" : "# Details\n## 1. All Imagick supported Fileformats are served without filtering\n\nThe Thumbnail endpoint does not check against any filters what file formats should be served. We can transcode the image in all formats imagemagick supports. With that we can create Files that are much larger in filesize than the original. For example we can create a .txt file for all thumbnails, and we get the text representation of the image.\n\nWe can demonstrate that with the pimcore demo: \n\nThis Thumbnail is found on the Frontend: https://demo.pimcore.fun/Sample%20Content/Background%20Images/317/image-thumb__317__standardTeaser/11.8c64bd89.avif (12kb Filesize)\n\nWe can generate a text representation by simply changing the file extension: https://demo.pimcore.fun/Sample%20Content/Background%20Images/317/image-thumb__317__standardTeaser/11.8c64bd89.txt (4.59mb Filesize)\n\nOther (large) fileformats we tested: ftxt, dip, bmp, bmp3, bmp2, farbfeld, cmyk, cmyka, ycbcr, ycbcra and many more (just check imagemagick supported formats)\n\nWith that we can fill the available space of a server really easy.\n\nWith formats like yaml or json we can also expose exif data of the original image file - could be a concern with gps data in user uploaded images.\n\n### TLDR\n\n- we can generate all imagemagick supported formats with all thumbnail configs\n- all configs were the format is set to \"auto (Web-optimized)\" are vulnerable\n- private (exif) data can be exposed.\n- We can flood the the server with a bunch of files that are a multiple magnitudes of the original thumbnail size (see txt example), for all thumbnail configs, with every image that we find (scriptable)\n\n### Proposed Solution\n\nImplement a list of allowed formats that the developer can modify if needed, if a file is requested in another format than listed, pimcore should return either \"/bundles/pimcoreadmin/img/filetype-not-supported.svg\" or a 404.\n\n```yaml\npimcore:\n    thumbnails:\n    \tallowed_formats: ['jpg', 'png', 'avif', 'webp', 'gif']\n```\n\nFor non-maintained Pimcore versions (<11), the webserver config could be used to only serve files that should be allowed. \n\n## 2. Non Web optimized file formats (ORIGINAL, JPG, PNG)  creates duplicated files on Server\n\nWith Thumbnail config that are configured to serve non web optimized file formats (such as ORIGINAL, jpg, png, print, etc) we can create files with arbitrary file formats that are saved to disk.\n\nFor example, the thumbnail configuration \"print_backgroundimage\" (in the pimcore demo) can be used to create files such as: \n\nhttps://demo.pimcore.fun/Car%20Images/jaguar/3/image-thumb__3__print_backgroundimage/auto-3095119.aaa\nhttps://demo.pimcore.fun/Car%20Images/jaguar/3/image-thumb__3__print_backgroundimage/auto-3095119.aab\nhttps://demo.pimcore.fun/Car%20Images/jaguar/3/image-thumb__3__print_backgroundimage/auto-3095119.aac \n\nEach request creates a new copy of the original (jpg) thumbnail file. The server can be flooded with a bunch of files.\n\nCode for this mechanism is here: https://github.com/pimcore/pimcore/blob/11.x/models/Asset/Service.php#L621-L623\n\n### Proposed Solution\n\nUse same filtered list from \"All Imagick supported Fileformats are served without filtering\" and do not copy the arbitrary file to disk, just serve the original image file under the \"new\" name.\n\n## 3. Scaling Factor is not limited and can be modified via url\n\nWe can scale each thumbnail to an arbitrary factor with @<float>x added to the request url.\n\nFor example: \n\nhttps://demo.pimcore.fun/Sample%20Content/Background%20Images/317/image-thumb__317__standardTeaser/11.8c64bd89@1x.avif\nhttps://demo.pimcore.fun/Sample%20Content/Background%20Images/317/image-thumb__317__standardTeaser/11.8c64bd89@1.01x.avif\nhttps://demo.pimcore.fun/Sample%20Content/Background%20Images/317/image-thumb__317__standardTeaser/11.8c64bd89@1.08x.avif\nhttps://demo.pimcore.fun/Sample%20Content/Background%20Images/317/image-thumb__317__standardTeaser/11.8c64bd89@2x.avif\n\nIf the thumbnail config allows \"forced\" resizing, we could also do something like:\n\nhttps://demo.pimcore.fun/Sample%20Content/Background%20Images/317/image-thumb__317__standardTeaser/11.8c64bd89@192x.avif  \n\nEach request will create a new file, flooding the server with more files.\nIf the factor is big enough, we can also max out the CPU with a single request for quite some time (only really a problem with \"forced\")\n\nIn combination with the first vulnerability we can also generate (large) text files for scaled images:\n\nhttps://demo.pimcore.fun/Sample%20Content/Background%20Images/317/image-thumb__317__standardTeaser/11.8c64bd89@4x.txt (6.6 mb filesize)\n\n### Proposed solution\n\nLimit scale factors with an allowlist:\n\n```yaml\npimcore:\n    thumbnails:\n    \tallowed_scale_factors: [1.25, 1.5, 2, 4]\n```\n\n\n# Impact\nAll Pimcore Instances are affected, as far as we can see, also all versions",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "pimcore/pimcore"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.0.0"
      }, {
        "fixed" : "11.2.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pimcore/pimcore/security/advisories/GHSA-277c-5vvj-9pwx"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-32871"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pimcore/pimcore/commit/38af70b3130f16fc27f2aea34e2943d7bdaaba06"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pimcore/pimcore/commit/a6821a16ea38086bf6012e682e1743488244bd85"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pimcore/pimcore"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-04T17:18:22Z",
    "nvd_published_at" : "2024-06-04T15:15:45Z"
  }
}