Example #1
0
 public Object processResultSetAccess(MethodInvocation invocation) throws Throwable {
   Object ret = invocation.invokeNext();
   if (ret instanceof String || ret instanceof StringBuilder || ret instanceof StringBuffer) {
     //    		result = new String((String)result, true);
     TaintData.getTaintData()
         .mapDataToSource(
             ret, TaintData.getTaintData().getResultSetSource(invocation.getTargetObject()));
     StackPath location = TaintUtil.getStackTracePath();
     TaintLogger.getTaintLogger().logReturning(location, "RESULTSETACCESS", ret);
   }
   return ret;
 }
Example #2
0
  public Object processResultSetCreation(MethodInvocation invocation) throws Throwable {
    ResultSet rs = (ResultSet) invocation.invokeNext();
    ResultSetMetaData metaData = null;
    try {
      metaData = (ResultSetMetaData) rs.getMetaData();
      TaintData.getTaintData().mapDataToSource(rs, metaData);
      TaintData.getTaintData().mapResultSetToSource(rs, metaData);
    } catch (SQLException e) {
      TaintLogger.getTaintLogger().log("FAIL GETTING METADATA FROM RESULTSET: " + e.getMessage());
    }

    return rs;
  }