2023-05-03 11:06:20 +02:00
== Why is this an issue?
2021-04-28 18:08:03 +02:00
The debugger statement can be placed anywhere in procedures to suspend execution. Using the debugger statement is similar to setting a breakpoint in the code. By definition such statement must absolutely be removed from the source code to prevent any unexpected behavior or added vulnerability to attacks in production.
2023-05-03 11:06:20 +02:00
=== Noncompliant code example
2021-04-28 18:08:03 +02:00
2022-02-04 17:28:24 +01:00
[source,javascript]
2021-04-28 18:08:03 +02:00
----
for (i = 1; i<5; i++) {
// Print i to the Output window.
Debug.write("loop index is " + i);
// Wait for user to resume.
debugger;
}
----
2023-05-03 11:06:20 +02:00
=== Compliant solution
2021-04-28 18:08:03 +02:00
2022-02-04 17:28:24 +01:00
[source,javascript]
2021-04-28 18:08:03 +02:00
----
for (i = 1; i<5; i++) {
// Print i to the Output window.
Debug.write("loop index is " + i);
}
----
2023-05-03 11:06:20 +02:00
== Resources
2021-04-28 18:08:03 +02:00
2024-01-15 17:15:56 +01:00
* OWASP - https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure[Top 10 2017 Category A3 - Sensitive Data Exposure]
* CWE - https://cwe.mitre.org/data/definitions/489[CWE-489 - Active Debug Code]
2021-04-28 18:08:03 +02:00
2021-09-20 15:38:42 +02:00
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
2023-05-25 14:18:12 +02:00
=== Message
Remove this debugger statement.
2021-09-20 15:38:42 +02:00
endif::env-github,rspecator-view[]