CVE-2022-29244
nodejs: npm pack ignores root-level .gitignore and .npmignore file exclusion directives when run in a workspace
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · June 13, 2022
Updated · November 21, 2025
Description
A flaw was found in npm. This security issue occurs because the npm pack ignores root-level ".gitignore" and ".npmignore" file exclusion directives when run in a workspace or with a workspace flag (for example, --workspaces, --workspace=<name>). Anyone who has run 'npm pack' or 'npm publish' inside a workspace has published files into the npm registry they did not intend to include. This flaw exposes sensitive information to an unauthorized user or an attacker.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
No mitigation is specified in collected source.
CVSS / CWE
CVSS 3.1 · 7.5CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
CWE-212 · Improper Removal of Sensitive Information Before Storage or Transfer