Package: @discordjs/opus
Tested Version: 0.9.0
GitHub Repository: https://github.com/discordjs/opus
Vulnerability: Denial of Service (DoS)
Providing an input object with a property toString
to several different functions (see below) can lead to a process crash (i.e., Denial of Service - DoS).
Vulnerable code:
new OpusEncoder
: https://github.com/discordjs/opus/blob/814e500c2785c5207ace19650192629beba2728b/src/node-opus.cc#L47setBitrate
: https://github.com/discordjs/opus/blob/814e500c2785c5207ace19650192629beba2728b/src/node-opus.cc#L182applyEncoderCTL
: https://github.com/discordjs/opus/blob/814e500c2785c5207ace19650192629beba2728b/src/node-opus.cc#L148applyDecoderCTL
: https://github.com/discordjs/opus/blob/814e500c2785c5207ace19650192629beba2728b/src/node-opus.cc#L165
Similar issue (including a fix commit):
Tested on:
Ubuntu 22.04.3 LTS
Node v18.19.0
Installation:
npm i @discordjs/opus
Usage:
node poc.js <poc1|poc2|poc3|poc4>
- poc1
node poc.js poc1
Running poc1
FATAL ERROR: Error::New napi_get_last_error_info
...
Aborted (core dumped)
- poc2
node poc.js poc2
Running poc2
FATAL ERROR: Error::New napi_get_last_error_info
...
Aborted (core dumped)
- poc3
node poc.js poc3
Running poc3
FATAL ERROR: Error::New napi_get_last_error_info
...
Aborted (core dumped)
- poc4
node poc.js poc4
Running poc4
FATAL ERROR: Error::New napi_get_last_error_info
...
Aborted (core dumped)
Denial of Service (DoS)
Alessio Della Libera