Connector/C++ string escaper re-escapes its own output, enabling SQL injection
该报告还没有中文解读。
原文摘录
摘自原文(8459 字符中的一小部分)
Utils::escapeString is the escaper behind every identifier and literal that MariaDbDatabaseMetaData interpolates into the information_schema queries it builds. It is implemented on top of sql::mariadb::replace, whose inner loop advances its search cursor by the length of the substitution instead of …
原文中的代码
SQLString& replaceInternal(SQLString& str, const SQLString& _substr, const SQLString &subst)
{
size_t pos= 0, prev= 0;
...
while ((pos= real.find(substr, prev)) != std::string::npos)
{
real.replace(pos, substr.length(), realSub);
prev+= realSub.length();
}默认不展示报告全文。以上为简短摘录,完整复现过程请阅读原文。版权归研究员与 MariaDB 所有。
时间线
- 报告提交
- 公开披露
阅读 HackerOne 原文 ↗作者 @fg0x0 · 版权归作者与 MariaDB 所有