6.5medium
Oceanic allows unsanitized user input to lead to path traversal in URLs
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.75% (higher than 51% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-5h5v-hw44-f6gg
Description
Oceanic is a NodeJS library for interfacing with Discord. Prior to version 1.10.4, input 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. Version 1.10.4 fixes this issue. Some workarounds are available. One may sanitize user input, ensuring strings are valid for the purpose they are being used for. One may also encode input with `encodeURIComponent` before providing it to the library.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| OceanicJS Oceanic | < 1.10.4 | CVE List |
| oceanic.js (npm) | before 1.10.4 | GitHub Advisory Database |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N |
| GitHub | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N |
Classification
What each source says
CVE List
Oceanic is a NodeJS library for interfacing with Discord. Prior to version 1.10.4, input 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. Version 1.10.4 fixes this issue. Some workarounds are available. One may sanitize user input, ensuring strings are valid for the purpose they are being used for. One may also encode input with `encodeURIComponent` before providing it to the library.
GitHub Advisory Database
Impact
Input 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.
Workarounds
- Sanitizing user input, ensuring strings are valid for the purpose they are being used for.
- Encoding input with
encodeURIComponentbefore providing it to the library.
References
OceanicJS/Oceanic@8bf8ee8373b8c565fbdbf70a609aba4fbc1a1ffe
NVD (es)
Oceanic es una librería NodeJS para interactuar con Discord. Antes de la versión 1.10.4, la entrada a funciones como `Client.rest.channels.removeBan` no está codificada en URL, lo que generaba entradas especialmente manipuladas como `../../../channels/{id}` normalizarse en la URL `/api/v10/channels/{id}` y eliminar un canal en lugar de eliminar una prohibición. La versión 1.10.4 soluciona este problema. Algunas soluciones están disponibles. Se pueden desinfectar las entradas del usuario, asegurándose de que las cadenas sean válidas para el propósito para el que se utilizan. También se puede codificar la entrada con `encodeURIComponent` antes de proporcionarla a la librería.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-34712 changed 2024-08-02 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-5h5v-hw44-f6gg changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2024-34712 changed 2026-06-17 | Public domain |