You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Security] cli-columns and cli-table3 have dependencies to vulnerable packages #3785
Also running into this same issue. Looking at the attached PR will this issue not be addressed until version 8 since cli-columns doesn't support Node 10?
Also ran into this due to npm itself being dependent on it. Decided to add it to the CVE ignore list after confirming no other occurrences of the vulnerable issue
Also note that versions 3.0.0 - 5.0.0 and 6.0.0 are affected, issue was fixed in 5.0.1 and 6.0.1.
This report mentions ansi-regex version as bundled with current npm version 7, 8, and latest. However, version 6, that is bundled with current nodejs versions, has even more copies of ansi-regex. Here is the current status:
npm 8.1.0 continues to install vulnerable versions of ansi-regex package - namely, @5.0.0, @2.1.1, and @3.0.0 - which results in the base Docker image being flagged by container security software.
Would it be possible to upgrade all dependencies to use ansi-regex@5.0.1?
Thanks!
Reacted by Curtis Bridges, guomeng306, Khushboo Soni, Ging, Derek Schinke, TEXION TECH and Ivo
Giving this another bump as this issue is persisting in our CI pipeline's security scan. Any attention to fixing this will make a lot of people happy ❤️
PS. We use trivy for our security scans
Reacted by Joacim de la Motte, Renno Reinurm, guomeng306, Denis Jackowski and TEXION TECH
@MartinFalatic "a CVE exists" does not mean "a vulnerability exists". Most CVEs are false positives, and unless these vulnerabilities are exploitable via npm, it's not actually a vulnerability.
An actual vulnerability is a concern - a false positive CVE warning should not be. (i'm not making any assertions about these CVEs/vulnerabilities specifically, just speaking in general terms)
@MartinFalatic the thing here is how often do you need to have NPM in your final image? IHMO it is not a hack to remove it, but a good practice of not installing development dependencies in your production environment. NPM itself is the development dependency.
I have verified that updating globally to the latest npm version (v8.5.4) on the Dockerfile also does the trick. The security vulnerabilities disappeared.
FROM node:16-alpine3.15
...
RUN npm -g npm@8.5.4
...
Activity
Izook commentedon Oct 7, 2021
Also running into this same issue. Looking at the attached PR will this issue not be addressed until version 8 since
cli-columnsdoesn't support Node 10?ckcr4lyf commentedon Oct 7, 2021
Also ran into this due to npm itself being dependent on it. Decided to add it to the CVE ignore list after confirming no other occurrences of the vulnerable issue
thoger commentedon Oct 13, 2021
Note that the ansi-regex upstream PR and commit for CVE-2021-3807 are:
chalk/ansi-regex#37
chalk/ansi-regex@8d1d7cd
Also note that versions 3.0.0 - 5.0.0 and 6.0.0 are affected, issue was fixed in 5.0.1 and 6.0.1.
This report mentions ansi-regex version as bundled with current npm version 7, 8, and latest. However, version 6, that is bundled with current nodejs versions, has even more copies of ansi-regex. Here is the current status:
latest and v8.0.0:
./node_modules/string-width/node_modules/ansi-regex/package.json: "version": "3.0.0", -- affected
./node_modules/ansi-regex/package.json: "version": "2.1.1", -- notaffected
./node_modules/cli-table3/node_modules/ansi-regex/package.json: "version": "5.0.0", -- affected
./node_modules/cli-columns/node_modules/ansi-regex/package.json: "version": "5.0.1", -- fixed
v7.24.2:
./node_modules/string-width/node_modules/ansi-regex/package.json: "version": "3.0.0", -- affected
./node_modules/ansi-regex/package.json: "version": "2.1.1", -- notaffected
./node_modules/cli-table3/node_modules/ansi-regex/package.json: "version": "5.0.0", -- affected
v6.14.15
./node_modules/wrap-ansi/node_modules/ansi-regex/package.json: "version": "4.1.0" -- affected
./node_modules/string-width/node_modules/ansi-regex/package.json: "version": "3.0.0" -- affected
./node_modules/ansi-regex/package.json: "version": "2.1.1", -- notaffected
./node_modules/yargs/node_modules/ansi-regex/package.json: "version": "4.1.0" -- affected
./node_modules/cliui/node_modules/ansi-regex/package.json: "version": "4.1.0" -- affected
The above covers versions that can be found in the respective git tags or branches.
panayiod44 commentedon Oct 18, 2021
Is there any plan to fix this in npm v6 ?
f2404 commentedon Nov 8, 2021
Hello,
Following this bug report: nodejs/docker-node#1574 (comment)
npm 8.1.0 continues to install vulnerable versions of ansi-regex package - namely, @5.0.0, @2.1.1, and @3.0.0 - which results in the base Docker image being flagged by container security software.
Would it be possible to upgrade all dependencies to use ansi-regex@5.0.1?
Thanks!
guomeng306 commentedon Nov 22, 2021
Hello,
We got same issue,too.
nodejs team asked us to open issue here.
nodejs/node#40853
Thanks a lot.
skhushboo-vm commentedon Nov 23, 2021
Hello Team,
Can you please upgrade npm to use fixed ansi-regex?
Also, kindly inform if any timelines are there for this?
Thanks,
Khushboo Soni
VMware
psandeep09 commentedon Nov 24, 2021
We got same issue.
dennismeister93 commentedon Nov 26, 2021
Same here with using base docker image node:16-alpine
dmce2009 commentedon Dec 17, 2021
Hi npm Team,
Kindly let us know the timeline for fixing this issue.
Thanks,
Omkar
Oracle
nachtwerk commentedon Jan 4, 2022
Giving this another bump as this issue is persisting in our CI pipeline's security scan. Any attention to fixing this will make a lot of people happy ❤️
PS. We use
trivyfor our security scanshi-artem commentedon Jan 6, 2022
For anyone blocked by this issue. Don't use NPM in your final container image.
Here is an example of Dockefile with multistage build based on Alpine:
This will make your scanners happy 😊
f2404 commentedon Jan 6, 2022
We ended up uninstalling npm from the final image:
nachtwerk commentedon Jan 6, 2022
@hi-artem Thanks, this is the solution we've opted for
MartinFalatic commentedon Jan 6, 2022
It would be good to see high vulnerabilities in NPM fixed in a timely fashion, whether or not some deployments can hack NPM out of the equation.
ljharb commentedon Jan 6, 2022
@MartinFalatic "a CVE exists" does not mean "a vulnerability exists". Most CVEs are false positives, and unless these vulnerabilities are exploitable via npm, it's not actually a vulnerability.
An actual vulnerability is a concern - a false positive CVE warning should not be. (i'm not making any assertions about these CVEs/vulnerabilities specifically, just speaking in general terms)
hi-artem commentedon Jan 6, 2022
@MartinFalatic the thing here is how often do you need to have NPM in your final image? IHMO it is not a hack to remove it, but a good practice of not installing development dependencies in your production environment. NPM itself is the development dependency.
wraithgar commentedon Mar 9, 2022
Closed in v8.5.2 thanks @lukekarrys
franher commentedon Mar 15, 2022
I have verified that updating globally to the latest npm version (v8.5.4) on the Dockerfile also does the trick. The security vulnerabilities disappeared.
vanta commentedon Aug 17, 2022
@wraithgar Is it possible to backport it to version
6.x?c3ivodujmovic commentedon Sep 15, 2022
The earlier assessments of fix incompatibility with npm 6 are probably no longer true, as the fixed ansi-regex is in npm@6.14.17 via yargs@14.2.3/cliui@5.0.0
so we just need to upgrade cli-columns to version with strip-ansi@5
@wraithgar @Izook do you agree? Thanks!