GitHub Advisory Database
GHSA-5h5v-hw44-f6gg
Oceanic allows unsanitized user input to lead to path traversal in URLs
Details
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
Affected packages
| Ecosystem | Package | Affected versions |
|---|---|---|
| npm | oceanic.js | All versions before 1.10.4 (fixed in 1.10.4) |