Ingres是很多CA产品默认所使用的数据库后端。 Ingres SQL函数uuid_from_char()可从UUID的字符串表示创建UUID,例如: select uuid_from_char('11111111-2222-3333-4444-555555555555') 如果向uuid_from_char传送了超长字符串参数,就可能溢出栈缓冲区,覆盖保存的返回地址,将执行路径重新定向到攻击者所选择的地址。 Ingres verifydb工具可以解析duveutil.c文件duve_get_args函数中的命令行参数。如果传送了以下形式的参数: -dbms_testAAAAAAAAAAAAAA...<很多A> 就会导致执行以下代码: case 'd': /* debug flag - should be 1st parameter */ if (MEcmp((PTR)argv[parmno], (PTR)"-dbms_test", (u_i2)10) ==DU_IDENTICAL ) { char numbuf[100]; /* scratch pad to read in number*/ /* the DBMS_TEST flag was specified. See if a numeric ** value was attached to it. If so, convert to decimal. */ if (argv[parmno][10]) { STcopy ( &argv[parmno][10], numbuf); cv_numbuf(numbuf, &duve_cb->duve_dbms_test); } else duve_cb->duve_dbms_test = -1; } else duve_cb->duve_debug = TRUE; break; Ingres没有执行长度检查便使用STcopy函数将-dbms_test字符串后的参数数据拷贝到了numbuf缓冲区,这导致覆盖栈中的变量,包括所保存的返回地址。
Ingres是很多CA产品默认所使用的数据库后端。 Ingres SQL函数uuid_from_char()可从UUID的字符串表示创建UUID,例如: select uuid_from_char('11111111-2222-3333-4444-555555555555') 如果向uuid_from_char传送了超长字符串参数,就可能溢出栈缓冲区,覆盖保存的返回地址,将执行路径重新定向到攻击者所选择的地址。 Ingres verifydb工具可以解析duveutil.c文件duve_get_args函数中的命令行参数。如果传送了以下形式的参数: -dbms_testAAAAAAAAAAAAAA...<很多A> 就会导致执行以下代码: case 'd': /* debug flag - should be 1st parameter */ if (MEcmp((PTR)argv[parmno], (PTR)"-dbms_test", (u_i2)10) ==DU_IDENTICAL ) { char numbuf[100]; /* scratch pad to read in number*/ /* the DBMS_TEST flag was specified. See if a numeric ** value was attached to it. If so, convert to decimal. */ if (argv[parmno][10]) { STcopy ( &argv[parmno][10], numbuf); cv_numbuf(numbuf, &duve_cb->duve_dbms_test); } else duve_cb->duve_dbms_test = -1; } else duve_cb->duve_debug = TRUE; break; Ingres没有执行长度检查便使用STcopy函数将-dbms_test字符串后的参数数据拷贝到了numbuf缓冲区,这导致覆盖栈中的变量,包括所保存的返回地址。