CVE-2024-34712
JSON

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 packageVersionsReported by
OceanicJS Oceanic< 1.10.4CVE List
oceanic.js (npm)before 1.10.4GitHub Advisory Database

All scores

GitHub_M6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
GitHub6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Classification

CWE-22CWE-23

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

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 encodeURIComponent before 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

SourceRecordLicence
CVE ListCVE-2024-34712 changed 2024-08-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-5h5v-hw44-f6gg changed 2026-09-10CC-BY-4.0
NVDCVE-2024-34712 changed 2026-06-17Public domain