appended data
termKept in this browser · My desk
Bytes stored after the logical end of a file, such as after a PNG's IEND chunk or a JPEG's end-of-image marker, which viewers ignore and a byte count or signature scan reveals.
The PNG specification warns that data after IEND could contain anything, including malicious code that a malicious application might extract and run. ExifTool notes that many cameras legitimately store a preview image after the JPEG end-of-image marker and can delete recognized trailers; binwalk identifies and extracts files embedded in other files.
What it is. Appended data is any run of bytes after the point where a file's format says the file ends. Formats define both ends. The Portable Network Graphics (PNG) specification, a World Wide Web Consortium (W3C) Recommendation in its third edition of 24 June 2025, opens every file with the eight bytes 89 50 4E 47 0D 0A 1A 0A and builds the image as a series of chunks, each a four-byte length, a four-byte type, the data and a four-byte cyclic redundancy check (CRC), from IHDR to IEND, whose empty data field marks the end of the datastream. JPEG (Joint Photographic Experts Group) images follow Recommendation T.81 of the International Telecommunication Union (ITU-T), approved on 18 September 1992, which defines the markers start of image (SOI, X'FFD8'), end of image (EOI, X'FFD9'), application segments (APPn, X'FFE0' to X'FFEF') and comment (COM, X'FFFE'). Whatever follows IEND, or the last EOI, lies outside the image as its standard defines it.
Why readers do not see it. Alexey Shulmin and Evgeniya Krylova of Kaspersky explained the overlay method on 3 August 2017: some formats state their size in a header and others are read until an end-of-data marker, so a decoder stops early and never looks further. Their example is a RAR/JPEG file, an image followed by a RAR archive: an image viewer stops at the image's boundary, and the archiver ignores everything before its own signature. They add that, strictly speaking, this is not proper steganography, and that the appended part can be easily identified by an analyst visually reviewing the file.
A worked check. Triage locates the format's end marker and compares its position with the file size. Take a file called holiday.png, 124 bytes long, that starts with the PNG signature. The chunk type IEND, the letters 49 45 4E 44 in ASCII (American Standard Code for Information Interchange), sits at offset 104; the four bytes before it, at offsets 100 to 103, are its length, 00 00 00 00, and the four after it, at 108 to 111, its CRC, AE 42 60 82. A PNG whose IEND chunk ends at offset 111 should be 112 bytes long, so 124 minus 112 leaves 12 appended bytes. For a JPEG the same test looks for the last FF D9. High entropy in the appended block suggests encryption or compression, and a recognizable signature inside it suggests an embedded file; binwalk identifies and extracts files embedded in other files and uses entropy analysis to point at unknown compression or encryption.
Where it has been used. Malware authors have used images as envelopes for exactly this reason. Jérôme Segura of Malwarebytes wrote on 17 February 2014 that ZeusVM, a variant of the Zeus banking Trojan first noticed by the French researcher Xylitol, fetched its configuration, the list of banks to attack, from a photograph of a sunset. Segura found a copy of the same picture on the web with the same width and height, compared the two and saw in a hexadecimal viewer where the picture ended and the extra data began; the data was encoded with Base64 and encrypted with the RC4 (Rivest Cipher 4) stream cipher and an exclusive-or (XOR) step. FireEye's report on HAMMERTOSS, of July 2015, described malware that it attributed to the group it calls APT29 (APT standing for advanced persistent threat) reading images that carried encrypted data appended beyond the FF D9 end-of-file marker, found at an offset given in a tweet and decrypted with a key made of data in the malware plus characters from the tweet. FireEye wrote that the technique would be readily detectable if someone was checking for it, and that the strength of the design lay in the encryption: an investigator who found the data still needed the malware and the day's tweet to read it.
Legitimate trailers. Not every trailer is hostile. ExifTool's documentation notes that a number of digital cameras store a large preview image after the JPEG EOI, and its option -trailer:all= deletes the trailers it recognizes, a group separate from the metadata deleted by -all=. The PNG specification warns, in its security considerations, that data after IEND could contain anything, including malicious code; decoding the image carries no known risk, but a malicious application might hide code inside an innocent-looking image file and then execute it.
What goes wrong. Two misreadings recur. Appended data is evidence of a container, not of intent; and careful steganography leaves none, because it hides inside pixel values or coefficients, so a clean end marker proves nothing. The other is to trust a check that reads only what a format defines. Code signing met the same weakness: Microsoft's bulletin MS13-098 of 10 December 2013, for CVE-2013-3900 (Common Vulnerabilities and Exposures), described an attacker modifying a signed portable executable (PE) file to leverage unverified portions of the file, adding malicious code without invalidating its Authenticode signature, and said that targeted attacks were already trying to exploit it. The stricter verification shipped with the fix treats such files as unsigned, but on 29 July 2014 Microsoft dropped its plan to enforce it by default, because the impact on existing software could be high; it remains an opt-in setting.
Neighbours. The magic number at a file's start and the end marker at its close bracket the region a reader trusts; entropy helps to characterize what lies beyond it; metadata stripping removes it only when trailers are removed too, while content disarm and reconstruction, which rebuilds a file from what its format defines, leaves no room for it; steganalysis takes over when nothing is appended and the suspicion remains; and stegomalware is the family of malicious code that has used the trick, from ZeusVM to HAMMERTOSS.
Also known as: trailing data, data after end of file, data after IEND, JPEG trailer, dados anexados
Sources
- W3C, PNG Specification, Third Edition, 24 June 2025 (read 2026-11-23): eight-byte signature 89 50 4E 47 0D 0A 1A 0A; chunks from IHDR to IEND; security considerations: data after IEND could contain anything, including malicious code
- ITU-T Recommendation T.81, approved 18 September 1992, copy at the W3C (read 2026-11-23): markers SOI X'FFD8', EOI X'FFD9', APPn X'FFE0' to X'FFEF', COM X'FFFE'
- Phil Harvey, ExifTool application documentation (read 2026-11-23): cameras store a PreviewImage after the JPEG EOI; -trailer:all= deletes recognized trailers
- ReFirmLabs, binwalk README (read 2026-11-23): identifies and extracts files and data embedded inside other files; entropy analysis
- Jérôme Segura, Malwarebytes Labs, Hiding in plain sight: a story about a sneaky banking Trojan, 17 February 2014 (read 2026-11-23): ZeusVM's configuration appended to a photograph of a sunset; found by comparison with an identical copy of the picture and a hex viewer; Base64, RC4 and XOR; first noticed by the researcher Xylitol
- Alexey Shulmin and Evgeniya Krylova, Kaspersky, Steganography in contemporary cyberattacks, Securelist, 3 August 2017 (read 2026-11-23): the overlay method, data after a format's size or end-of-data marker; the RAR/JPEG example; strictly speaking not proper steganography; easily identified by an analyst visually reviewing the file
- FireEye, HAMMERTOSS: Stealthy Tactics Define a Russian Cyber Threat Group, July 2015, copy hosted by Javelin Networks (read 2026-11-23): stage 4, encrypted data appended beyond the FF D9 JPEG end-of-file marker at an offset given in a tweet; key from the malware binary and the tweet; readily detectable if someone was checking for it
- Microsoft, Security Bulletin MS13-098, 10 December 2013, updated 29 July 2014 (read 2026-11-23): CVE-2013-3900 in WinVerifyTrust; a signed PE file modified to leverage unverified portions of the file without invalidating the Authenticode signature; targeted attacks known; the stricter verification left opt-in from 29 July 2014