Skip to content

Commit 71a52f6

Browse files
committed
COMMON: protect OAuth parsing from all possible input - fixes EOS-6500
1 parent 6ba8eb4 commit 71a52f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

common/OAuth.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ OAuth::Handle(const std::string& info, eos::common::VirtualIdentity& vid)
284284
if (tokens.size() < 5) {
285285
tokens.push_back("");
286286
}
287+
} else {
288+
eos_static_err("msg=\"invalid oauth token provided\" in=\"%s\"", info.c_str());
289+
return "";
287290
}
288291
} else {
289292
tokens.resize(5);
@@ -295,6 +298,7 @@ OAuth::Handle(const std::string& info, eos::common::VirtualIdentity& vid)
295298
}
296299

297300
OAuth::AuthInfo oinfo;
301+
298302
time_t expires = strtoull(tokens[3].c_str(), 0, 10);
299303

300304
if (!Validate(oinfo, tokens[1], tokens[2], tokens[4], expires)) {

0 commit comments

Comments
 (0)