Skip to content

Commit 5cbf188

Browse files
committed
ascanrules: SQLi Oracle rename scan rule (all timing based)
Signed-off-by: kingthorin <[email protected]> # Conflicts: # addOns/ascanrules/CHANGELOG.md
1 parent 8afbdb0 commit 5cbf188

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

addOns/ascanrules/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1212
- Rules (as applicable) have been tagged in relation to HIPAA and PCI DSS.
1313
- The Cloud Metadata Potentially Exposed scan rules now has a CWE reference.
1414
- Scan rules which execute time based attacks now include the "TEST_TIMING" alert tag.
15+
- The SQL Injection - Oracle scan rule and alerts have been renamed to clarify that they're timing based (Issue 7341).
1516

1617
## [72] - 2025-06-20
1718
### Added
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
/**
3939
* TODO: maybe implement a more specific UNION based check for Oracle (with table names)
4040
*
41-
* <p>The SqlInjectionOracleScanRule identifies Oracle specific SQL Injection vulnerabilities using
42-
* Oracle specific syntax. If it doesn't use Oracle specific syntax, it belongs in the generic
41+
* <p>The SqlInjectionOracleTimingScanRule identifies Oracle specific SQL Injection vulnerabilities
42+
* using Oracle specific syntax. If it doesn't use Oracle specific syntax, it belongs in the generic
4343
* SQLInjection class! Note the ordering of checks, for efficiency is : 1) Error based (N/A) 2)
4444
* Boolean Based (N/A - uses standard syntax) 3) UNION based (TODO) 4) Stacked (N/A - uses standard
4545
* syntax) 5) Blind/Time Based (Yes)
@@ -60,7 +60,7 @@
6060
*
6161
* @author 70pointer
6262
*/
63-
public class SqlInjectionOracleScanRule extends AbstractAppParamPlugin
63+
public class SqlInjectionOracleTimingScanRule extends AbstractAppParamPlugin
6464
implements CommonActiveScanRuleInfo {
6565

6666
private int expectedDelayInMs = 5000;
@@ -167,7 +167,8 @@ public class SqlInjectionOracleScanRule extends AbstractAppParamPlugin
167167
}
168168

169169
/** for logging. */
170-
private static final Logger LOGGER = LogManager.getLogger(SqlInjectionOracleScanRule.class);
170+
private static final Logger LOGGER =
171+
LogManager.getLogger(SqlInjectionOracleTimingScanRule.class);
171172

172173
@Override
173174
public int getId() {

addOns/ascanrules/src/main/resources/org/zaproxy/zap/extension/ascanrules/resources/Messages.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ ascanrules.sqlinjection.mssql.alert.timebased.extrainfo = The query time is cont
185185
ascanrules.sqlinjection.mssql.name = SQL Injection - MsSQL
186186
ascanrules.sqlinjection.mysql.name = SQL Injection - MySQL
187187
ascanrules.sqlinjection.name = SQL Injection
188-
ascanrules.sqlinjection.oracle.name = SQL Injection - Oracle
188+
ascanrules.sqlinjection.oracle.name = SQL Injection - Oracle (Time Based)
189189
ascanrules.sqlinjection.postgres.name = SQL Injection - PostgreSQL
190190
ascanrules.sqlinjection.refs = https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html
191191
ascanrules.sqlinjection.soln = Do not trust client side input, even if there is client side validation in place.\nIn general, type check all data on the server side.\nIf the application uses JDBC, use PreparedStatement or CallableStatement, with parameters passed by '?'\nIf the application uses ASP, use ADO Command Objects with strong type checking and parameterized queries.\nIf database Stored Procedures can be used, use them.\nDo *not* concatenate strings into queries in the stored procedure, or use 'exec', 'exec immediate', or equivalent functionality!\nDo not create dynamic SQL queries using simple string concatenation.\nEscape all data received from the client.\nApply an 'allow list' of allowed characters, or a 'deny list' of disallowed characters in user input.\nApply the principle of least privilege by using the least privileged database user possible.\nIn particular, avoid using the 'sa' or 'db-owner' database users. This does not eliminate SQL injection, but minimizes its impact.\nGrant the minimum database access that is necessary for the application.
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@
3636
import org.zaproxy.zap.model.TechSet;
3737
import org.zaproxy.zap.testutils.NanoServerHandler;
3838

39-
/** Unit test for {@link SqlInjectionOracleScanRule}. */
40-
class SqlInjectionOracleScanRuleUnitTest extends ActiveScannerTest<SqlInjectionOracleScanRule> {
39+
/** Unit test for {@link SqlInjectionOracleTimingScanRule}. */
40+
class SqlInjectionOracleTimingScanRuleUnitTest
41+
extends ActiveScannerTest<SqlInjectionOracleTimingScanRule> {
4142

4243
@Override
43-
protected SqlInjectionOracleScanRule createScanner() {
44-
return new SqlInjectionOracleScanRule();
44+
protected SqlInjectionOracleTimingScanRule createScanner() {
45+
return new SqlInjectionOracleTimingScanRule();
4546
}
4647

4748
@Test

0 commit comments

Comments
 (0)