PHP sessioné¢æ°ç¾¤ã«ã¤ãã¦
ãã£ã¨ãã¾ãåæã¨ãã¦ãsessionã§ä½¿ããæåã¯éå®ããã¦ããã£ã¦ããã®ãããã¾ãã â¦ããã¾ããPHPï¼ç³»(4.3.10ã4.3.11ã4.4.1 ã§ãã§ãã¯)ã¯a-zA-Z0-9ãPHPï¼ç³»(5.0.4ã5.1.1ã§ãã§ãã¯)ã¯a-zA-Z0-9ã®ã»ãã«ãã«ã³ãï¼ã¨ãã¤ãã³âãOKãã£ã¦ããå¾®å¦ãªå·®ç°ãããã®ã§ããâ¦ã¾ãã¨ã«ãããOKãªæåã¨NGãªæåãã£ã¦ã®ãããã¾ãã
ï¼ç³»ã®ã«ã¼ãã³
ï¼ç³»ã®ã«ã¼ãã³
for (p = key; (c = *p); p++) {
/* valid characters are a..z,A..Z,0..9 */
if (!((c >= 'a' && c <= 'z') ||
(c >= 'A' && c <= 'Z') ||
(c >= '0' && c <= '9'))) {
ret = 0;
break;
}
}
â¦â¦â¦ãé話ä¼é¡
for (p = key; (c = *p); p++) {
/* valid characters are a..z,A..Z,0..9 */
if (!((c >= 'a' && c <= 'z')
|| (c >= 'A' && c <= 'Z')
|| (c >= '0' && c <= '9')
|| c == ','
|| c == '-')) {
ret = 0;
break;
}
}
ã§ãã¾ããä¸è¿°ä»¥å¤ã®æåã使ããã¦ããå ´åãé常ãã¢ã¿ãã¯ãã§ãããã¨ãäºæ³ãããã®ã§ãããããããªæåãã»ãã·ã§ã³IDã®æååã§ç¨ããããã¨ãã¨ã©ã¼ããã°ã«åãåºãã¾ããå
·ä½çã«ã¯ã "The session id contains invalid characters, valid characters are only a-z, A-Z and 0-9" ã¨ããã¡ãã»ã¼ã¸ã§ã¨ã©ã¼ãåãåºãã¾ãã
ãã¦ã大æµé常å½ç¶ã®ãã¨ããä¸è¿°ã®ãå¥å¦ãªCookieå¤ãè¨å®ããã¦ããããªã©ã¯ããã°ã©ã ä¸ã§ææãããã¨æãã®ãä¸ã®å¸¸äººã®å¸¸ã¨ãããã®ã ã¨æãã®ã§ãããä¸è¿°ã®ãã°ãåãåºãã¦ããã®ã¯ã php-X.X.X/ext/session/mod_files.c ã¨ãããã¡ã¤ã«ã«ãããps_files_open ã¨ããé¢æ°ã§ãã
static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
復帰å¤ãvoidï¼ããã¯ã復帰ã§ä½ãè¿ããªãããã¨ãæå³ãã¾ããã§ãèå¿ã®ãã§ãã¯é¨åã
ã覧é ãã¦ãããã¨ãã(Cè¨èªèªããããã¨ãããçªã£è¾¼ã¿ã¯ãªãã®æ¹åã§)ãã¹ãã¼ã¿ã¹ããªã«ãä¿åãã¦ãã¾ããããã®æç¹ã§ãinvalidãåå¾ã§ããªããäºãã»ã¼ç¢ºå®ãã¾ãã
if (!ps_files_valid_key(key)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The session id contains invalid characters, valid characters are only a-z, A-Z and 0-9");
return;
}
ãã以å¤ã«ãã¾ããåºæ¬çã«èªè¨¼ç³»ã®æ©è½æ¬ ãã¦ãããããã¨ãè²ã ã¨çªã£è¾¼ã¿ã¯ããã®ã§ããã
â¦ããã£ã¨ãåãåãããåã¯ä½¿ã£ã¦ãªã/èªä½ã§èªè¨¼ç³»ã®ã¯ã©ã¹å®è£ ãã¦ããã¨ã ãè¿°ã¹ã¦ããã¾ã(è¦ç¬