A minimatch Security Override Broke ESLint in Two Projects

A security override replaced the callable minimatch export expected by old ESLint plugins with an object. In my-app-center, the ordinary lint run still passed: it never reached the calls that broke. A separate incident capture from page-gen records the same export mismatch in two other rules.

There is an important correction to the original incident notes. They described GHSA-g3hv-75wg-m249 as affecting every version below 11.0.1. The current advisory, checked on November 5, lists >=7.0.0, <11.0.1, with 11.0.1 as the first patched version. It excludes 3.x. The historical response to a scanner warning is not a reason to suppress that warning today.

The compatibility failure is still useful to understand. An override changes what a dependency receives without changing the code that consumes it.

The function call that changed shape

The versions involved were eslint-plugin-import 2.32.0, eslint-plugin-jsx-a11y 6.10.2, and eslint-plugin-react 7.37.5. Their package manifests each declare minimatch@^3.1.2. They therefore expect the 3.x API, regardless of which version an override supplies.

In minimatch 3.1.5, require("minimatch") returns a function:

const minimatch = require("minimatch");
minimatch("Widget", "Wid*"); // true with 3.1.5

With 11.0.3, the CommonJS export is an object with a named minimatch function. The same direct call throws a TypeError; the supported call is:

const { minimatch } = require("minimatch");
minimatch("Widget", "Wid*"); // true with 11.0.3

A local check for this revision confirmed those export shapes and call results with the published packages. This reproduces the API mismatch; the historical ESLint rule tests were not rerun.

Why the normal lint run missed it

In my-app-center, PR #21 initially applied minimatch@<11.0.1: ^11.0.1. The incident notes record that this moved the plugins' 3.1.5 copies to 11.0.3 along with the project's 10.x consumers.

The ordinary lint run passed, but targeted probes recorded two failures:

  • react/no-danger with customComponentNames threw minimatch is not a function.
  • jsx-a11y/label-has-associated-control, on a label wrapping an input, threw (0 , _minimatch.default) is not a function.

Loading a plugin is not the same as exercising every rule and option it contains. For example, react/no-danger calls minimatch while checking configured custom component names. A lint run that does not reach that branch cannot detect the incompatible export.

The November 2 capture from page-gen records failures in import/no-extraneous-dependencies and react/jsx-pascal-case under a 3.x-to-11 override; without that override, both probes exited 0. Those measurements were relayed to the capture author and were not rerun for this revision. The evidence concerns these specific rule paths, rather than every rule in the plugins.

Narrow the override to the consumers being upgraded

The my-app-center correction, recorded in commit 124ae39, excluded the 3.x consumers. It used a selector for the 10.x range, resolving those consumers to 11.0.3; page-gen's capture records an override of its 10.x range to ^11.0.1:

overrides:
  minimatch@>=10 <11.0.1: ^11.0.1 # GHSA-g3hv-75wg-m249

This is an example for those dependency graphs, not a complete selector for the advisory's entire affected range. It leaves 7.x through 9.x untouched; a project that installs those versions needs to assess them too. Moving 10.x to 11.x still crosses a major version and needs consumer-level testing.

The narrowed override was temporary too. On November 18, my-app-center removed it in commit 04d07a8: newer releases of eslint, @eslint/config-array and @typescript-eslint/typescript-estree request minimatch ^11.0.1 or later, so the former 10.x consumers now resolve 11.0.9 without an override. An override for a security fix is worth rechecking once the parent packages request the patched range themselves.

The old records also contain scanner ignores for 3.x, and page-gen's capture records a Dependabot dismissal. These rest on the advisory range recorded then; my-app-center's 3.x ignore was still in place on November 18, with that older range in its reason. The current advisory does not list 3.x as affected, so neither an ignore nor a risk dismissal should be copied from those records to justify retaining 3.x for this GHSA. That says nothing about other advisories affecting the same version.

Before accepting a security override

  • Check the current advisory range against each resolved version. A historical alert is evidence of what was reported then, not a permanent package classification.
  • Use pnpm why minimatch and the lockfile to find the consumers. Confirm resolution through the consuming package; an orphan directory under node_modules/.pnpm is not proof that it is still in use.
  • Check the import shape and exercise the relevant rule, option, and input. A passing general lint run only covers the paths it reached.
  • Regenerate the lockfile, inspect the resolved graph, and run the normal project checks as well as the targeted probe.
  • Recheck whether the override is still needed once the parent packages request the patched range.

In this case, the decisive compatibility check was small: does the consumer call the required module itself, or a function exported from it? The broad override changed that answer while leaving the consumer's call unchanged.