昨天看到 typecho 爆漏洞,于是今天上班就看了一下 typecho 的源码:
1、发现 mysqli 的适配器 quote 只是简单的替换了单引号
https://github.com/typecho/typecho/blob/93bcd46d5594b2e0066896105834fb4d6a45cd4c/var/Typecho/Db/Adapter/Mysqli.php#L117
2、https://github.com/typecho/typecho/blob/93bcd46d5594b2e0066896105834fb4d6a45cd4c/var/Typecho/Db/Adapter/Mysqli.php#L131 这里用了 real_escape_string,而官方的文档 http://php.net/manual/en/mysqli.real-escape-string.php 说需要先调用一下 mysqli_set_charset() 才安全
我也不是搞渗透的,一时半会儿拿不出 poc,问一下这样安全么?