v16 = strcmp_1(REQUEST_URI, "/api/operations/ciscosb-file:form-file-upload"); if (v16 != 0) { v17 = strcmp_1(REQUEST_URI, "/upload"); if (v17 == 0 && HTTP_COOKIE != 0) { // if the URI is /upload and we have a sessionid in the cookie v18 = strlen_1(HTTP_COOKIE); if (v18 < 81) { // sanity check sessionid characters v19 = match_regex("^[A-Za-z0-9+=/]*$", HTTP_COOKIE); if (v19 == 0) { v20 = StrBufToStr(local_0x44); func_0x2684(HTTP_COOKIE, content_destination, content_option, content_pathparam, v20, content_cert_name, content_cert_type, content_password); } } } }
但是在程序没有考虑用户在 HTTP cookie 中传入多个 session_id 的情况
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
if (HTTP_COOKIE != 0) { // if an cookie is available StrBufSetStr(cookie_str, HTTP_COOKIE); __s2 = StrBufToStr(cookie_str); next_semicolon = strtok_r(__s2, ";", &saveptr); // start to split the semicolon deliminated cookie HTTP_COOKIE = 0; // this variable will become the sessionid string while (next_semicolon != 0) { sessionid = strstr(next_semicolon, "sessionid="); if (sessionid != 0) { // advance past "sessionid=" and set the value HTTP_COOKIE = sessionid + 10; // advance past "sessionid=" and set the value } next_semicolon = strtok_r(0, ";", &saveptr); // keep searching } }