BuddyPress

npm Security Vulnerabilities Every BuddyPress Plugin Developer Should Know About

The npm risks that matter to BuddyPress plugin developers, backed by published GitHub advisories: hijacked packages, npm audit on @wordpress/scripts, npm 12 install-script blocking, lockfiles and provenance.

·12 min read
npm security for BuddyPress plugin developers: terminal showing npm ci, npm audit --omit=dev, blocked install scripts and a debug 4.4.2 malware advisory

The npm security risks that matter to a BuddyPress plugin developer are not the ones npm audit shouts about most. The real danger is a trusted package publishing a malicious version that runs code on your machine during npm install and steals your tokens, which has happened to ua-parser-js, chalk, debug, Nx, TanStack and others, each with a published GitHub advisory. Pin a lockfile, install with npm ci, keep dependency install scripts blocked, and read audit output by what actually ships in your plugin zip.

This guide was rewritten by our team and checked on 18 November 2026. Every incident below links to its entry in the GitHub Advisory Database with the affected and fixed versions, and the audit numbers come from a clean install of @wordpress/scripts 37.1.0 that we ran on that date with Node 22.23.2. Where no advisory exists, we left the claim out.

Most BuddyPress plugins ship PHP plus a few compiled JavaScript files. The npm tree lives on your laptop and in CI, not on your customers’ servers. That changes which risks are urgent, and it is the thread running through everything that follows.

What npm security vulnerabilities should BuddyPress plugin developers know about?

Two kinds, and they need opposite responses.

Known vulnerabilities are bugs in a package version: a regular expression that can be made to run for minutes (ReDoS), prototype pollution, a path traversal. They get a GHSA ID, often a CVE, and a fixed version. npm audit reports them. In a block plugin built with @wordpress/scripts, nearly all of them sit in build tools such as linters, file-globbing libraries and the dev server, and none of that code reaches the zip you upload to WordPress.org.

Malicious versions are worse. An attacker takes over a maintainer account or a release pipeline and publishes a version that contains malware, usually code that runs in an install script and sends your npm token, GitHub token, SSH keys or cloud credentials somewhere. Advisories for these are often typed as malware, and the advice is never “upgrade”. It is “remove that version, then rotate every secret the machine could reach”.

Known vulnerability

Malicious version

Example

picomatch ReDoS, GHSA-fc5q-39xc-vjpf

debug 4.4.2, GHSA-4x49-vf9v-38px

Where it hurts

Usually only if attacker-controlled input reaches the code

On your machine or CI the moment it installs

Does npm audit catch it?

Yes, once the advisory is published

Only after someone reports it, often hours later

What you do

Upgrade, override, or accept if it is build-time only

Remove, reinstall from a clean lockfile, rotate secrets

Which npm supply chain attacks have published advisories?

These are the incidents most relevant to a WordPress build toolchain, each with its advisory as listed in the GitHub Advisory Database, checked on 18 November 2026. The pattern is the same every time: a popular package, a short window, and code that runs during install.

Incident (advisory published)

Advisory

Affected versions

Fixed or safe version

event-stream via flatmap-stream (Nov 2018)

GHSA-mh6f-8j2x-4483

event-stream 3.3.6, all flatmap-stream

event-stream 4.0.0; remove flatmap-stream

ua-parser-js hijack (Oct 2021)

GHSA-pjwm-rvh2-c87w (CVE-2021-4229)

0.7.29, 0.8.0, 1.0.0

0.7.30, 0.8.1, 1.0.1

coa and rc hijack (Nov 2021)

GHSA-73qr-pfmq-6rp8, GHSA-g2q5-5433-rhrf

coa 2.0.3, 2.0.4, 2.1.1, 2.1.3, 3.0.1, 3.1.3; rc 1.2.9, 1.3.9, 2.3.9

No patched release listed; pin an earlier version

colors infinite loop (Jan 2022)

GHSA-5rqg-jm4f-cqx7

1.4.1 to 1.4.2, 1.4.44-liberty-2

No patched release listed; pin 1.4.0

node-ipc malicious code (Mar 2022)

GHSA-97m3-w2cp-4xx6 (CVE-2022-23812)

10.1.1 to 10.1.2

10.1.3

eslint-config-prettier and related packages (Jul 2025)

GHSA-f29h-pxvx-f335 (CVE-2025-54313)

8.10.1, 9.1.1, 10.1.6 to 10.1.7, plus synckit 0.11.9 and others

8.10.2, 9.1.2, 10.1.8

Nx packages (Aug 2025)

GHSA-cxm3-wv7p-598c (CVE-2025-10894)

nx 20.9.0 to 20.12.0, 21.5.0 to 21.8.0

Any version outside that list

chalk and debug takeover (Sep 2025)

GHSA-2v46-p5h4-248w, GHSA-4x49-vf9v-38px (CVE-2025-59144)

chalk 5.6.1, debug 4.4.2, ansi-styles 6.2.2

debug 4.4.3; earlier chalk

@ctrl/tinycolor (Sep 2025)

GHSA-qjqf-7j6f-82c4

4.1.1 to 4.1.2

Earlier versions

@bitwarden/cli (Apr 2026)

GHSA-g98r-qjhg-4fmr

2026.4.0

Any other version

TanStack packages (May 2026)

GHSA-g7cv-rxg3-hmpx

Specific versions of 84 @tanstack packages

Per-package fixed versions in the advisory

@antv/g2 (May 2026)

GHSA-hqrw-phww-294v

5.5.8, 5.6.8

Any other version

Two lessons from that table. First, popularity is no protection: chalk and debug sit somewhere in almost every JavaScript build tree, including the @wordpress/scripts toolchain. Second, timing decides who gets hit. A developer who ran a fresh npm install without a lockfile while a bad version was live got the bad version; one who ran npm ci against a lockfile written the week before did not.

How do you read npm audit output for a BuddyPress block plugin?

Run it twice: once for everything, once for production dependencies only. The second number is the one that describes code your users run.

We installed @wordpress/scripts 37.1.0 (published 4 November 2026) into an empty project and audited it on 18 November 2026. The tree had 1,294 packages, and npm audit reported 37 findings: 31 high, 3 moderate, 3 low, 0 critical. Every one was a dev dependency. npm audit --omit=dev reported 0.

# checked on 18 November 2026: Node 22.23.2, npm 10.9.8
npm init -y
npm install --save-dev @wordpress/scripts@37.1.0
npm audit                 # 37 vulnerabilities (3 low, 3 moderate, 31 high)
npm audit --omit=dev      # found 0 vulnerabilities
npm audit signatures      # 1245 packages have verified registry signatures

Most of those highs trace back to one advisory: GHSA-fc5q-39xc-vjpf, a ReDoS in picomatch published 19 October 2026 for versions up to 4.0.7, with no patched version listed yet. picomatch matches file paths for linters, stylelint, the dev server and globbing helpers. An attacker would need to feed a hostile glob pattern into your build, which is not a realistic threat on a developer laptop. The same goes for the serialize-javascript advisories under copy-webpack-plugin, which only process your own block files at build time.

So a long red audit report on a block plugin is normal, and it is not a reason to panic. It is a reason to make sure nothing from that tree ends up in your plugin zip, and to watch for the malware-type advisories that are a reason to panic. The Gutenberg team tracks the toolchain findings in public, for example issue #80682 about audit findings in the 33.0.0 release.

Should you run npm audit fix - force?

No, not on a WordPress build toolchain. In our test, npm audit fix --force proposed fixing the 37 findings by installing @wordpress/scripts 35.0.0, a semver-major downgrade from 37.1.0 to a release from September 2026. That swaps known build-time findings for an older toolchain with its own gaps, and it can break your build. Plain npm audit fix is safe because it only moves within the ranges your package.json allows.

When one transitive package has a real fix that the parent has not picked up yet, use npm’s overrides field instead, then run your full build and tests:

{
  "devDependencies": {
    "@wordpress/scripts": "37.1.0"
  },
  "overrides": {
    "serialize-javascript": "^7.1.3"
  }
}

In our test project that override moved serialize-javascript from 6.0.2 to 7.1.4, cleared its three advisories, and a minimal wp-scripts build still compiled. A minimal build does not exercise every plugin path, so test your real blocks before you commit an override across a major version.

What changed in npm 12 for install scripts?

npm 12.0.0, released on 8 July 2026, blocks dependency lifecycle scripts by default. A dependency’s preinstall, install and postinstall scripts (and prepare for git and tarball sources) only run if your root package.json lists that package in a new allowScripts field. The same release set allow-git and allow-remote to none, so git and tarball-URL dependencies are refused unless you opt in. Source: the npm 12.0.0 release notes.

This matters because install scripts are how most of the attacks in the table above ran. With scripts blocked, a malicious version can still land in node_modules, but it does not get to execute just because you installed it.

We ran npm 12.2.2 against the same @wordpress/scripts 37.1.0 tree. Three packages wanted to run install scripts:

npx npm@12.2.2 install-scripts ls
# 3 packages have install scripts blocked because they are not covered by allowScripts:
#   @parcel/watcher@2.6.0 (install: node-gyp rebuild)
#   core-js@3.51.0 (postinstall: node -e "try{require('./postinstall')}catch(e){}")
#   core-js-pure@3.51.0 (postinstall: node -e "try{require('./postinstall')}catch(e){}")

Review each one, then record the decision. npm install-scripts approve writes version-pinned entries by default, so a future version needs a fresh review. npm install-scripts deny records a permanent no. The result lives in package.json and goes into version control with the lockfile:

{
  "allowScripts": {
    "@parcel/watcher@2.6.0": true,
    "core-js": false,
    "core-js-pure": false
  }
}

Check the entries against your own tree with npm install-scripts ls rather than copying ours, because versions change with every toolchain release. The npm install-scripts documentation covers the pin rules and the prune subcommand.

How do you check whether your plugin uses an affected package?

When an advisory names a package, you want to know three things fast: is it in my tree, which version, and who pulled it in. npm has a command for each, and all of them read your installed tree without changing it.

# checked on 18 November 2026 against a clean @wordpress/scripts 37.1.0 install
npm ls debug --all          # every copy: we found debug 2.6.9, 3.2.7 and 4.4.3
npm explain chalk           # why it is there: chalk@^4.1.1 from @wordpress/scripts
npm query ':attr(scripts, [postinstall])'   # packages with a postinstall script
npm query ':attr(scripts, [install])'       # packages with an install script

In our test tree the debug copies were 2.6.9, 3.2.7 and 4.4.3. None of those is the malicious 4.4.2 from GHSA-4x49-vf9v-38px, and 4.4.3 is the fixed release. chalk resolved to 4.1.2, nowhere near the bad 5.6.1. The two query lines found core-js and core-js-pure with postinstall scripts and @parcel/watcher with an install script, the same three packages npm 12 flagged.

If an affected version does show up, work through it in this order:

  • Stop installing. Do not run another npm install on that project until the lockfile is fixed, or you may pull the bad version onto another machine.
  • Find the parent. npm explain tells you which direct dependency brought it in. Upgrade that parent if a clean release exists, or pin the transitive package with overrides.
  • Rebuild from scratch. Delete node_modules, regenerate the lockfile, run npm ci and confirm with npm ls that the bad version is gone.
  • Rotate secrets if the bad version was ever installed. If its install script ran, assume every token in that environment is known to someone else.
  • Check your release history. If a zip was built while the bad version was installed, rebuild it on a clean machine and compare the files before deciding whether customers need an update.

The same three commands answer the routine question of why a package is in your tree at all. A surprising number of build trees carry two or three major versions of the same library because different tools pin different ranges, and that is normal for a toolchain of 1,294 packages.

Why do lockfiles matter so much for npm security?

A lockfile is the reason a hijacked version published at 3 pm does not reach a build you run at 4 pm. package-lock.json records the exact version and an integrity hash for every package in the tree. npm ci installs exactly that, fails if package.json and the lockfile disagree, and never rewrites the lockfile.

  • Commit package-lock.json. A plugin repo without one resolves fresh versions on every machine and every CI run.
  • Use npm ci everywhere except when you mean to change dependencies. npm install can update the lockfile; npm ci cannot.
  • Review lockfile diffs. A pull request that changes 400 lines of lockfile for a one-line package.json change deserves a look. Watch for registry URLs that are not registry.npmjs.org.
  • Wait before you adopt. Letting automated update pull requests age a few days before merging costs little and gives maintainers and scanners time to spot a bad release.
  • Note the npm 12 change. npm 12 dropped npm-shrinkwrap.json support; rename it to package-lock.json if an old project still has one.

What are npm provenance and trusted publishing?

They answer “was this package really built from that repository?”. Provenance is a signed statement, attached when a package is published from a supported CI system, that links the tarball to the source commit and the workflow that built it. npm audit signatures checks registry signatures and provenance attestations for your installed tree; in our test, all 1,245 installed packages had verified registry signatures and 282 also had verified attestations.

Trusted publishing goes a step further for maintainers. Instead of storing a long-lived npm token as a CI secret, the CI job proves its identity to npm with OIDC. It became generally available on 31 July 2025. After the 2025 attacks, npm also revoked all classic tokens and moved local publishing to short-lived sessions.

Most BuddyPress plugin developers never publish to npm, so the practical takeaway is on the consuming side: prefer packages that publish with provenance, and treat a sudden release without it from a package that normally has it as a warning sign.

Does npm security matter if your plugin ships as a zip?

Yes, but the risk sits in a different place than many developers think. What ships in a typical block plugin is the compiled build/ folder: your own code plus whatever runtime libraries webpack bundled into it. WordPress packages such as @wordpress/element are not bundled; @wordpress/scripts externalises them to the copies WordPress core loads. So the shipped attack surface is small.

The bigger exposure is the developer machine and the CI runner. That is where your WordPress.org SVN credentials, GitHub tokens, SSH keys and licence server keys live, and that is what the advisories for the 2025 and 2026 malware (TanStack’s, for one) say the code went after. A compromised build machine can also inject code into the zip you upload, which turns your plugin into the next supply chain incident. Keep these checks in mind:

  • Never ship node_modules or src maps you did not mean to. Use a .distignore or an explicit build script, and open the zip before release.
  • Audit what you bundle. Run npm audit --omit=dev and make sure runtime libraries you import are in dependencies, not devDependencies, so that audit sees them.
  • Build in CI from a clean checkout. A laptop with a dozen old projects and global packages is a poor release machine.
  • Keep secrets out of reach of install scripts. Do not export SVN or deploy credentials in the shell profile your npm installs run under.

The PHP side of a BuddyPress plugin has its own risks, covered by escaping, nonces and capability checks in your hooks and REST endpoints. Our BuddyPress hooks cheat sheet and BuddyPress REST API guide show where those checks belong.

Common mistakes people report

These come up repeatedly in the npm and Gutenberg issue trackers, checked on 18 November 2026.

  • Treating a red audit on @wordpress/scripts as a shipped vulnerability. Reports such as #63771 (2024) and #80682 (2026) are about build-time dependencies. Check npm audit --omit=dev before you file a bug or delay a release.
  • Running npm audit fix - force. On our test project it proposed a major downgrade of the whole toolchain. Use plain npm audit fix or a targeted override.
  • Setting ignore-scripts=true and then adopting npm 12 allowScripts. With ignore-scripts in .npmrc, the approval tooling finds nothing to approve and approved scripts still do not run, as reported in npm/cli #9450. Pick one mechanism.
  • Assuming allowScripts covers git dependencies fully. Open reports show a git dependency’s prepare script slipping past the policy (npm/cli #10305). Avoid git dependencies in plugin builds, which npm 12 refuses by default anyway.
  • Lockfiles that break across operating systems. A lockfile written on one machine can fail npm ci elsewhere when platform-specific optional packages are missing (npm/cli #10043). Generate the lockfile with the npm version your CI uses.
  • React peer dependency errors after an update. Mixing React 19 package versions with older @wordpress/* packages caused resolution errors (Gutenberg #78789). Update the @wordpress packages together, not one at a time.

A secure npm workflow for BuddyPress block plugins

Here is the routine our team follows on our own community plugins, checked on 18 November 2026. It takes a few minutes per release.

  • Pin the toolchain: an exact @wordpress/scripts version in devDependencies, a committed package-lock.json, and an engines field matching the Node versions it supports (37.1.0 declares Node ^22.22.2, ^24.15.0 or 26 and later).
  • Install with npm ci locally and in CI. Run npm install only when you intend to change dependencies, and review the lockfile diff.
  • On npm 12, review npm install-scripts ls and commit allowScripts decisions. On older npm, consider --ignore-scripts for installs and run any needed rebuild deliberately.
  • Run npm audit --omit=dev as a release gate and npm audit signatures as a sanity check. Read the full audit, but do not let build-only ReDoS findings block a release.
  • Turn on Dependabot or Renovate security updates and let non-urgent version bumps wait a few days before merging.
  • Subscribe to malware advisories for your direct dependencies. When one appears, delete node_modules, reinstall from a known-good lockfile, and rotate every token the affected machine could read.
  • Build release zips in CI from a clean checkout, then unzip and inspect the result before uploading.

If you are adding AI features to a plugin, the same discipline applies to the new SDKs you pull in; our guide on adding AI to a WordPress website covers the WordPress side. And on large community sites, keeping the shipped JavaScript small pays off in speed as well as security, as our BuddyPress performance guide explains.

Frequently asked questions

Is npm audit enough to keep a WordPress plugin safe?

No. It only reports advisories that already exist, and a malicious version can be live before anyone files one. Combine audit with a lockfile, npm ci, blocked install scripts and secret rotation when a malware advisory hits a package you use.

Should I worry about high-severity findings in @wordpress/scripts?

Check whether they are dev dependencies first. In our 18 November 2026 test, all 37 findings in a clean 37.1.0 install were build-time only and npm audit --omit=dev reported none. Update the toolchain when a new release lands, and do not downgrade it to silence audit.

What do I do if a malicious version was installed on my machine?

Remove the package version, delete node_modules, reinstall from a lockfile you trust, and rotate every credential the machine could reach: npm, GitHub, SSH, cloud and WordPress.org SVN. Then read the advisory for anything else it says to check.

Do I need npm 12?

You do not have to upgrade today, but its default of blocking dependency install scripts closes the most common attack path. npm 12 needs Node ^22.22.2, ^24.15.0 or 26 and later. Test it on one project first, because unknown CLI flags now fail instead of warning.

Does any of this apply to BuddyPress itself?

BuddyPress is a PHP plugin and its own security issues are tracked as WordPress plugin advisories, not npm ones. This guide is about your build toolchain. For the state of the BuddyPress project, see our honest assessment of BuddyPress in 2026.

The short version: lock it, install it with npm ci, keep install scripts on a short leash, and judge audit findings by what actually ships. That handles most of the npm risk a BuddyPress plugin developer faces.

Part of the Wbcom Designs family

The all-in-one WordPress community stack

Also ours: wbcomdesigns.comvapvarun.combrndle.com