GHSA-5h5v-hw44-f6gg

Suggest an improvement
Source
https://github.com/advisories/GHSA-5h5v-hw44-f6gg
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/05/GHSA-5h5v-hw44-f6gg/GHSA-5h5v-hw44-f6gg.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-5h5v-hw44-f6gg
Aliases
Published
2024-05-14T20:13:58Z
Modified
2024-05-19T02:24:46.835860Z
Severity
  • 6.5 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N CVSS Calculator
Summary
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 encodeURIComponent before providing it to the library.

References

OceanicJS/Oceanic@8bf8ee8373b8c565fbdbf70a609aba4fbc1a1ffe

References

Affected packages

npm / oceanic.js

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.10.4