RFC 6713

The 'application/zlib' and 'application/gzip' Media Types

πŸ“… published August 2012, from ietf

RFC 6713: The 'application/zlib' and 'application/gzip' Media Types πŸ’–

okay bestie, let's get into RFC 6713 🧚. It's by John Levine (J. Levine) from Taughannock Networks, dated August 2012. It's Informational (published for info, not a Standards Track spec) and has ISSN 2070-1721. The title block doesn't list any RFC it obsoletes or updates, so it's standing on its own 🫢.

Abstract

this one defines two media types, application/gzip and application/zlib, for compressed data made with the gzip and zlib compression formats ✨.

Status of This Memo

ngl, the status section is super official πŸ’…. This document is not an Internet Standards Track spec. It's published for information only 🌸.

It's still an IETF product, though. It reflects IETF community consensus, got public review, and was approved for publication by the Internet Engineering Steering Group (IESG). Just because the IESG approved something doesn't mean it's a candidate for any level of Internet Standard. See Section 2 of RFC 5741 for that bit πŸ™ˆ.

Info on the current status, errata, and feedback for this document lives at http://www.rfc-editor.org/info/rfc6713 πŸ”₯.

Copyright (c) 2012 IETF Trust and the persons identified as the document authors. All rights reserved. πŸŽ€

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. πŸ“œ


1. Introduction ✨

okay so zlib [RFC1950] and gzip [RFC1952] are both super popular compression formats πŸ’–. zlib is a stream format, and gzip adds header and trailer fields that make more sense for files πŸ“. They both use the DEFLATE compression scheme from [RFC1951] 🧚.

they're used on basically everything: plain text, structured data, executable code, you name it 🌈.

Some apps have informally used a bunch of media types to label gzip data, like application/gzip-compressed, application/gzipped, application/x-gunzip, application/x-gzip, application/x-gzip-compressed, and gzip/document. πŸ’€ The media types in this document are meant to replace those in future apps πŸ’….

2. The 'application/zlib' Media Type πŸ¦‹

The application/zlib media type describes a block of data compressed with zlib [RFC1950] compression. The data is a stream of bytes, as described in RFC 1950 🌸.

2.1. Registration Details πŸ’œ

Here's the registration template, exactly as written:

   Type name: application

   Subtype name: zlib

   Required parameters: N/A

   Optional parameters: N/A

   Encoding considerations: Binary

   Security considerations: See Section 4 below.

   Interoperability considerations: N/A

   Published specification: [RFC1950]

   Applications that use this media type: anywhere data size is an issue

   Additional information:
      Magic number(s): first byte is usually 0x78 but can also be 0x08,
      0x18, 0x28, 0x38, 0x48, 0x58, or 0x68.  The first two bytes, when
      interpreted as an unsigned 16-bit number in big-endian byte order,
      contain a value that is a multiple of 31.

      File extension(s): N/A
      Macintosh file type code(s): N/A

   Person and email address to contact for further information: see
   http://www.zlib.net/

   Intended usage: COMMON

   Restrictions on usage: N/A

   Author: John Levine

   Change controller: IETF

3. The 'application/gzip' Media Type πŸŽ€

The application/gzip media type describes a block of data compressed with gzip [RFC1952] compression. The data is a stream of bytes, as described in RFC 1952 ✨.

3.1. Registration Details πŸ“

Here's the gzip registration template, exactly as written:

   Type name: application

   Subtype name: gzip

   Required parameters: N/A

   Optional parameters: N/A

   Encoding considerations: Binary

   Security considerations: See Section 4 below.

   Interoperability considerations: N/A

   Published specification: [RFC1952]

   Applications that use this media type: anywhere data size is an issue

   Additional information:
      Magic number(s): first two bytes are 0x1f, 0x8b.
      File extension(s): gz
      Macintosh file type code(s): N/A

   Person and email address to contact for further information: see
   http://www.gzip.org/
   Intended usage: COMMON

   Restrictions on usage: N/A

   Author: John Levine

   Change controller: IETF

4. Security Considerations πŸ”₯

⚠️ bestie, read this part carefully 😭

zlib and gzip can compress any arbitrary binary data, including hostile executable code πŸ’€. Also, data that claims to be zlib or gzip might not actually be, and fields that are supposed to be flags, lengths, or pointers could hold literally anything πŸ™ˆ. Apps should treat all data with due skepticism 🧐.

There's more in the security considerations of the underlying format docs too: Section 5 of [RFC1950], Section 6 of [RFC1951], and Section 4 of [RFC1952] πŸ“š.

5. IANA Considerations πŸ‘‘

IANA has updated the "Application Media Types" registry to include application/zlib as described in Section 2 and application/gzip as described in Section 3 πŸŽ‰.

6. Normative References 🌈

Here are the normative references, exactly as written:

   [RFC1950]  Deutsch, P. and J-L. Gailly, "ZLIB Compressed Data Format
              Specification version 3.3", RFC 1950, May 1996.

   [RFC1951]  Deutsch, P., "DEFLATE Compressed Data Format Specification
              version 1.3", RFC 1951, May 1996.

   [RFC1952]  Deutsch, P., "GZIP file format specification version 4.3",
              RFC 1952, May 1996.

Author's Address πŸ¦‹

Here's John's contact info, exactly as written:

   John Levine
   Taughannock Networks
   PO Box 727
   Trumansburg, NY  14886

   Phone: +1 831 480 2300
   EMail: standards@taugh.com
πŸ“¦ where this page comes from