大语言模型 (LLM) 助力发现 SQLite 数据库引擎中的堆栈缓冲区下溢漏洞,展示了 LLM 在软件安全领域的重要潜力。
原文标题:谷歌内部项目:大模型AI智能体发现了代码漏洞
原文作者:机器之心
冷月清谈:
- 谷歌 Project Zero 团队开发出名为 Big Sleep 的智能体,利用大语言模型 (LLM) 辅助代码漏洞研究。
- Big Sleep 使用变体分析任务,通过提供已修复漏洞信息,帮助识别类似潜在漏洞。
**智能体发现 SQLite 漏洞**
- Big Sleep 在 SQLite 数据库引擎中发现了一个可利用堆栈缓冲区下溢漏洞。
- 该漏洞源于索引类型字段中特殊 sentinel 值的使用,导致函数处理查询时出现错误。
- 值得庆幸的是,该漏洞在正式版本发布前就被发现,用户未受影响。
**LLM 在软件安全中的潜力**
- Big Sleep 的发现凸显了 LLM 在软件安全中的巨大潜力。
- LLM 能够弥补当前自动漏洞发现方法的盲点,识别难以通过传统模糊测试发现的漏洞。
- 这一进展有望显著提高软件安全性。
怜星夜思:
2、Big Sleep 评分模型在准确性和泛化性方面表现如何?
3、除了 SQLite之外,Big Sleep 智能体是否还发现了其他软件中的漏洞?
原文内容
7476: struct sqlite3_index_constraint {
7477: int iColumn; /* Column constrained. -1 for ROWID */
7478: unsigned char op; /* Constraint operator */
7479: unsigned char usable; /* True if this constraint is usable */
7480: int iTermOffset; /* Used internally - xBestIndex should ignore */
7481: } aConstraint; / Table of WHERE clause constraints */
619 static int seriesBestIndex(
620 sqlite3_vtab *pVTab,
621 sqlite3_index_info *pIdxInfo
622 ){
…
630 int aIdx[7]; /* Constraints on start, stop, step, LIMIT, OFFSET,
631 ** and value. aIdx[5] covers value=, value>=, and
632 ** value>, aIdx[6] covers value<= and value< */
633 const struct sqlite3_index_constraint *pConstraint;
…
642 for(i=0; i<pIdxInfo->nConstraint; i++, pConstraint++){
643 int iCol; /* 0 for start, 1 for stop, 2 for step */
644 int iMask; /* bitmask for those column */
645 int op = pConstraint->op;
…
705 iCol = pConstraint->iColumn - SERIES_COLUMN_START;
706 assert( iCol>=0 && iCol<=2 );
707 iMask = 1 << iCol;
…
713 if( pConstraint->usable==0 ){
714 unusableMask |= iMask;
715 continue;
716 }else if( op==SQLITE_INDEX_CONSTRAINT_EQ ){
717 idxNum |= iMask;
718 aIdx[iCol] = i;
719 }
720 }