Blog / A08:2021 Software and Data Integrity Failures
A08:2021 · Software and Data Integrity Failures

A Build Variable That Picks Which Plugin Runs

Someone sets a version string in your CI config. The build script pastes it into a plugin coordinate, then downloads and runs that plugin. Whoever sets the string owns the build.

version set asexternal propertyinterpolated intoplugin coordinatebuild resolvesthat versionplugin downloadedfrom repoplugin code runsin buildATTACKER INPUTIMPACTtrust boundary crossed
Attack path · version set as external property → interpolated into plugin coordinate → build resolves that version → plugin downloaded from repo → plugin code runs in build

Someone sets a version string in your CI config. The build script pastes it into a plugin coordinate, then downloads and runs that plugin. Whoever sets the string owns the build.

What goes wrong

A version string comes from outside the build script: a property, an environment override, a value in the root project's config. The script drops it straight into the coordinate that tells the build which plugin to fetch. Plugins are not data. They are code that runs with the full authority of your build.

So whoever can set that property picks which plugin release the build downloads and executes. Point it at a malicious version available through the configured repositories and the build pulls it and runs it. That is arbitrary code execution on your build machine, which usually holds signing keys and the deploy credentials that ship your releases.

The mistake is treating a version like a harmless knob. For a dependency you merely link against, a floating version is a supply-chain risk. For a plugin you execute, it is a direct path to code execution. Pin plugin versions to known-good values and control who can override them.

The pattern

Vulnerable
// version comes from external, overridable config
def pluginVersion = project.props['pluginVersion']
buildscript {
  dependencies {
    classpath 'com.example:build-plugin:' + pluginVersion  // fetched and run
  }
}
Hardened
// pin the version, do not read it from overridable input
buildscript {
  dependencies {
    classpath 'com.example:build-plugin:2.4.1'   // known-good, reviewed
  }
}
// bump it through a reviewed commit, verify checksums
How the pipeline adjudicated itPROVEN
ABCDEFGH

Every gate held. The exploit path was reproduced against a negative control, the impact was calibrated, and the finding was signed report-ready.

Ed25519 · per-tenant signing key · gate ledger A–H · verify offline against the published payload hash

Why it matters to you

Your build server is one of the highest-value targets you own. It signs releases and holds the credentials that ship them. A knob that lets external config choose executable plugin code turns a settings change into remote code execution, and the output is trusted artifacts carrying your signature. Pin what your build executes, and lock down who can change build properties.

Check your own code