Skip to content
DoS Disclosed report Intermediate CVE-2022-24741

High memory usage for generating preview of broken image

A crafted image file causes the PHP process to allocate excessive memory and CPU when a preview is generated. An attacker could upload many such files to cause a denial of service.

fancycode Follow

Originally disclosed on HackerOne

  • Triaged in 4 hours
  • Fixed in 8 months
  • Paid in 8 months
  • Disclosed after 8 months

When the attached file is uploaded and a preview is generated (e.g. in the folder overview of the files app), the PHP process allocates a very large amount of memory (on my machine it was shortly around 5 GByte) and CPU.

Tested with latest master (1366b35081f1d92429787696f4175c19a602858a) on Ubuntu 20.04 (php7.4-fpm). Option "memory_limit" is set to 512M.

Impact

An attacker can cause a denial of service by uploading lots of such files which will cause the server to allocate too much memory / CPU.

Attachments

The original report as published on HackerOne, by fancycode. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the image preview generation code does not properly limit resources when handling malformed or specially crafted image files.

What the attacker needed

Ability to upload files; preview generation enabled

How it was found

  1. Upload the attached file.
  2. Trigger preview generation, for example by opening the folder overview in the files app.
  3. Observe the PHP process using a very large amount of memory and CPU.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When you upload a file, the server often creates a small preview image. A specially made file can make that preview step use a huge amount of memory and processing power. If someone uploads many of these files, the server can become overloaded and stop working for normal users.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by fancycode

View all

1 more disclosed report, best first.

More from Nextcloud

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.