Vulnerabilities in pkg:npm/oceanic.js
PACKAGECVE-2024-34712 is a MODERATE (CVSS 6.5) path traversal vulnerability (CWE-23: Relative Path Traversal) affecting Oceanic.js libraries in the npm ecosystem. The issue involves oceanic allows unsanitized user input to lead to path traversal in urls. Remediation is available by upgrading affected packages to version 1.10.4.
pkg:npm/oceanic.js
Vulnerability advisories affecting package pkg:npm/oceanic.js. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-5h5v-hw44-f6gg | CVE-2024-34712 | MODERATE | Oceanic allows unsanitized user input to lead to path traversal in URLs |
CVE-2024-34712 at a Glance
Security Impact
CVSS: 6.5
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:N).
How to Fix CVE-2024-34712
To remediate this vulnerability, upgrade all affected Oceanic.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 oceanic.js@1.10.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls oceanic.js
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-34712, inspect your project dependencies using npm:
npm ls oceanic.js
Analyze the terminal output to locate any version of Oceanic.js in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.10.4), your application is affected.
Note: The npm ls oceanic.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-23: Relative Path Traversal, where the product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory. In Oceanic.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-2024-34712 Affected Oceanic.js Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
oceanic.js
|
npm |
< 1.10.4
|
1.10.4
|
References
Frequently Asked Questions
What is CVE-2024-34712?
Which Oceanic.js versions are affected?
What version fixes CVE-2024-34712?
Is oceanic.js affected?
What is the CVSS score of CVE-2024-34712?
What CWE is associated with CVE-2024-34712?
How can I check npm dependencies for CVE-2024-34712?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5h5v-hw44-f6gg",
"modified" : "2024-05-14T20:13:58Z",
"published" : "2024-05-14T20:13:58Z",
"aliases" : [ "CVE-2024-34712" ],
"summary" : "Oceanic allows unsanitized user input to lead to path traversal in URLs",
"details" : "### Impact\nInput to functions such as `Client.rest.channels.removeBan` is not url-encoded, resulting in specially crafted input such as `../../../channels/{id}` being normalized into the url `/api/v10/channels/{id}`, and deleting a channel rather than removing a ban.\n\n### Workarounds\n* Sanitizing user input, ensuring strings are valid for the purpose they are being used for.\n* Encoding input with `encodeURIComponent` before providing it to the library.\n\n### References\nOceanicJS/Oceanic@8bf8ee8373b8c565fbdbf70a609aba4fbc1a1ffe",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "oceanic.js"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.10.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/OceanicJS/Oceanic/security/advisories/GHSA-5h5v-hw44-f6gg"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-34712"
}, {
"type" : "WEB",
"url" : "https://github.com/OceanicJS/Oceanic/commit/8bf8ee8373b8c565fbdbf70a609aba4fbc1a1ffe"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/OceanicJS/Oceanic"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22", "CWE-23" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-05-14T20:13:58Z",
"nvd_published_at" : "2024-05-14T16:17:26Z"
}
}