GHSA-c83g-rgw3-j3cx: High severity npm/browserslist vulnerability

Published Sep 1, 2026
·
Updated

Vulnerability Details

File: index.js Location: cache (browserslist()'s result cache, line ~402) and parseCache (parseQueries()'s AST cache)

Root Cause js var cache = {} var parseCache = {}

function browserslist(queries, opts) { ... var cacheKey = JSON.stringify([queries, context]) if (cache[cacheKey]) return cache[cacheKey] ... if (!env.env.BROWSERSLISTDISABLECACHE) { cache[cacheKey] = result } return result }

function parseQueries(queries) { var cacheKey = JSON.stringify(queries) if (cacheKey in parseCache) return parseCache[cacheKey] var result = parseWithoutCache(QUERIES, queries) if (!env.env.BROWSERSLISTDISABLECACHE) { parseCache[cacheKey] = result } ... } Every distinct (queries, context) pair is cached forever — no size cap, TTL, or eviction. browserslist.clearCaches() never resets either object (it only resets node.js's own filesystem caches); the only opt-out is the BROWSERSLISTDISABLECACHE env var, controlled by the calling application, not an attacker.

Some short, valid queries amplify this badly. The since <year>-<month>-<day> query type (/^since (\d+)-(\d+)-(\d+)$/i) accepts any digit combination — Date.UTC() normalizes rather than rejects out-of-range values — giving an effectively unbounded space of ~17-byte distinct cache keys, each of which resolves to (and caches) a result close to the full ~8.5 KB browser list for any sufficiently old year.

Measured Impact 20,000 distinct since <year>-<month>-<day> queries (~330 KB total input, --expose-gc before/after measurement to rule out uncollected garbage) retained over 50 MB of heap permanently — roughly 150x amplification, growing linearly with no cap observed up to 40,000 queries (52.3 MB).

Attack Scenario Any long-running process (server, daemon, warm CI worker) that calls browserslist() with a query value that varies across requests/items and is influenced, even partially, by external input accumulates one cache entry per distinct value ever seen. An attacker who can influence that value across many requests (this is a volumetric attack, unlike the single-request DoS findings from this same research pass) sends a stream of cheap, distinct queries (e.g. since 1900-01-01, since 1900-01-02, ...) until the process runs out of memory and crashes.

Recommended Fix (implemented and verified) Replace both plain-object caches with Maps bounded to a fixed maximum entry count, evicting the oldest entry once the cap is reached (Map preserves insertion order, so .keys().next().value is always oldest):

js var CACHEMAXENTRIES = 500

function boundedCacheSet(map, key, value) { if (map.size >= CACHEMAXENTRIES) { map.delete(map.keys().next().value) } map.set(key, value) }

var cache = new Map() var parseCache = new Map() (read sites changed to .has()/.get(), write sites to boundedCacheSet())

Verification: - NODEENV=test npx uvu test .test.js → 301/301 pass unmodified (test/cache.test.js exercises clearCaches()/BROWSERSLISTDISABLECACHE against node.js's separate filesystem caches, unaffected here); confirmed a repeated identical call still returns the cached reference. - Re-ran the memory PoC post-fix: heap stayed flat at ~4.9 MB after 5,000, 10,000, 20,000, and 40,000 distinct since-date queries (was 10.5 → 16.5 → 28.4 → 52.3 MB pre-fix).

Impact - Who is affected: Long-running processes calling browserslist() with query values that vary across requests/items and are influenced by external input. - What an attacker achieves: DoS via eventual out-of-memory crash, given sustained traffic over time (not a single small payload). - Conditions required: No authentication; requires volume rather than a single request, hence Medium rather than High severity.

Verification Environment browserslist @ HEAD (== v4.28.6, current latest stable release) under local Node.js v20.19.5, run with --expose-gc for accurate heap measurement.

Note Found during a broader review of this codebase in the same research pass that produced GHSA-rrmg-cfrq-23vv (parse.js algorithmic complexity), GHSA-g6p8-hj8g-x889 (baseline regexp ReDoS), GHSA-73wf-gq98-2v4g (normalizeStats crash/prototype write), and GHSA-h633-868p-5rfw (SCOPEDCONFIGPATTERN ReDoS) — all single-request DoS vectors. This one is different in character (volumetric, not single-request) and is reported separately/scored lower accordingly.

Affected Software

1 affected componentFixes available
npm/browserslist<=4.28.6
4.28.7

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/browserslist to a version that resolves this vulnerability.

    Fixed in 4.28.7
  2. Upgrade

    Upgrade browserslist to a version that resolves this vulnerability.

    Fixed in v4.28.6
  3. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch GHSA-73wf-gq98-2v4g
  4. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch GHSA-h633-868p-5rfw
  5. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch GHSA-g6p8-hj8g-x889
  6. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch GHSA-rrmg-cfrq-23vv
  7. Configuration

    Set the BROWSERSLIST_DISABLE_CACHE environment variable to disable browserslist() result caching and parseCache caching (bypasses the unbounded forever-growing caches described).

    browserslist cache BROWSERSLIST_DISABLE_CACHE = true
  8. Configuration

    Replace plain-object caches with Map caches and bound them to a fixed maximum size by setting CACHE_MAX_ENTRIES = 500 (evict oldest entries when map.size reaches the cap) as implemented via boundedCacheSet/map.delete(map.keys().next().value) in index.js (~line 402 cache/browserslist result cache and parseCache for parseQueries AST).

    browserslist (index.js) cache CACHE_MAX_ENTRIES = 500

Event History

Sep 1, 2026
Advisory Published
via GitHub·04:42 PM
Data Sourced
via GitHub·04:42 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are most exposed to this issue?

Applications are exposed when an attacker can cause browserslist() or parseQueries() to process many distinct query values or query/context combinations. Long-running processes are particularly at risk because the cache entries persist for the lifetime of the process.

2

Is the default behavior affected?

Yes. Caching is enabled unless the calling application sets the BROWSERSLIST_DISABLE_CACHE environment variable. The cache has no size limit, expiration, or eviction mechanism.

3

What can be done if patching is not immediately possible?

Set BROWSERSLIST_DISABLE_CACHE in the calling application's environment to prevent new entries from being stored. Also avoid passing attacker-controlled or unbounded query inputs to browserslist parsing where possible.

4

Will browserslist.clearCaches() remove the affected cache entries?

No. browserslist.clearCaches() resets node.js filesystem-related caches, but does not reset the result cache or parse cache described here. Existing entries remain until the process is restarted.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203