Introduction
A .crx file packages an extension for
Google Chrome and other Chromium-based
browsers. It is a ZIP archive of the extension’s
files, with a header in front that holds the public keys and signatures. The
extension’s description, permissions and scripts are in a
manifest.json at the top of the archive.
The format has had two versions. CRX3 is the current one. CRX2 was simpler, a single key and a signature. Chromium’s verifier today accepts only version 3.
Structure
Both versions start with the four bytes Cr24 and a 32-bit
little-endian version number. A .crx dropped on any page of this site
opens in the explorer, which shows the header field by field, the manifest, and every
member of the archive.
0Magic number43 72 32 34,Cr244 bytes4Version 3 (or, in old files, 2)4 bytes8Header proofs and signed data (CRX3), or a public key and a signature (CRX2)varies…ZIP archivemanifest.jsonand the extension’s filesvaries
Offsets inside the ZIP archive count from the start of the archive, not from the start of the file. So a ZIP reader that looks for the end record finds the archive, and the header in front looks like a prefix.
The rest of the format is described on these pages:
- CRX3 header – the current format, byte by byte
- CRX2 header – the old format, byte by byte
- Signing and IDs – what is signed, and how the extension ID comes from the key
Links
Software
- Google Chrome – Google’s browser, which installs extensions from .crx packages (Windows, macOS, Linux)
- Chromium – the open-source browser Chrome is built on, with the code that verifies these files
Reference
- crx3.proto – Chromium’s definition of the CRX3 header
- components/crx_file – Chromium’s code that reads and verifies the format
- Chrome extensions documentation – Google’s guides to building extensions