0
我們使用Veracode掃描編碼。結果報告了51行中可能的SQL注入。代碼如下。如何修復來自Veracode Security Scan的SQL注入問題
我想知道爲什麼這是一個SQL注入問題,如果是的話如何解決它。
@Override
public CloseableSqlRowSet queryForRowSet(String sql, SqlParameterSource paramSource) throws DataAccessException {
try {
conn = getJdbcTemplate().getDataSource().getConnection();
psc = getPreparedStatementCreator(sql, paramSource);
ps = psc.createPreparedStatement(conn);
applyStatementSettings(ps);
resultSet = ps.executeQuery(); // this is line 51
return new CloseableResultSetWrappingSqlRowSet(resultSet, this);
} catch (SQLException ex) {
this.release();
throw translateSqlException(sql, ex);
} catch (Exception e) {
this.release();
throw e;
}
}
如果這是一個黑箱掃描器;您能否向我們提供掃描器發送的HTTP請求以及Web服務器返回的HTTP響應。我們需要掃描儀的攻擊細節來進一步瞭解這一點。 – Juxhin