Ghostscript showing 100% CPU utilization

Re: Ghostscript showing 100% CPU utilization

Markus Gschwendt -
回帖数:0

We just found this by running some tests with a pdf document 8MB, >2000 pages. https://examplefile.com/document/pdf/8-mb-pdf

On my test machine (AMD Epyc 2, VM with 4 core, 4GB) GS occupies one cpu core per pdf and on >2000 pages it runs for ~20 minutes.

It seems It would be easy to attack a moodle server with such a document. Users are not patient and cancel/restart the conversion again and again until all cores are in use and the machine is unuseable for that time. The GS process will not be cancelled by a cancel action in moodle.

A solution would be a setting for restricting the number of pages a student can upload in one document. This could be checked after the upload and before the document is accepted for storage.