Mind the Holes

Composer Security Policies Explained

Stephan Vock  ·  @glaubinix
2026-11-27  ·  packagist.com

Let's talk about cheese 🧀

The Swiss cheese model

  • Every defence layer is a slice of cheese, and every slice has holes
  • One slice lets things through
  • Stack enough slices and the holes rarely line up

Composer has four built-in slices, and you can bring your own.

Switzerland already tried a cheese policy

  • 1914–1999: the Schweizerische Käseunion, a state-backed cartel
  • It bought, priced and exported the "Union cheeses": Emmentaler, Gruyère, Sbrinz
  • Liquidated in 1999, now the market sorts it out

Composer's approach is friendlier: sensible defaults, everything configurable.

Even Emmentaler is losing its holes

  • 2015, Agroscope: holes start at tiny hay particles in the milk
  • Modern, closed milking keeps the hay out, so fewer holes
  • 2025: a Swiss court allowed "hole-starter" powder in Emmentaler AOP

Holes are expected. You just need to know where they are.

config.policy at a glance

"config": {
    "policy": {
        "abandoned": {}, "advisories": {}, "malware": {},
        "cooldown": {}, "my-policy": {}
    }
}
  • block: refuse to install it during update / require / remove
  • audit: ignore, report or fail in composer audit
  • ignore: exceptions, ideally with a reason

Everything in this talk works with Composer 2.11.

Slice 1: Abandoned

Tête de Moine

The monks left. The cheese stayed.

  • First made by the monks of Bellelay Abbey (founded 1136) in the Bernese Jura
  • 1797: the French Revolution arrives, the monks are evicted
  • The dairies kept going, and you can still buy it today

An abandoned package is the same: the original maintainers are gone.
Sometimes there's a suggested replacement that keeps it alive.

Abandoned policy

"abandoned": {
    "block": false,
    "audit": "fail",
    "ignore": {
        "bellelay/tete-de-moine": "Switching to the dairy fork next quarter."
    }
}
  • Default: don't block but fail the audit
  • It's not mouldy yet, but someone should know it's at the back of the fridge
  • Want it gone for good? "block": true

Who says it's abandoned?

Only the maintainer, on purpose:

  • Archiving the GitHub repository
  • Marking it abandoned on Packagist, optionally with a replacement
  • Setting "abandoned": true (or "vendor/replacement") in composer.json

Quiet isn't abandoned. A package nobody touched in years is not flagged.

Slice 2: Security advisories

Vacherin Mont-d'Or

When a batch goes bad

  • 1983–87: a Listeria outbreak in western Switzerland, 122 cases, ~30 deaths
  • 1987: traced to Vacherin Mont-d'Or, production and export stopped
  • Today Swiss Vacherin Mont-d'Or AOP must be made from heat-treated milk

Report → block affected versions → ship a fixed release.
That's the advisory lifecycle. A recall names the affected batches, an advisory names the affected versions.

The mould rule

Cheese Mould Severity
Hard cheese (Sbrinz, Gruyère) Cut off 2.5 cm, eat the rest low
Soft cheese (Vacherin) Throw it out critical
"advisories": {
    "ignore-severity": ["low"],
    "ignore-id": {
        "CVE-1234": "We only cook with it. Not affected."
    }
}

Who issues the recall?

  • GitHub Advisory Database
  • FriendsOfPHP/security-advisories

Recalls take time. GitHub advisory reviews are currently backed up:

  • May 2026: a record 1,560 reviewed advisories, 5× the usual month
  • Review time grew to multiple weeks for a meaningful share

The cheese might be eaten before the recall arrives.

Slice 3: Malware

Emmentaler

Not every "Emmental" is Emmentaler

  • "Emmental" is made all over the world
  • Since 2011, Emmentaler AOP dairies add a secret Agroscope bacterial culture
  • A DNA test on a few grams, even grated, tells real from fake

Same label, same wrapper, not the real thing inside.
That's a compromised release: the right package name, malicious contents.

Malware policy

"malware": {
    "block": true,
    "block-scope": "all",
    "audit": "fail",
    "ignore-source": []
}
  • On by default
  • block-scope: all also blocks on composer install:
    if fake cheese is already in your fridge (lockfile), you still don't eat it

Who spots the fake?

  • Packagist.org imports the Aikido malware feed
  • The Packagist.org team manually flags packages reported to us through other channels

Composer blocks both. ignore-source lets you opt out of a single source.

Slice 4: Cooldown

Gruyère

Take it out of the fridge an hour early

Everyone knows cheese needs to come out of the fridge before you eat it.
Fresh releases are the same.

  • Let others taste it first
  • Gruyère AOP ages for at least 5 months, your dependencies only need a day or two
  • The malicious intercom/intercom-php 5.0.2 was flagged within minutes

Cooldown policy

"cooldown": {
    "period": "7 days"
}
  • "7 days", "24 hours", "1 week" or seconds. Default null (off)
  • Dev versions (e.g. dev-main, 2.x-dev) are never held back
  • Packages you're not updating keep their locked version

Which date is on the label?

A version has two timestamps:

  • time: the commit date, set by whoever made the release. Attacker controlled, easy to backdate
  • published-time: when the version appeared on Packagist. Can't be faked by the author

Cooldown uses published-time. The cheesemaker writes the label, the shop knows when it arrived.

Some cheese can't wait

Raclette is eaten the second it melts.

"cooldown": {
    "period": "7 days",
    "ignore": {
        "our-alp/*": "We trust the cheese from our own Alp",
        "valais/raclette": "Security fixes are eaten while hot"
    }
}
  • ignore: these cheeses never wait
  • --no-cooldown: the whole platter straight from the fridge, just this once

Slice 5: Your own

Fondue

Every family has its fondue rules

  • Moitié-moitié: half Gruyère, half Vacherin Fribourgeois
  • Neuchâtel, pure Vacherin, a secret family blend...
  • Drop your bread in the pot? Forfeit. Third time? Lake Geneva, weights on your feet

Custom policies are your house rules, published as a list someone maintains.

Custom policies

"fondue-rules": {
    "block": true,
    "audit": "fail",
    "block-scope": "update",
    "sources": [
        { "type": "url", "url": "https://example.org/fondue-rules.json" }
    ],
    "ignore": { "fribourg/moitie-moitie": "Approved by grandma." }
}
  • Composer POSTs the package names, the source returns what's off the menu
  • https:// only
  • block-scope defaults to update, not all

Mind the holes

Slice Cheese Default
Abandoned Tête de Moine audit fails, no block
Advisories Vacherin Mont-d'Or block
Malware Emmentaler block, even on install
Cooldown Gruyère off, turn it on!
Custom Fondue your rules

Every slice has holes. Stack them.

Off switches (use with care)

  • --no-cooldown: skip only the cooldown, for this command
  • --no-blocking: nothing is blocked, for this command. Midnight-snack mode
  • COMPOSER_POLICY=0 / "policy": false: no blocking and no audit. You'll eat anything

Resources & sources

Composer docs: getcomposer.org/doc/06-config.md#policy

Image credits

All images via Wikimedia Commons, resized.

Thank you

Stephan Vock  ·  @glaubinix  ·  packagist.com

TODO: links to Composer issues/PRs for cooldown