mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
websocketserver: Validate data type of authentication
payload field
Can cause crash if field is not a string Reported by @tyami94
This commit is contained in:
parent
a792c59699
commit
e797a3fb34
@ -104,6 +104,11 @@ void WebSocketServer::ProcessMessage(SessionPtr session, WebSocketServer::Proces
|
||||
"Your payload's data is missing an `authentication` string, however authentication is required.";
|
||||
return;
|
||||
}
|
||||
if (!payloadData["authentication"].is_string()) {
|
||||
ret.closeCode = WebSocketCloseCode::AuthenticationFailed;
|
||||
ret.closeReason = "Your `authentication` field is not a string.";
|
||||
return;
|
||||
}
|
||||
if (!Utils::Crypto::CheckAuthenticationString(session->Secret(), session->Challenge(),
|
||||
payloadData["authentication"])) {
|
||||
auto conf = GetConfig();
|
||||
|
Loading…
x
Reference in New Issue
Block a user