---
title: "The JPEG That Is Also a Web Shell: How a Picture Can Carry Code"
description: A real photo passes upload checks with a script hidden after its image data. If the server runs it, the attacker can send it commands.
image: https://explore.bowbridge.net/hubfs/Blog/File%20Security%20101/Headers/File%20Security%20101%20-%20Blog%20Header.jpeg
---

[customer login](https://www.bowbridge.net/customer-portal/) english deutsch

[![bowbridge](https://explore.bowbridge.net/hubfs/logos/bowbridge_logo.svg "bowbridge")](https://www.bowbridge.net/en/)

- [Solutions](https://www.bowbridge.net/en/sap-cybersecurity-solutions/) 
    - [Anti-Virus - Cloud](https://www.bowbridge.net/en/anti-virus-cloud-for-sap-solutions/)
    - [Anti-Virus for SAP Solutions](https://www.bowbridge.net/en/anti-virus-for-sap-solutions/)
    - [Application Security for SAP Solutions](https://www.bowbridge.net/en/application-security-for-sap-solutions/)
- [Resources](https://www.bowbridge.net/en/sap-cybersecurity-resources/) 
    - [Blog](https://explore.bowbridge.net/blog)
    - [Protecting SAP Applications from Content-Based Attacks](https://www.bowbridge.net/en/guide-to-content-based-attacks-sap-applications/)
    - [Intro to FIORI Cybersecurity](https://www.bowbridge.net/en/guide-to-sap-fiori-cybersecurity/)
    - [Case Studies](https://www.bowbridge.net/en/sap-cybersecurity-resources/#casestudies)
    - [White Papers](https://www.bowbridge.net/en/sap-cybersecurity-resources/#wp)
    - [Webinars](https://www.bowbridge.net/en/sap-cybersecurity-resources/#webinars)
    - [Partner Resources](https://www.bowbridge.net/en/bowbridge-partner-resources/)
- [About](https://www.bowbridge.net/en/about-bowbridge-software/) 
    - [Company Profile](https://www.bowbridge.net/en/company-profile/)
    - [Customers](https://www.bowbridge.net/en/customers/)
    - [News](https://explore.bowbridge.net/news)
    - [Careers](https://www.bowbridge.net/en/careers/)
- [Support](https://www.bowbridge.net/en/sap-cybersecurity-support/) 
    - [Software Downloads](https://www.bowbridge.net/en/bowbridge-downloads/)
    - [Documentation](https://www.bowbridge.net/en/bowbridge-documentation/)
    - [Support Videos](https://www.bowbridge.net/en/bowbridge-support-videos/)
    - [Contact Technical Support](https://www.bowbridge.net/en/sap-cybersecurity-support/#form)
- [Contact](https://www.bowbridge.net/en/contact-bowbridge/)

- [DE](https://www.bowbridge.net/de/)
- [EN](https://www.bowbridge.net/en/news.html)

- [Solutions](https://www.bowbridge.net/en/sap-cybersecurity-solutions/) 
    - [Anti-Virus - Cloud](https://www.bowbridge.net/en/anti-virus-cloud-for-sap-solutions/)
    - [Anti-Virus for SAP Solutions](https://www.bowbridge.net/en/anti-virus-for-sap-solutions/)
    - [Application Security for SAP Solutions](https://www.bowbridge.net/en/application-security-for-sap-solutions/)
- [Resources](https://www.bowbridge.net/en/sap-cybersecurity-resources/) 
    - [Blog](https://explore.bowbridge.net/blog)
    - [Protecting SAP Applications from Content-Based Attacks](https://www.bowbridge.net/en/guide-to-content-based-attacks-sap-applications/)
    - [Intro to FIORI Cybersecurity](https://www.bowbridge.net/en/guide-to-sap-fiori-cybersecurity/)
    - [Case Studies](https://www.bowbridge.net/en/sap-cybersecurity-resources/#casestudies)
    - [White Papers](https://www.bowbridge.net/en/sap-cybersecurity-resources/#wp)
    - [Webinars](https://www.bowbridge.net/en/sap-cybersecurity-resources/#webinars)
    - [Partner Resources](https://www.bowbridge.net/en/bowbridge-partner-resources/)
- [About](https://www.bowbridge.net/en/about-bowbridge-software/) 
    - [Company Profile](https://www.bowbridge.net/en/company-profile/)
    - [Customers](https://www.bowbridge.net/en/customers/)
    - [News](https://explore.bowbridge.net/news)
    - [Careers](https://www.bowbridge.net/en/careers/)
- [Support](https://www.bowbridge.net/en/sap-cybersecurity-support/) 
    - [Software Downloads](https://www.bowbridge.net/en/bowbridge-downloads/)
    - [Documentation](https://www.bowbridge.net/en/bowbridge-documentation/)
    - [Support Videos](https://www.bowbridge.net/en/bowbridge-support-videos/)
    - [Contact Technical Support](https://www.bowbridge.net/en/sap-cybersecurity-support/#form)
- [Contact](https://www.bowbridge.net/en/contact-bowbridge/)

![File Security 101 – Threats Beyond Malware](https://explore.bowbridge.net/hs-fs/hubfs/Blog/File%20Security%20101/Headers/File%20Security%20101%20-%20Blog%20Header.jpeg?width=1800&height=500&name=File%20Security%20101%20-%20Blog%20Header.jpeg)

# The JPEG That Is Also a Web Shell: How a Picture Can Carry Code

Dec 4, 2026, 11:41:11 AM by Joerg Schneider-Simon

A file can be a valid picture and carry something else at the same time. An image can display normally and pass a basic file-type check even when it contains extra data. This is episode 19 of File Security 101, our series on file-based threats your anti-malware does not see.

<iframe class="hs-responsive-embed-iframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" title="File Security 101 – Ep 19 – The JPEG That Is Also a Web Shell – How it works" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" xml="lang" src="https://www.youtube.com/embed/RtmIdnknvrQ?rel=0" width="560" height="315" allowfullscreen data-service="youtube"></iframe>

The video explains it in about two minutes.  
The article adds the details and the research behind it.

## A picture and something else

Take a profile picture uploaded to a company website, a support portal or a customer account. The upload check looks at the first bytes of the file, finds the JPEG signature, perhaps generates a thumbnail, and stores the file. Everything about it says "photo". That is exactly what makes the picture a good container.

## A JPEG ends at its end marker

A JPEG file is a series of segments. It starts with the start-of-image marker (`FF D8`), followed by segments for the header, the quantization and Huffman tables, the frame description and the compressed picture data. It ends with the end-of-image marker (`FF D9`), defined in the JPEG standard (ITU-T T.81).

Image viewers and decoders stop reading at that end marker. Whatever follows it is ignored: it is not part of the picture, and no viewer shows it. A file can therefore carry any amount of additional data after the picture and still display correctly. Files that are valid in two formats at once are called polyglots.

## The attack: a script behind the picture

The attacker appends a few lines of server-side script after the end marker. The upload check sees a real JPEG and stores it. On its own, the stored file does nothing. It becomes dangerous when the server later treats it as a script: for example, a template or plugin that includes uploaded files, a misconfiguration that lets the upload folder execute code, or a file name that the server maps to a script handler.

At that point the appended lines run on the web server. A web shell gives the attacker a way to send commands to the server, read its files and move further into the network. MITRE ATT&CK describes this persistence technique as [T1505.003, Web Shell](https://attack.mitre.org/techniques/T1505/003/). The underlying weakness, accepting a file whose real content does not match what the application expects, is [CWE-434, Unrestricted Upload of File with Dangerous Type](https://cwe.mitre.org/data/definitions/434.html).

## It happened: LANDFALL

Hiding data behind a picture is an established technique. In November 2025, Palo Alto Networks' Unit 42 described [LANDFALL](https://unit42.paloaltonetworks.com/landfall-is-new-commercial-grade-android-spyware/), commercial-grade spyware for Samsung Galaxy phones. Its delivery files were DNG images, a raw photo format, with a ZIP archive appended to the end. The archive held the spyware components. The earliest samples date from July 2024; file names such as "WhatsApp Image … .jpeg" suggest delivery through a messenger, and the likely targets were in the Middle East.

To get from the picture to the spyware, the attackers used a flaw in Samsung's image-processing library (libimagecodec.quram.so), [CVE-2025-21042](https://nvd.nist.gov/vuln/detail/CVE-2025-21042). Samsung fixed it in its April 2025 security update. CISA added it to its [Known Exploited Vulnerabilities catalog](https://www.cisa.gov/known-exploited-vulnerabilities-catalog) on November 10, 2025.

## Why it slips through

Checks that look at the file type see a real picture, because it is one. Thumbnails render correctly, and a person who opens the file sees a photo. The appended script is plain text after the image data: it carries no image structure that a parser would reject, and it does nothing until a server runs it. A filter would have to read past the end marker and judge arbitrary trailing data, which most image pipelines never do.

## What to do

- Store uploaded files outside the web root, under names your application generates, and never let the server execute anything in the upload location.
- Serve uploads with a fixed content type and, where possible, from a separate domain.
- Re-encode images on upload instead of storing the original bytes.

Re-encoding creates a new image from decoded pixels, leaving trailing data behind. bowbridge Content Disarm and Reconstruct (CDR) is designed to rebuild supported files from permitted components only, according to policy.

[Join the bowbridge CDR beta program](https://explore.bowbridge.net/en/cdr-beta)

## Sources

- [LANDFALL Is New Commercial-Grade Android Spyware](https://unit42.paloaltonetworks.com/landfall-is-new-commercial-grade-android-spyware/), Palo Alto Networks Unit 42, November 7, 2025
- [CVE-2025-21042](https://nvd.nist.gov/vuln/detail/CVE-2025-21042), National Vulnerability Database
- [Known Exploited Vulnerabilities Catalog](https://www.cisa.gov/known-exploited-vulnerabilities-catalog), CISA
- [T1505.003: Web Shell](https://attack.mitre.org/techniques/T1505/003/), MITRE ATT&CK
- [CWE-434: Unrestricted Upload of File with Dangerous Type](https://cwe.mitre.org/data/definitions/434.html), MITRE
- [ITU-T T.81: Digital compression and coding of continuous-tone still images](https://www.w3.org/Graphics/JPEG/itu-t81.pdf), ITU

## Subscribe to upcoming episodes

<iframe style="height: 100%; width: 100%; border: medium none currentcolor;" title="Form" xml="lang" src="https://js-eu1.hsforms.net/ui-forms-embed-components-app/frame.html?_hsPortalId=2773339&amp;_hsFormId=49c4cac1-75f8-4608-9335-ca67842bcb0b&amp;_hsIsQa=false&amp;_hsHublet=eu1&amp;_hsDisableScriptloader=true&amp;_hsDisableRedirect=true&amp;_hsInstanceId=c67b03b7-7dc5-48a5-937b-9b88ded25b2b&amp;_preview=true&amp;benderPackage=InpageEditorUI&amp;cacheBust=1796380753601&amp;cssPath=bundles%2Fapp.css&amp;inpageEditorUI=true&amp;localAssets=false&amp;portalId=2773339&amp;preview_key=eFxUpyBx&amp;scriptPath=bundles%2Fapp.js&amp;staticVersion=static-1.86923&amp;preview_theme=true&amp;env=prod&amp;injectedScripts=react-dlb%2Cbundle.production.js%2Cfalse%2Cstatic-1.105&amp;hsSmartContentDefault=true&amp;hsEditorApp=blog_post&amp;sessionId=d0fc59c8-22f9-4cbf-ab43-655055f7eb99" scrolling="no" data-test-id="embedded-form-49c4cac1-75f8-4608-9335-ca67842bcb0b"></iframe>

#### Share this on social:

[Share via LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fexplore.bowbridge.net%2Ffile-security-101%2Fepisode-19-the-jpeg-that-is-also-a-web-shell&title=The+JPEG+That+Is+Also+a+Web+Shell%3A+How+a+Picture+Can+Carry+Code&summary=A+real+photo+passes+upload+checks+with+a+script+hidden+after+its+image+data.+If+the+server+runs+it%2C+the+attacker+can+send+it+commands.) [Share via Twitter](https://twitter.com/intent/tweet?url=https%3A%2F%2Fexplore.bowbridge.net%2Ffile-security-101%2Fepisode-19-the-jpeg-that-is-also-a-web-shell&text=The+JPEG+That+Is+Also+a+Web+Shell%3A+How+a+Picture+Can+Carry+Code) [Share via Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fexplore.bowbridge.net%2Ffile-security-101%2Fepisode-19-the-jpeg-that-is-also-a-web-shell) [Share via Email](mailto:?subject=The+JPEG+That+Is+Also+a+Web+Shell%3A+How+a+Picture+Can+Carry+Code&body=https%3A%2F%2Fexplore.bowbridge.net%2Ffile-security-101%2Fepisode-19-the-jpeg-that-is-also-a-web-shell)

### Don't miss the latest SAP security news

#### bowbridge

- [Solutions](https://www.bowbridge.net/en/sap-cybersecurity-solutions/)
- [Resources](https://www.bowbridge.net/en/sap-cybersecurity-resources/)
- [About bowbridge](https://www.bowbridge.net/en/about-bowbridge-software/)
- [Support](https://www.bowbridge.net/en/sap-cybersecurity-support/)
- [Contact](https://www.bowbridge.net/en/contact-bowbridge/)
- [Customer Login](https://www.bowbridge.net/customer-portal/)

#### Contact

**GERMANY**  
 Tel: +49 (0) 6227 - 69899 - 50  
 Fax: +49 (0) 6227 - 69899-59  
 Email: [info@bowbridge.net](mailto:info@bowbridge.net)

**USA**  
 Tel: +1 650 - 617 - 3408  
 Fax: +1 650 - 617 - 3201  
 Email: [us-sales@bowbridge.net](mailto:us-sales@bowbridge.net)

#### Connect With Us

<https://www.linkedin.com/company/bowbridge-software/> <https://twitter.com/bowbridge_Softw> <https://www.xing.com/companies/bowbridgesoftware>

- [English](https://www.bowbridge.net/en/)
- [Deutsch](https://www.bowbridge.net/)

Copyright © 2023 bowbridge Software GmbH. All rights reserved. [Privacy Policy](https://www.bowbridge.net/en/privacy-policy)

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Joerg Schneider-Simon",
    "url" : "https://explore.bowbridge.net/file-security-101/author/joerg-schneider-simon"
  },
  "dateModified" : "2026-12-04T10:41:11.065Z",
  "datePublished" : "2026-12-04T10:41:11.000Z",
  "headline" : "The JPEG That Is Also a Web Shell: How a Picture Can Carry Code",
  "image" : [ "https://explore.bowbridge.net/hubfs/Blog/File%20Security%20101/Headers/File%20Security%20101%20-%20Blog%20Header.jpeg" ],
  "mainEntityOfPage" : {
    "@id" : "https://explore.bowbridge.net/file-security-101/episode-19-the-jpeg-that-is-also-a-web-shell",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://explore.bowbridge.net/hubfs/bowbridge_logo_2-1.png"
    },
    "name" : "bowbridge Software GmbH"
  }
}
```