Skip to content

MSI custom actions: what runs, when, and as whom

The CustomAction Type field is a bit-field. Decode it and you know whether an installer runs an EXE, loads a DLL, executes a script — and whether it does so as SYSTEM.

Published on 2 min read

Most of an MSI is declarative: copy these files, write these keys, create these shortcuts. The exception — and the place attackers live — is the CustomAction table, where a package runs arbitrary code. Reading it well is the core of MSI triage.

The Type bit-field

Each custom action has a Type integer. It is not an enum; it is a bit-field you decode in three parts:

  • What runs (low 3 bits): 1 a DLL entry point, 2 an EXE, 5 JScript, 6 VBScript, 7 a nested install.
  • Source (bits 0x30): 0x00 the embedded Binary table, 0x10 an installed file, 0x20 a directory or inline script text, 0x30 a property.
  • Scheduling: 0x400 deferred (runs in the install script, in the service context), 0x800 no-impersonate → runs as LocalSystem, plus async, rollback/commit and ignore-exit-code bits.

So 0x02 is "run an EXE from the Binary table, immediately, as the user", while 0xC02 is "run an EXE from the Binary table, deferred, as SYSTEM". That second one deserves a second look.

What to flag

  • Any action that runs an EXE, loads a DLL, or executes a script.
  • Deferred + no-impersonate actions — code running as SYSTEM during install.
  • Nested installs, which pull in another package.
  • Scripts whose body sits inline in the Target column, or that reference the Binary table — then check what that binary actually is.

Custom actions are ordered by the InstallExecuteSequence table, so you can see when each runs and under what condition. MSI Parser decodes every Type into plain language and joins it to the sequence, so "runs an EXE as SYSTEM" is one glance, not a hex-decoding exercise. Next: a full triage checklist.

Related articles

An .msi is a database, not a program. Here's what's inside one and how to read it safely — in your browser, with nothing uploaded or executed.
A practical, static checklist for deciding whether a Windows Installer package is worth trusting — signature, custom actions, payload and reach.