We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在测试用例CWE78_OS_Command_Injection__char_connect_socket_system_01.out失败,经过分析发现,没有处理System调用返回值,导致在判断返回值时依据错误的rax值,导致部分路径不可达,从而未分析到漏洞路径。 sVar2 = strlen((char *)local_10); *(undefined4 *)((longlong)local_10 + sVar2) = 0x2a2e2a; iVar1 = system((char )local_10); 没有处理返回值,此时iVar1变量即rax是错误值 if (iVar1 != 0) {进入该分支,exit函数无返回导致分析中止, printLine("command execution failed!"); / WARNING: Subroutine does not return */ exit(1); } return;未进入该分支 建议当externalFunction没有自定义实现,且函数具有返回值时,将返回值设置为Top。 private Status invokeExternal(PcodeOp pcode, AbsEnv inOutEnv, AbsEnv tmpEnv, Function callee) { String funcName = callee.getName(); ExternalFunctionBase externalFunction = FunctionModelManager.getExternalFunction(funcName); if (externalFunction != null) { Logging.debug("Invoke external function model: " + funcName); externalFunction.invoke(pcode, inOutEnv, tmpEnv, context, callee); } else {// change ret value Parameter ret = callee.getReturn(); if (ret != null) { Register retreg = ret.getRegister(); String rettype = ret.getDataType().getName(); if ((retreg != null) && (!rettype.equals("undefined"))){ ALoc retALoc = ALoc.getALoc( Reg.getInstance(), retreg.getOffset(), GlobalState.arch.getDefaultPointerSize()); inOutEnv.set(retALoc, KSet.getTop(0), true); } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
在测试用例CWE78_OS_Command_Injection__char_connect_socket_system_01.out失败,经过分析发现,没有处理System调用返回值,导致在判断返回值时依据错误的rax值,导致部分路径不可达,从而未分析到漏洞路径。
sVar2 = strlen((char *)local_10);
*(undefined4 *)((longlong)local_10 + sVar2) = 0x2a2e2a;
iVar1 = system((char )local_10); 没有处理返回值,此时iVar1变量即rax是错误值
if (iVar1 != 0) {进入该分支,exit函数无返回导致分析中止,
printLine("command execution failed!");
/ WARNING: Subroutine does not return */
exit(1);
}
return;未进入该分支
建议当externalFunction没有自定义实现,且函数具有返回值时,将返回值设置为Top。
private Status invokeExternal(PcodeOp pcode, AbsEnv inOutEnv, AbsEnv tmpEnv, Function callee) {
String funcName = callee.getName();
ExternalFunctionBase externalFunction = FunctionModelManager.getExternalFunction(funcName);
if (externalFunction != null) {
Logging.debug("Invoke external function model: " + funcName);
externalFunction.invoke(pcode, inOutEnv, tmpEnv, context, callee);
} else {// change ret value
Parameter ret = callee.getReturn();
if (ret != null) {
Register retreg = ret.getRegister();
String rettype = ret.getDataType().getName();
if ((retreg != null) && (!rettype.equals("undefined"))){
ALoc retALoc = ALoc.getALoc(
Reg.getInstance(), retreg.getOffset(), GlobalState.arch.getDefaultPointerSize());
inOutEnv.set(retALoc, KSet.getTop(0), true);
}
}
}
The text was updated successfully, but these errors were encountered: