ajv-cli icon indicating copy to clipboard operation
ajv-cli copied to clipboard

fix: update `fast-json-patch` for security

Open G-Rath opened this issue 3 years ago • 16 comments

Resolves #225 Resolves #229 Resolves GHSA-8gh8-hqwg-xf34

@epoberezkin let me know if you need any help with getting this landed ~it'll also want #218 or similar to fix CI, and it seems like there's a few dev dependencies that could be cleaned up which I'm happy to do after both of these have been landed.~ - I've ended up just pulling in the TypeScript changes required to get CI green.

G-Rath avatar Jan 08 '23 20:01 G-Rath

@epoberezkin friendly bump :)

G-Rath avatar Feb 15 '23 18:02 G-Rath

To fix the build failures you need to pin typescript to ~4.1.2 e.g. @G-Rath

I also think package-lock.json should be commited and the pipeline should use npm ci, but that might be out-of-scope here. Fixing the security issue is more pressing.

bodograumann avatar Apr 12 '23 08:04 bodograumann

@bodograumann fixing ci is out of scope here too - there's already #218 open for that

G-Rath avatar Apr 12 '23 09:04 G-Rath

@epoberezkin I've cherry-picked the TypeScript changes done by @thomastoye over in #218 so now CI is passing, and this should be good to land as-is

G-Rath avatar May 16 '23 19:05 G-Rath

Any updates? Why it is not merged?

"module_name": "fast-json-patch" "severity": "high" "github_advisory_id": "GHSA-8gh8-hqwg-xf34"

  • "updated": "2023-06-12T23:48:12.000Z"
  • "recommendation": "Upgrade to version 3.1.1 or later"
  • "references": "- https://nvd.nist.gov/vuln/detail/CVE-2021-4279\n- https://github.com/Starcounter-Jack/JSON-Patch/pull/262\n- https://github.com/Starcounter-Jack/JSON-Patch/commit/7ad6af41eabb2d799f698740a91284d762c955c9\n- https://github.com/Starcounter-Jack/JSON-Patch/releases/tag/3.1.1\n- https://blog.effectrenan.com/pwn2win-2021-illusion-web-challenge/\n- https://www.huntr.dev/bounties/1-npm-fast-json-patch/\n- https://github.com/advisories/GHSA-8gh8-hqwg-xf34"
  • "overview": "A vulnerability has been found in Starcounter-Jack JSON-Patch up to 3.1.0 and classified as problematic. This vulnerability affects unknown code. The manipulation leads to improperly controlled modification of object prototype attributes ('prototype pollution'). The attack can be initiated remotely. The exploit has been disclosed to the public and may be used. Upgrading to version 3.1.1 can address this issue. The name of the patch is 7ad6af41eabb2d799f698740a91284d762c955c9. It is recommended to upgrade the affected component. VDB-216778 is the identifier assigned to this vulnerability."

Vulnerable advisories are: GHSA-8gh8-hqwg-xf34

benriemer avatar Jun 16 '23 16:06 benriemer

@epoberezkin could we get this landed and released?

G-Rath avatar Jul 11 '23 03:07 G-Rath

@epoberezkin could we get this landed and released?

We have to contemplate the idea that a project with little to no updates that has been ignoring for the past half year a tiny patch fixing a security issue may be in fact an abandoned project. 😔

iebold avatar Aug 07 '23 05:08 iebold

@epoberezkin it would be good if we could get this reviewed and released :)

G-Rath avatar Oct 01 '23 18:10 G-Rath

@G-Rath Thank you for creating this PR. Let's see if this can be reviewed and merged.

jpcano-intellegens avatar Nov 09 '23 14:11 jpcano-intellegens

This project seems utterly unmaintained. We should think about creating a fork...

bodograumann avatar Nov 09 '23 14:11 bodograumann

@epoberezkin reminder about this - I'm also happy to help with the general maintenance of this cli if you like.

G-Rath avatar Jan 17 '24 17:01 G-Rath

I just posted to twitter for the first time in forever to hopefully get @epoberezkin's attention. He's obviously proud of his work since his profile there says "Created Ajv #JSON validator used by millions of JS apps."

Maybe @ChALkeR can merge, though?

hexmode avatar Mar 28 '24 19:03 hexmode

until this is not merged you can use this workaround:

diff --git a/package.json b/package.json
index 2dfa265..1efb2ff 100644
--- a/package.json
+++ b/package.json
@@ -8,5 +8,9 @@
   "description": "",
   "dependencies": {
     "ajv-cli": "^5.0.0"
+  },
+  "overrides": {
+    "fast-json-patch": "3.1.1"
   }
+
 }

ref https://docs.npmjs.com/cli/v10/configuring-npm/package-json#overrides

mrl5 avatar May 17 '24 15:05 mrl5

@epoberezkin Please fix?

While the ajv package properly maintained with new releases from time to time, I find it sad that its CLI seems abandoned - even security vulnerabilities are not longer mitigated.

Remarks: The ajv package generates and evaluates JavaScript code at runtime. This is - or should be - a security concern for most modern JavaScript-based software.

To utilize the great features of ajv in secure, production-ready LOB software, the CLI is required to generate code at compile time instead of evaluating at runtime. And security vulnerabilities in 3rd party packages are not acceptable here.

Please fix this security vulnerability soon!

josundt avatar Aug 01 '24 09:08 josundt

Is this update going to be accepted? If not, could someone confirm if ajv-cli has been abandoned or not? We need to move to something else if this can't be fixed.

tdriley avatar Jan 08 '25 15:01 tdriley

With the last commit 4 years old and no reaction on critical security issues, I think we can say it is definitely dead. Looking at the fork network, this seems to be a somewhat active fork:

https://github.com/jirutka/ajv-cli

Maybe we can converge on that?

bodograumann avatar Jan 08 '25 16:01 bodograumann