Skip to content

Commit 360b47d

Browse files
committed
ascanrules: SQLi Hypersonic rename scan rule (all timing based)
Signed-off-by: kingthorin <[email protected]>
1 parent dc2e143 commit 360b47d

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

addOns/ascanrules/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
77
### Changed
88
- Maintenance changes.
99
- Depends on an updated version of the Common Library add-on.
10+
- The SQL Injection - Hypersonic scan rule and alerts have been renamed to clarify that they're timing based (Issue 7341).
1011

1112
### Added
1213
- Rules (as applicable) have been tagged in relation to HIPAA and PCI DSS.
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
/**
4747
* TODO: maybe implement a more specific UNION based check for Hypersonic (with table names)
4848
*
49-
* <p>The SqlInjectionHypersonicScanRule identifies Hypersonic specific SQL Injection
49+
* <p>The SqlInjectionHypersonicTimingScanRule identifies Hypersonic specific SQL Injection
5050
* vulnerabilities using Hypersonic specific syntax. If it doesn't use Hypersonic specific syntax,
5151
* it belongs in the generic SQLInjection class! Note the ordering of checks, for efficiency is : 1)
5252
* Error based (N/A) 2) Boolean Based (N/A - uses standard syntax) 3) UNION based (TODO) 4) Stacked
@@ -68,7 +68,7 @@
6868
*
6969
* @author 70pointer
7070
*/
71-
public class SqlInjectionHypersonicScanRule extends AbstractAppParamPlugin
71+
public class SqlInjectionHypersonicTimingScanRule extends AbstractAppParamPlugin
7272
implements CommonActiveScanRuleInfo {
7373

7474
/** Hypersonic one-line comment */
@@ -201,7 +201,8 @@ public class SqlInjectionHypersonicScanRule extends AbstractAppParamPlugin
201201
CommonAlertTag.OWASP_2017_A01_INJECTION,
202202
CommonAlertTag.WSTG_V42_INPV_05_SQLI,
203203
CommonAlertTag.HIPAA,
204-
CommonAlertTag.PCI_DSS));
204+
CommonAlertTag.PCI_DSS,
205+
CommonAlertTag.TEST_TIMING));
205206
alertTags.put(PolicyTag.DEV_FULL.getTag(), "");
206207
alertTags.put(PolicyTag.QA_STD.getTag(), "");
207208
alertTags.put(PolicyTag.QA_FULL.getTag(), "");
@@ -211,7 +212,8 @@ public class SqlInjectionHypersonicScanRule extends AbstractAppParamPlugin
211212
}
212213

213214
/** for logging. */
214-
private static final Logger LOGGER = LogManager.getLogger(SqlInjectionHypersonicScanRule.class);
215+
private static final Logger LOGGER =
216+
LogManager.getLogger(SqlInjectionHypersonicTimingScanRule.class);
215217

216218
/** The number of seconds used in time-based attacks (i.e. sleep commands). */
217219
private int timeSleepSeconds = DEFAULT_SLEEP_TIME;

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
@@ -180,7 +180,7 @@ ascanrules.sqlinjection.alert.unionbased.extrainfo = RDBMS [{0}] likely, given U
180180
ascanrules.sqlinjection.authbypass.desc = SQL injection may be possible on a login page, potentially allowing the application's authentication mechanism to be bypassed
181181
ascanrules.sqlinjection.authbypass.name = SQL Injection - Authentication Bypass
182182
ascanrules.sqlinjection.desc = SQL injection may be possible.
183-
ascanrules.sqlinjection.hypersonic.name = SQL Injection - Hypersonic SQL
183+
ascanrules.sqlinjection.hypersonic.name = SQL Injection - Hypersonic SQL (Time Based)
184184
ascanrules.sqlinjection.mssql.alert.timebased.extrainfo = The query time is controllable using parameter value [{0}], which caused the request to take [{1}] milliseconds, when the original unmodified query with value [{2}] took [{3}] milliseconds.
185185
ascanrules.sqlinjection.mssql.name = SQL Injection - MsSQL
186186
ascanrules.sqlinjection.mysql.name = SQL Injection - MySQL
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
import org.zaproxy.zap.model.TechSet;
3939
import org.zaproxy.zap.testutils.NanoServerHandler;
4040

41-
/** Unit test for {@link SqlInjectionHypersonicScanRule}. */
42-
class SqlInjectionHypersonicScanRuleUnitTest
43-
extends ActiveScannerTest<SqlInjectionHypersonicScanRule> {
41+
/** Unit test for {@link SqlInjectionHypersonicTimingScanRule}. */
42+
class SqlInjectionHypersonicTimingScanRuleUnitTest
43+
extends ActiveScannerTest<SqlInjectionHypersonicTimingScanRule> {
4444

4545
@Override
46-
protected SqlInjectionHypersonicScanRule createScanner() {
47-
return new SqlInjectionHypersonicScanRule();
46+
protected SqlInjectionHypersonicTimingScanRule createScanner() {
47+
return new SqlInjectionHypersonicTimingScanRule();
4848
}
4949

5050
@Test
@@ -155,7 +155,7 @@ void shouldReturnExpectedMappings() {
155155
// Then
156156
assertThat(cwe, is(equalTo(89)));
157157
assertThat(wasc, is(equalTo(19)));
158-
assertThat(tags.size(), is(equalTo(10)));
158+
assertThat(tags.size(), is(equalTo(11)));
159159
assertThat(
160160
tags.containsKey(CommonAlertTag.OWASP_2021_A03_INJECTION.getTag()),
161161
is(equalTo(true)));
@@ -166,6 +166,7 @@ void shouldReturnExpectedMappings() {
166166
tags.containsKey(CommonAlertTag.WSTG_V42_INPV_05_SQLI.getTag()), is(equalTo(true)));
167167
assertThat(tags.containsKey(CommonAlertTag.HIPAA.getTag()), is(equalTo(true)));
168168
assertThat(tags.containsKey(CommonAlertTag.PCI_DSS.getTag()), is(equalTo(true)));
169+
assertThat(tags.containsKey(CommonAlertTag.TEST_TIMING.getTag()), is(equalTo(true)));
169170
assertThat(tags.containsKey(PolicyTag.DEV_FULL.getTag()), is(equalTo(true)));
170171
assertThat(tags.containsKey(PolicyTag.QA_STD.getTag()), is(equalTo(true)));
171172
assertThat(tags.containsKey(PolicyTag.QA_FULL.getTag()), is(equalTo(true)));

0 commit comments

Comments
 (0)