-
-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backport of security patch, for benefit of yargs #38
Comments
Sure thing, give me a moment. |
Released as |
Hello @yetingli, can you please edit the vulnerability information in Snyk (https://app.snyk.io/vuln/SNYK-JS-ANSIREGEX-1583908) since the vulnerability fix is backported to version 5.0.1? Thanks 😄 |
Hey @bacali95, I don't seem to have permission to edit them. Hi Colin @colin-ife-snyk, can you please edit the vulnerability information? Thanks a lot! |
No problem. Will be updated later today. |
Thanks a lot @yetingli @colin-ife-snyk 🌹 |
The range in the report says |
GitHub Advisory Database still lists this package as affected for Anyone knows how to update that information as well? This page https://docs.github.com/en/code-security/security-advisories/creating-a-security-advisory suggest the repo owner should be able to edit this information. |
* Upgrade NPM deps * Upgrade all to latest versions * Fix CVE-2021-3807 refs.: * https://github.com/chalk/ansi-regex/releases/tag/v5.0.1 * chalk/ansi-regex#38
I've raised the affected field on Github Securitylab discussion as well: github/securitylab#436 |
@Qix- thank you very much for the back port 😄, I know this can be a pain in the neck to do. |
No problem at all, glad I could help :) |
I have confirmed now that this vulnerability exists in v4.1.0, v4.0.0, v3.0.0, but not v2.1.1 and lower. |
@yetingli For future reports, please include the affected version range, and a regression test if you decide to submit a fix. Thanks :) |
@colin-ife-snyk Can you please update the Snyk report? ⬆️ |
@sindresorhus Thanks for reminding. I will pay attention to this in the future. |
@sindresorhus updated as well now in our (Snyk's) backend - will take a few hours to propagate to prod. Thanks! |
@sindresorhus @Qix- what would the chances be of getting patches for v4 & v3? I really wish I didn't have to ask, but it seems that currently
I'm happy to do as much as the work as possible to reduce the load off you if that would make it easier :) |
@G-Rath I think you would be good with the same approach I took, although hacky one: openshift-knative/serverless-operator@308e061 |
@cardil cheers, that's a good workaround for the short-term but I'd like to avoid it if possible since this affects pretty much all of our projects - while I said This is also why I expect it'll take 2-3 years for them to eventually move off the packages that require the v3 & v4 versions of Getting patch releases for these other versions would mean we can avoid having to perpetually ignore these vulnerabilities (or |
imo even 2-3 years is very optimistic. |
Probably not what you want to hear/read, but I've written on backports at-length here: yargs/yargs#1839 (comment) If @sindresorhus feels differently and that a backport is warranted then of course he can veto my decision on that. My viewpoint will still remain, however. |
The sad part is that while I agree with you on the problem, your stance won't actually change the perverse incentives in the ecosystem - it will just cause harm for users. |
I disagree. Incentivizing upgrades is exactly why vulnerability reports are displayed by default on all As I explained in my comment, the vulnerability here is, in all reality, quite low severity. I've explained it a few times already but unless you're passing long, unsanitized user inputs to |
I totally agree; many, many 9's of JS CVEs are false positives due to things like this. Even though it's the security industry to blame, it's still the users who suffer, either by turning off audit warnings (and missing the rare actual vulnerabilities), or by seeing excessive warning output and perhaps being forced to needlessly upgrade things. |
Likewise, backporting this low-risk fix won't solve any of those issues either. In fact, if it forces them to "needlessly" upgrade things, then great. That's kind of the point of iterative development. The CVE report was arguably needless, too. In fact we've historically asked them not to file one and they did it behind our backs anyway. Imagine if Linux or OpenSSL had to backport to all previous major versions. Nothing would ever progress. |
"progress" isn't "dropping a node version" though :-/ aggressively publishing majors that drop node versions is the only reason backports become requested in the first place. I realize that debate isn't likely to go well, or is on topic here, but I still consider that to be the root cause. |
Unfortunately the javascript community has been completely fragmented for the better part of a decade with all of the changes TC-39 makes to the language, the whole Babel+Webpack craze forming this precedent that source transformation is the "norm", and the fact that ESM broke just about everyone. Moving forward means leaving some people behind in this scenario - to support everyone means to incur huge development and maintenance overhead in just about every single repository, bloating package sizes with all of the different supporting files (es5 / esm / typescript types / potentially typescript directly). Conversely, not moving forward means packages rot, or you get rude individuals demanding typescript types, ES modules, etc. There is absolutely no in-between. The truth is, most maintainers I'm aware of (including myself) are insanely tired of supporting all of the different "flavors" of environments people want to support. It's become kind of the expectation that when some new stack comes out, packages that are broken within that stack/environment/framework need to be "fixed" to support them. Personally, I'm tired of it. No other code ecosystem on Earth has this problem. No other group of developers would be okay supporting bitrotted old majors as long as javascript maintainers are expected to. To give you a more concrete answer, @sindresorhus and I generally like to follow the Node LTS release schedule - especially with Chalk, as it's a TTY library and thus focused almost entirely on Node. If you're on a platform that isn't supported by Node anymore, that's your choice. It's not our burden to bear. |
@Qix- I do generally agree with your view on this, but unfortunately it's not something that is always with our control (which greatly frustrates me too, and I know will frustrate you to hear) - while I've spent the last two weeks looking into how we can get things upgraded (including updating libraries to be using higher versions of One of the chief packages that we cannot upgrade is I plan to look into seeing if I can implement support for v4 of wds into v5 of This leaves us in a difficult spot having to deal with this, because while I'd love to do things like try and chuck out This is a situation that frustrates me greatly, because I agree it's not your fault nor your burden to bear, and those who should be bearing it are not; likewise for me, I have to explain to clients and heads-of-securities about how "no it's not actually that big of a risk, it's 'high' because in theory but in reality... etc". This all leads me back to here, asking if it would be possible to get just a v4 bugfix applying the security fix:
Based on my efforts to get libraries upgraded, I've found that the ones I couldn't are typically because they still support Node v6 meaning they're limited to using v4 of |
I know it's a pain in the neck, but would you consider back-porting #37 to the 5.x.x release line, for the benefit of yargs.
Yargs is making the effort during the transition to ESM to support both CJS and ESM, which makes us unable to update to the latest version of
string-width
.If you were willing to make an exception (I know you're pushing folks towards using ESM exclusively) it would be really valuable for yargs users using CJK character sets.
The text was updated successfully, but these errors were encountered: