You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: addOns/ascanrules/src/main/java/org/zaproxy/zap/extension/ascanrules/SqlInjectionOracleTimingScanRule.java
+8-50Lines changed: 8 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,6 @@
21
21
22
22
importjava.util.Collections;
23
23
importjava.util.HashMap;
24
-
importjava.util.LinkedHashMap;
25
24
importjava.util.Map;
26
25
importorg.apache.logging.log4j.LogManager;
27
26
importorg.apache.logging.log4j.Logger;
@@ -38,11 +37,11 @@
38
37
/**
39
38
* TODO: maybe implement a more specific UNION based check for Oracle (with table names)
40
39
*
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
43
-
* SQLInjection class! Note the ordering of checks, for efficiency is : 1) Error based (N/A) 2)
44
-
* Boolean Based (N/A - uses standard syntax) 3) UNION based (TODO) 4) Stacked (N/A - uses standard
45
-
* syntax) 5) Blind/Time Based (Yes)
40
+
* <p>This scan rule identifies Oracle specific SQL Injection vulnerabilities using Oracle specific
41
+
* syntax. If it doesn't use Oracle specific syntax, it belongs in the generic SQLInjection class!
42
+
* Note the ordering of checks, for efficiency is : 1) Error based (N/A) 2) Boolean Based (N/A -
43
+
* uses standard syntax) 3) UNION based (TODO) 4) Stacked (N/A - uses standard syntax) 5) Blind/Time
44
+
* Based (Yes)
46
45
*
47
46
* <p>See the following for some great specific tricks which could be integrated here
// TODO: is this all?? we need more error messages for Oracle for different languages. PHP
98
-
// (oci8), ASP, JSP(JDBC), etc
99
-
}
100
-
101
72
/** the 5 second sleep function in Oracle SQL */
102
73
privatestaticStringSQL_ORACLE_TIME_SELECT =
103
74
"SELECT UTL_INADDR.get_host_name('10.0.0.1') from dual union SELECT UTL_INADDR.get_host_name('10.0.0.2') from dual union SELECT UTL_INADDR.get_host_name('10.0.0.3') from dual union SELECT UTL_INADDR.get_host_name('10.0.0.4') from dual union SELECT UTL_INADDR.get_host_name('10.0.0.5') from dual";
@@ -167,7 +138,8 @@ public class SqlInjectionOracleScanRule extends AbstractAppParamPlugin
Copy file name to clipboardExpand all lines: addOns/ascanrules/src/main/javahelp/org/zaproxy/zap/extension/ascanrules/resources/help/contents/ascanrules.html
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.
Copy file name to clipboardExpand all lines: addOns/ascanrules/src/test/java/org/zaproxy/zap/extension/ascanrules/SqlInjectionOracleTimingScanRuleUnitTest.java
0 commit comments