Skip to main content

News

Upload2Shell: How a file upload becomes remote code execution

Upload2Shell targets file processing after an upload. Check Ghostscript in WordPress, Roundcube and preview workers, identify the right patch and verify deployment.

Stock photo: a person working with documents beside a laptop.
Stock photo Photo Kelly Sikkema Unsplash License Image credit
Original title
Person reviewing documents with calculator and laptop
Photographer
Kelly Sikkema
Source
Unsplash
Julian Köhn
|Read time: 5 minutes

A portal accepts a file and automatically generates a preview. That everyday step can give an attacker access to the server. Security researcher Paulos Yibelo has published several Ghostscript attack paths under the name Upload2Shell, including tests involving WordPress, Roundcube and the CUPS printing system.

CVE-2026-125396 affects a component that operators may barely notice behind their application. Checking only the CMS version can leave a vulnerable preview worker untouched. Fixing this requires knowing which software actually processes the uploaded file.

What happens after the upload

Ghostscript processes formats including PostScript and PDF. Applications can invoke it through ImageMagick to generate a thumbnail. Ghostscript then reads the file contents before an employee even opens the document.

Yibelo's technical analysis describes a use-after-free in the Type 1 font loader. The flaw allows an attacker to bypass Ghostscript's internal -dSAFER protection and execute code with the processing account's permissions. This remote code execution, or RCE, provides access within the worker's permissions.

The attack reaches the preview worker. · © 2026 Kopexa GmbH

For your own risk assessment, examine the worker's service account. Can it access customer documents? Does it hold credentials for other services? Can it connect to the internal network? These permissions help determine how far a successful attack could reach.

Which applications may be exposed

The published tests have different prerequisites. Having an application installed does not, by itself, establish an exploitable upload path.

ApplicationRelevant path in the test
WordPress CoreAn account with upload_files uploads a crafted file. The server must use Imagick and Ghostscript.
RoundcubeAn external sender delivers a crafted attachment. In the tested configuration, viewing the message triggers thumbnail processing with the Ghostscript delegate permitted.
CUPSAn unauthenticated Print-Job to a shared queue reaches Ghostscript. The demonstrated code runs as the printing service account.

The WordPress project's security advisory also specifies its Core prerequisites. By default, Author accounts and higher roles have the upload_files capability. Public plugin forms need a separate assessment.

For custom applications, I would start where outside files are processed automatically: recruitment portals, invoice intake and document workers. These are useful places to investigate, not a claim that every such service uses Ghostscript.

The patch exists. Check the package for your distribution.

The fixed upstream release, Ghostscript 10.08.0, appeared on 8 September 2026. Distributions also ship backports on older version lines. A simple "below 10.08.0 means vulnerable" comparison can therefore produce the wrong result.

The following fix versions were checked on 22 November 2026. Install the current security updates for your supported release line.

ComponentFixed version
Ghostscript upstream10.08.0
Debian 12, Bookworm Security10.0.0~dfsg-11+deb12u9
Debian 13, TrixieCurrently 10.05.1~dfsg-1+deb13u3; first fixed in deb13u2
Ubuntu 24.04 LTSlibgs10 from 10.02.1~dfsg1-0ubuntu7.10

The Debian Security Tracker now lists Bookworm Security as fixed. Ubuntu's USN-8949-1 lists packages by release, including older LTS versions. Check the Ghostscript library in use, as well as the package named ghostscript.

Applications need updating too. WordPress closed its reported attack path in releases including 7.0.4, 6.9.7 and 6.8.8. These are the original fix releases, not today's preferred WordPress version. Roundcube corrected unsafe input handling during image resizing in 1.6.20 and 1.7.5. Further security updates are available in 1.6.21 and 1.7.6.

Check the running worker, not just the host

In a container deployment, the host may already be up to date while an old image continues processing files. Run your inventory check in the environment that actually executes the preview job. On Debian and Ubuntu, these read-only commands provide a starting point:

gs --version
dpkg-query -W ghostscript 'libgs*'

The first command reports the version of the binary it invokes. The second reports package versions including distribution revisions. If gs is missing, still check whether the application loads Ghostscript as a library or invokes a different binary. Custom builds require build records instead of package manager output.

After updating a container, include the new image digest in your check. Confirm that all affected workers run that version. Then use a harmless sample file to check that uploads and previews still work. This functional check complements the version evidence; it is not an exploit test.

If an agency or hosting provider operates the service, agree this confirmation when assigning the work. Our article about a different WordPress vulnerability explains how to confirm update completion with the operator.

If you cannot update immediately

Temporarily restrict the exposed processing step, such as automatic previews of outside documents. The business team responsible should help decide whether the portal can operate that way. Invoice intake may need an agreed alternative process.

ImageMagick's security policy can restrict external delegates and formats. Check the active policy in the worker's context. A global block can disable required PDF functionality, so test the change.

For ongoing operation, the OWASP File Upload Cheat Sheet recommends layered protection, including allowed file types, content validation and restricted permissions. File extensions and client-supplied Content-Type headers are insufficient on their own. Give the renderer only the data, secrets and network access it needs for its job.

How we would handle this at Kopexa

For a company running several portals, a complete work request saves time. It identifies the service processing the files, its operator and the deadline for deploying the fix. Without that ownership, the alert passes between IT, the agency and the hosting provider while the worker keeps running.

Your asset inventory should identify the operator responsible for the affected service. The remediation task should hold the verified package or build version, deployment details and functional test result. If a team must postpone the patch, the exception needs an owner, an expiry date and an agreed protective measure.

The person responsible can then close the task with concrete evidence. "Update installed" is an inadequate response if nobody has checked which worker will process the next customer file.

Sources

  1. pwn.ai: Upload2Shell, confirmed attack paths and prerequisites [Accessed ]
  2. Paulos Yibelo: Upload2Shell technical analysis [Accessed ]
  3. Ghostscript: Releases, version 10.08.0 of 8 September 2026 [Accessed ]
  4. Debian Security Tracker: CVE-2026-125396 [Accessed ]
  5. Ubuntu: Ghostscript vulnerability, USN-8949-1 [Accessed ]
  6. WordPress: RCE via Imagick/Ghostscript, GHSA-8vr3-7mxf-gx8w [Accessed ]
  7. Roundcube: Security updates 1.6.20 and 1.7.5 [Accessed ]
  8. Roundcube: Security updates 1.6.21 and 1.7.6 [Accessed ]
  9. ImageMagick: Security Policy [Accessed ]
  10. OWASP: File Upload Cheat Sheet [Accessed ]