private void pushByInvoke(DismantleBytecode dbc, boolean popThis) { String signature = dbc.getSigConstantOperand(); if (Const.CONSTRUCTOR_NAME.equals(dbc.getNameConstantOperand()) && signature.endsWith(")V") && popThis) { pop(PreorderVisitor.getNumberArguments(signature)); Item constructed = pop(); if (getStackDepth() > 0) { Item next = getStackItem(0); if (constructed.equals(next)) { next = new Item(next); next.source = XFactory.createReferencedXMethod(dbc); next.pc = dbc.getPC(); replace(0, next); } } return; } pop(PreorderVisitor.getNumberArguments(signature) + (popThis ? 1 : 0)); pushBySignature(new SignatureParser(signature).getReturnTypeSignature(), dbc); }
Item newValue = new Item(value, newSignature); if (newValue.source == null) { newValue.source = XFactory.createReferencedXMethod(dbc); if ("Ljava/io/FileOutputStream;".equals(newTop.signature)) { newTop.setSpecialKind(Item.FILE_OPENED_IN_APPEND_MODE); newTop.source = XFactory.createReferencedXMethod(dbc); newTop.setPC(dbc.getPC()); Item newTop = getStackItem(0); newTop.setSpecialKind(Item.FILE_OPENED_IN_APPEND_MODE); newTop.source = XFactory.createReferencedXMethod(dbc); newTop.setPC(dbc.getPC()); return; Item result = new Item("Ljava/lang/String;"); result.setServletParameterTainted(); result.source = XFactory.createReferencedXMethod(dbc); String parameterName = null; if (requestParameter.getConstant() instanceof String) { Item result = new Item("Ljava/lang/String;"); result.setServletParameterTainted(); result.source = XFactory.createReferencedXMethod(dbc); result.setPC(dbc.getPC()); push(result); Item result = new Item("Ljava/lang/String;"); result.setServletParameterTainted();
parameters++; XMethod xMethod = XFactory.createReferencedXMethod(this); if (DEBUG) { System.out.println("IL: Checking...");
callSeen = XFactory.createReferencedXMethod(this); callPC = getPC(); sawMethodCallWithIgnoredReturnValue(); } else if (INVOKE_OPCODE_SET.get(seen)) { callPC = getPC(); callSeen = XFactory.createReferencedXMethod(this); state = SAW_INVOKE; if (DEBUG) {
previousMethodInvocation = XFactory.createReferencedXMethod(this); } else if (seen == Const.INVOKESTATIC && getClassConstantOperand().startsWith("java/lang/") && "valueOf".equals(getNameConstantOperand()) && getSigConstantOperand().length() == 4) { previousMethodInvocation = XFactory.createReferencedXMethod(this); } else if (seen == Const.INVOKEVIRTUAL && getClassConstantOperand().startsWith("java/lang/") && getNameConstantOperand().endsWith("Value") && getSigConstantOperand().length() == 3) { previousMethodInvocation = XFactory.createReferencedXMethod(this); } else { previousMethodInvocation = null;
private void pushByInvoke(DismantleBytecode dbc, boolean popThis) { String signature = dbc.getSigConstantOperand(); if ("<init>".equals(dbc.getNameConstantOperand()) && signature.endsWith(")V") && popThis) { pop(PreorderVisitor.getNumberArguments(signature)); Item constructed = pop(); if (getStackDepth() > 0) { Item next = getStackItem(0); if (constructed.equals(next)) { next = new Item(next); next.source = XFactory.createReferencedXMethod(dbc); next.pc = dbc.getPC(); replace(0, next); } } return; } pop(PreorderVisitor.getNumberArguments(signature) + (popThis ? 1 : 0)); pushBySignature(new SignatureParser(signature).getReturnTypeSignature(), dbc); }
Item newValue = new Item(value, newSignature); if (newValue.source == null) { newValue.source = XFactory.createReferencedXMethod(dbc); if ("Ljava/io/FileOutputStream;".equals(newTop.signature)) { newTop.setSpecialKind(Item.FILE_OPENED_IN_APPEND_MODE); newTop.source = XFactory.createReferencedXMethod(dbc); newTop.setPC(dbc.getPC()); Item newTop = getStackItem(0); newTop.setSpecialKind(Item.FILE_OPENED_IN_APPEND_MODE); newTop.source = XFactory.createReferencedXMethod(dbc); newTop.setPC(dbc.getPC()); return; Item result = new Item("Ljava/lang/String;"); result.setServletParameterTainted(); result.source = XFactory.createReferencedXMethod(dbc); String parameterName = null; if (requestParameter.getConstant() instanceof String) { Item result = new Item("Ljava/lang/String;"); result.setServletParameterTainted(); result.source = XFactory.createReferencedXMethod(dbc); result.setPC(dbc.getPC()); push(result); Item result = new Item("Ljava/lang/String;"); result.setServletParameterTainted();
parameters++; XMethod xMethod = XFactory.createReferencedXMethod(this); if (DEBUG) { System.out.println("IL: Checking...");
callSeen = XFactory.createReferencedXMethod(this); callPC = getPC(); sawMethodCallWithIgnoredReturnValue(); } else if (INVOKE_OPCODE_SET.get(seen)) { callPC = getPC(); callSeen = XFactory.createReferencedXMethod(this); state = SAW_INVOKE; if (DEBUG) {
previousMethodInvocation = XFactory.createReferencedXMethod(this); } else if (seen == INVOKESTATIC && getClassConstantOperand().startsWith("java/lang/") && "valueOf".equals(getNameConstantOperand()) && getSigConstantOperand().length() == 4) { previousMethodInvocation = XFactory.createReferencedXMethod(this); } else if (seen == INVOKEVIRTUAL && getClassConstantOperand().startsWith("java/lang/") && getNameConstantOperand().endsWith("Value") && getSigConstantOperand().length() == 3) { previousMethodInvocation = XFactory.createReferencedXMethod(this); } else { previousMethodInvocation = null;