Vulnerabilities in pkg:npm/@conform-to/zod
PACKAGECVE-2024-32866 is a HIGH (CVSS 8.6) conform contains a prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting @conform to/dom libraries in the npm ecosystem. The issue involves conform contains a prototype pollution vulnerability in `parsewith...` function. Remediation is available by upgrading affected packages to version 1.1.1, 0.9.2.
pkg:npm/@conform-to/zod
Vulnerability advisories affecting package pkg:npm/@conform-to/zod. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-624g-8qjg-8qxf | CVE-2024-32866 | HIGH | Conform contains a Prototype Pollution Vulnerability in `parseWith...` function |
CVE-2024-32866 at a Glance
Security Impact
CVSS: 8.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H).
How to Fix CVE-2024-32866
To remediate this vulnerability, upgrade all affected @conform to/dom dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @conform-to/dom@1.1.1
npm install @conform-to/zod@1.1.1
npm install @conform-to/yup@1.1.1
npm install @conform-to/zod@0.9.2
npm install @conform-to/yup@0.9.2
npm install @conform-to/dom@0.9.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @conform-to/dom
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-32866, inspect your project dependencies using npm:
npm ls @conform-to/dom
Analyze the terminal output to locate any version of @conform to/dom in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.1), your application is affected.
Note: The npm ls @conform-to/dom command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In @conform to/dom, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-32866 Affected @conform to/dom Versions
6 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@conform-to/dom
|
npm |
≥ 1.0.0
< 1.1.1
|
1.1.1
|
|
@conform-to/zod
|
npm |
≥ 1.0.0
< 1.1.1
|
1.1.1
|
|
@conform-to/yup
|
npm |
≥ 1.0.0
< 1.1.1
|
1.1.1
|
|
@conform-to/zod
|
npm |
< 0.9.2
|
0.9.2
|
|
@conform-to/yup
|
npm |
< 0.9.2
|
0.9.2
|
|
@conform-to/dom
|
npm |
< 0.9.2
|
0.9.2
|
References
Frequently Asked Questions
What is CVE-2024-32866?
Which @conform to/dom versions are affected?
What version fixes CVE-2024-32866?
Is @conform-to/dom affected?
Is @conform-to/zod affected?
What is the CVSS score of CVE-2024-32866?
What CWE is associated with CVE-2024-32866?
How can I check npm dependencies for CVE-2024-32866?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-624g-8qjg-8qxf",
"modified" : "2024-06-10T20:12:58Z",
"published" : "2024-04-23T21:15:55Z",
"aliases" : [ "CVE-2024-32866" ],
"summary" : "Conform contains a Prototype Pollution Vulnerability in `parseWith...` function",
"details" : "### Summary\nConform allows the parsing of nested objects in the form of `object.property`. Due to an improper implementation of this feature, an attacker can exploit it to trigger prototype pollution by passing a crafted input to `parseWith...` functions.\n\n### PoC\n```javascript\nconst { parseWithZod } = require('@conform-to/zod');\nconst { z } = require(\"zod\"); \n\nconst param = new URLSearchParams(\"__proto__.pollution=polluted\");\nconst schema = z.object({ \"a\": z.string() });\n\nparseWithZod(param, { schema });\nconsole.log(\"pollution:\", ({}).pollution); // should print \"polluted\"\n```\n\n### Details\n\nThe invocation of the `parseWithZod` function in the above PoC triggers the `setValue` function through `getSubmissionContext` and `parse`, executing the following process, resulting in prototype pollution:\n\n```javascript\nlet pointer = value;\n\npointer.__proto__ = pointer.__proto__;\npointer = pointer.__proto__;\n\npointer.polluted = \"polluted\";\n```\n\nThis is caused by the lack of object existence checking on [line 117 in formdata.ts](https://github.com/edmundhung/conform/blob/59156d7115a7207fa3b6f8a70a4342a9b24c2501/packages/conform-dom/formdata.ts#L117), where the code only checks for the presence of `pointer[key]` without proper validation.\n\n### Impact\nApplications that use conform for server-side validation of form data or URL parameters are affected by this vulnerability.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@conform-to/dom"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "1.1.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.1.0"
}
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@conform-to/zod"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "1.1.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.1.0"
}
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@conform-to/yup"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "1.1.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.1.0"
}
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@conform-to/zod"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.9.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@conform-to/yup"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.9.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@conform-to/dom"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.9.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/edmundhung/conform/security/advisories/GHSA-624g-8qjg-8qxf"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-32866"
}, {
"type" : "WEB",
"url" : "https://github.com/edmundhung/conform/commit/4819d51b5a53fd5486fc85c17cdc148eb160e3de"
}, {
"type" : "WEB",
"url" : "https://github.com/edmundhung/conform/commit/cb604dd58b99e2d12716d901a23bfca724e741ef"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/edmundhung/conform"
}, {
"type" : "WEB",
"url" : "https://github.com/edmundhung/conform/blob/59156d7115a7207fa3b6f8a70a4342a9b24c2501/packages/conform-dom/formdata.ts#L117"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1321" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-04-23T21:15:55Z",
"nvd_published_at" : "2024-04-23T21:15:48Z"
}
}