Vulnerabilities in pkg:npm/posthog-js
PACKAGECVE-2023-32325 is a MODERATE (CVSS 5.4) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Posthog js libraries in the npm ecosystem. The issue involves potential for cross-site scripting in posthog-js. Remediation is available by upgrading affected packages to version 1.57.2.
pkg:npm/posthog-js
Vulnerability advisories affecting package pkg:npm/posthog-js. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-8775-5hwv-wr6v | CVE-2023-32325 | MODERATE | Potential for cross-site scripting in PostHog-js |
CVE-2023-32325 at a Glance
Security Impact
CVSS: 5.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2023-32325
To remediate this vulnerability, upgrade all affected Posthog js 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 posthog-js@1.57.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls posthog-js
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2023-32325, inspect your project dependencies using npm:
npm ls posthog-js
Analyze the terminal output to locate any version of Posthog js in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.57.2), your application is affected.
Note: The npm ls posthog-js 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Posthog js, 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-2023-32325 Affected Posthog js Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
posthog-js
|
npm |
< 1.57.2
|
1.57.2
|
References
Frequently Asked Questions
What is CVE-2023-32325?
Which Posthog js versions are affected?
What version fixes CVE-2023-32325?
Is posthog-js affected?
What is the CVSS score of CVE-2023-32325?
What CWE is associated with CVE-2023-32325?
How can I check npm dependencies for CVE-2023-32325?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8775-5hwv-wr6v",
"modified" : "2023-05-29T16:13:02Z",
"published" : "2023-05-22T20:35:03Z",
"aliases" : [ "CVE-2023-32325" ],
"summary" : "Potential for cross-site scripting in PostHog-js",
"details" : "### Impact\n\nPotential for cross-site scripting in `posthog-js`.\n\n### Patches\n\nThe problem has been patched in `posthog-js` version 1.57.2.\n\n### Workarounds\n\n- This isn't an issue for sites that have a Content Security Policy in place.\n- Using the HTML tracking snippet on PostHog Cloud always guarantees the latest version of the library – in that case no action is required to upgrade to the patched version.\n\n### References\n\nWe will publish details of the vulnerability in 30 days as per our [security policy](https://posthog.com/handbook/company/security#policies).\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "posthog-js"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.57.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/PostHog/posthog-js/security/advisories/GHSA-8775-5hwv-wr6v"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-32325"
}, {
"type" : "WEB",
"url" : "https://github.com/PostHog/posthog-js/pull/630"
}, {
"type" : "WEB",
"url" : "https://github.com/PostHog/posthog-js/commit/67e07eb8bb271a3a6f4aa251382e4d25abb385a0"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/PostHog/posthog-js"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-05-22T20:35:03Z",
"nvd_published_at" : "2023-05-27T00:15:09Z"
}
}