Fix ObjectIntrospection exposing JDK internal toString() to the WAF#10820
Draft
Fix ObjectIntrospection exposing JDK internal toString() to the WAF#10820
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 63 metrics, 8 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.61.0-SNAPSHOT~9ded0025e1, baseline=1.61.0-SNAPSHOT~8185dcf699
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.063 s) : 0, 1062556
Total [baseline] (8.916 s) : 0, 8915736
Agent [candidate] (1.061 s) : 0, 1061178
Total [candidate] (8.868 s) : 0, 8868274
section iast
Agent [baseline] (1.232 s) : 0, 1232398
Total [baseline] (9.594 s) : 0, 9593508
Agent [candidate] (1.228 s) : 0, 1228242
Total [candidate] (9.601 s) : 0, 9600615
gantt
title insecure-bank - break down per module: candidate=1.61.0-SNAPSHOT~9ded0025e1, baseline=1.61.0-SNAPSHOT~8185dcf699
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.2 ms) : 0, 1200
crashtracking [candidate] (1.198 ms) : 0, 1198
BytebuddyAgent [baseline] (631.44 ms) : 0, 631440
BytebuddyAgent [candidate] (629.169 ms) : 0, 629169
AgentMeter [baseline] (29.13 ms) : 0, 29130
AgentMeter [candidate] (29.133 ms) : 0, 29133
GlobalTracer [baseline] (258.399 ms) : 0, 258399
GlobalTracer [candidate] (257.759 ms) : 0, 257759
AppSec [baseline] (31.54 ms) : 0, 31540
AppSec [candidate] (31.539 ms) : 0, 31539
Debugger [baseline] (58.953 ms) : 0, 58953
Debugger [candidate] (58.839 ms) : 0, 58839
Remote Config [baseline] (615.671 µs) : 0, 616
Remote Config [candidate] (610.403 µs) : 0, 610
Telemetry [baseline] (8.747 ms) : 0, 8747
Telemetry [candidate] (8.702 ms) : 0, 8702
Flare Poller [baseline] (6.363 ms) : 0, 6363
Flare Poller [candidate] (8.108 ms) : 0, 8108
section iast
crashtracking [baseline] (1.197 ms) : 0, 1197
crashtracking [candidate] (1.19 ms) : 0, 1190
BytebuddyAgent [baseline] (799.47 ms) : 0, 799470
BytebuddyAgent [candidate] (796.927 ms) : 0, 796927
AgentMeter [baseline] (11.353 ms) : 0, 11353
AgentMeter [candidate] (11.357 ms) : 0, 11357
GlobalTracer [baseline] (248.609 ms) : 0, 248609
GlobalTracer [candidate] (248.157 ms) : 0, 248157
IAST [baseline] (25.223 ms) : 0, 25223
IAST [candidate] (25.159 ms) : 0, 25159
AppSec [baseline] (26.485 ms) : 0, 26485
AppSec [candidate] (26.35 ms) : 0, 26350
Debugger [baseline] (63.329 ms) : 0, 63329
Debugger [candidate] (62.719 ms) : 0, 62719
Remote Config [baseline] (507.579 µs) : 0, 508
Remote Config [candidate] (514.29 µs) : 0, 514
Telemetry [baseline] (14.82 ms) : 0, 14820
Telemetry [candidate] (14.904 ms) : 0, 14904
Flare Poller [baseline] (5.129 ms) : 0, 5129
Flare Poller [candidate] (4.865 ms) : 0, 4865
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.61.0-SNAPSHOT~9ded0025e1, baseline=1.61.0-SNAPSHOT~8185dcf699
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.066 s) : 0, 1065596
Total [baseline] (11.076 s) : 0, 11076140
Agent [candidate] (1.065 s) : 0, 1064825
Total [candidate] (11.155 s) : 0, 11154518
section appsec
Agent [baseline] (1.249 s) : 0, 1248702
Total [baseline] (11.275 s) : 0, 11275219
Agent [candidate] (1.251 s) : 0, 1250899
Total [candidate] (11.195 s) : 0, 11194625
section iast
Agent [baseline] (1.23 s) : 0, 1229501
Total [baseline] (11.4 s) : 0, 11399847
Agent [candidate] (1.233 s) : 0, 1232804
Total [candidate] (11.339 s) : 0, 11338731
section profiling
Agent [baseline] (1.187 s) : 0, 1186884
Total [baseline] (11.213 s) : 0, 11212906
Agent [candidate] (1.185 s) : 0, 1184954
Total [candidate] (11.138 s) : 0, 11138216
gantt
title petclinic - break down per module: candidate=1.61.0-SNAPSHOT~9ded0025e1, baseline=1.61.0-SNAPSHOT~8185dcf699
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.197 ms) : 0, 1197
crashtracking [candidate] (1.209 ms) : 0, 1209
BytebuddyAgent [baseline] (631.48 ms) : 0, 631480
BytebuddyAgent [candidate] (631.202 ms) : 0, 631202
AgentMeter [baseline] (29.232 ms) : 0, 29232
AgentMeter [candidate] (29.271 ms) : 0, 29271
GlobalTracer [baseline] (258.584 ms) : 0, 258584
GlobalTracer [candidate] (259.29 ms) : 0, 259290
AppSec [baseline] (31.717 ms) : 0, 31717
AppSec [candidate] (31.778 ms) : 0, 31778
Debugger [baseline] (59.776 ms) : 0, 59776
Debugger [candidate] (59.918 ms) : 0, 59918
Remote Config [baseline] (620.054 µs) : 0, 620
Remote Config [candidate] (618.742 µs) : 0, 619
Telemetry [baseline] (8.747 ms) : 0, 8747
Telemetry [candidate] (8.823 ms) : 0, 8823
Flare Poller [baseline] (8.154 ms) : 0, 8154
Flare Poller [candidate] (6.458 ms) : 0, 6458
section appsec
crashtracking [baseline] (1.195 ms) : 0, 1195
crashtracking [candidate] (1.192 ms) : 0, 1192
BytebuddyAgent [baseline] (659.246 ms) : 0, 659246
BytebuddyAgent [candidate] (660.498 ms) : 0, 660498
AgentMeter [baseline] (12.139 ms) : 0, 12139
AgentMeter [candidate] (12.083 ms) : 0, 12083
GlobalTracer [baseline] (258.889 ms) : 0, 258889
GlobalTracer [candidate] (259.231 ms) : 0, 259231
IAST [baseline] (24.021 ms) : 0, 24021
IAST [candidate] (24.017 ms) : 0, 24017
AppSec [baseline] (177.664 ms) : 0, 177664
AppSec [candidate] (178.301 ms) : 0, 178301
Debugger [baseline] (66.008 ms) : 0, 66008
Debugger [candidate] (66.013 ms) : 0, 66013
Remote Config [baseline] (571.222 µs) : 0, 571
Remote Config [candidate] (566.673 µs) : 0, 567
Telemetry [baseline] (9.055 ms) : 0, 9055
Telemetry [candidate] (9.02 ms) : 0, 9020
Flare Poller [baseline] (3.649 ms) : 0, 3649
Flare Poller [candidate] (3.65 ms) : 0, 3650
section iast
crashtracking [baseline] (1.199 ms) : 0, 1199
crashtracking [candidate] (1.2 ms) : 0, 1200
BytebuddyAgent [baseline] (796.79 ms) : 0, 796790
BytebuddyAgent [candidate] (799.56 ms) : 0, 799560
AgentMeter [baseline] (11.374 ms) : 0, 11374
AgentMeter [candidate] (11.382 ms) : 0, 11382
GlobalTracer [baseline] (248.025 ms) : 0, 248025
GlobalTracer [candidate] (248.682 ms) : 0, 248682
IAST [baseline] (25.081 ms) : 0, 25081
IAST [candidate] (25.218 ms) : 0, 25218
AppSec [baseline] (27.193 ms) : 0, 27193
AppSec [candidate] (26.548 ms) : 0, 26548
Debugger [baseline] (65.452 ms) : 0, 65452
Debugger [candidate] (65.86 ms) : 0, 65860
Remote Config [baseline] (519.546 µs) : 0, 520
Remote Config [candidate] (520.19 µs) : 0, 520
Telemetry [baseline] (13.277 ms) : 0, 13277
Telemetry [candidate] (13.317 ms) : 0, 13317
Flare Poller [baseline] (4.459 ms) : 0, 4459
Flare Poller [candidate] (4.47 ms) : 0, 4470
section profiling
crashtracking [baseline] (1.183 ms) : 0, 1183
crashtracking [candidate] (1.172 ms) : 0, 1172
BytebuddyAgent [baseline] (684.764 ms) : 0, 684764
BytebuddyAgent [candidate] (684.407 ms) : 0, 684407
AgentMeter [baseline] (8.703 ms) : 0, 8703
AgentMeter [candidate] (8.633 ms) : 0, 8633
GlobalTracer [baseline] (216.631 ms) : 0, 216631
GlobalTracer [candidate] (215.935 ms) : 0, 215935
AppSec [baseline] (32.134 ms) : 0, 32134
AppSec [candidate] (32.017 ms) : 0, 32017
Debugger [baseline] (64.336 ms) : 0, 64336
Debugger [candidate] (65.568 ms) : 0, 65568
Remote Config [baseline] (583.834 µs) : 0, 584
Remote Config [candidate] (578.035 µs) : 0, 578
Telemetry [baseline] (9.794 ms) : 0, 9794
Telemetry [candidate] (8.167 ms) : 0, 8167
Flare Poller [baseline] (3.538 ms) : 0, 3538
Flare Poller [candidate] (3.476 ms) : 0, 3476
ProfilingAgent [baseline] (94.336 ms) : 0, 94336
ProfilingAgent [candidate] (94.187 ms) : 0, 94187
Profiling [baseline] (94.905 ms) : 0, 94905
Profiling [candidate] (94.748 ms) : 0, 94748
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 4 performance regressions! Performance is the same for 16 metrics, 16 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~9ded0025e1, baseline=1.61.0-SNAPSHOT~8185dcf699
dateFormat X
axisFormat %s
section baseline
no_agent (19.609 ms) : 19403, 19815
. : milestone, 19609,
appsec (18.441 ms) : 18253, 18629
. : milestone, 18441,
code_origins (17.674 ms) : 17501, 17846
. : milestone, 17674,
iast (17.881 ms) : 17704, 18058
. : milestone, 17881,
profiling (18.706 ms) : 18520, 18892
. : milestone, 18706,
tracing (17.852 ms) : 17673, 18031
. : milestone, 17852,
section candidate
no_agent (19.448 ms) : 19251, 19645
. : milestone, 19448,
appsec (19.1 ms) : 18906, 19294
. : milestone, 19100,
code_origins (18.086 ms) : 17904, 18268
. : milestone, 18086,
iast (18.29 ms) : 18110, 18471
. : milestone, 18290,
profiling (19.548 ms) : 19353, 19743
. : milestone, 19548,
tracing (18.949 ms) : 18758, 19140
. : milestone, 18949,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~9ded0025e1, baseline=1.61.0-SNAPSHOT~8185dcf699
dateFormat X
axisFormat %s
section baseline
no_agent (1.171 ms) : 1159, 1183
. : milestone, 1171,
iast (3.225 ms) : 3182, 3268
. : milestone, 3225,
iast_FULL (5.876 ms) : 5818, 5934
. : milestone, 5876,
iast_GLOBAL (3.46 ms) : 3403, 3517
. : milestone, 3460,
profiling (2.423 ms) : 2396, 2450
. : milestone, 2423,
tracing (1.745 ms) : 1732, 1759
. : milestone, 1745,
section candidate
no_agent (1.251 ms) : 1239, 1264
. : milestone, 1251,
iast (3.124 ms) : 3084, 3164
. : milestone, 3124,
iast_FULL (6.031 ms) : 5970, 6093
. : milestone, 6031,
iast_GLOBAL (3.489 ms) : 3425, 3552
. : milestone, 3489,
profiling (2.188 ms) : 2168, 2207
. : milestone, 2188,
tracing (1.831 ms) : 1815, 1847
. : milestone, 1831,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 2 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~9ded0025e1, baseline=1.61.0-SNAPSHOT~8185dcf699
dateFormat X
axisFormat %s
section baseline
no_agent (1.474 ms) : 1463, 1486
. : milestone, 1474,
appsec (2.52 ms) : 2465, 2575
. : milestone, 2520,
iast (2.261 ms) : 2192, 2330
. : milestone, 2261,
iast_GLOBAL (2.301 ms) : 2231, 2370
. : milestone, 2301,
profiling (2.528 ms) : 2363, 2692
. : milestone, 2528,
tracing (2.07 ms) : 2016, 2124
. : milestone, 2070,
section candidate
no_agent (1.471 ms) : 1459, 1482
. : milestone, 1471,
appsec (3.814 ms) : 3595, 4034
. : milestone, 3814,
iast (2.262 ms) : 2193, 2331
. : milestone, 2262,
iast_GLOBAL (2.298 ms) : 2228, 2368
. : milestone, 2298,
profiling (2.107 ms) : 2050, 2164
. : milestone, 2107,
tracing (2.073 ms) : 2020, 2127
. : milestone, 2073,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~9ded0025e1, baseline=1.61.0-SNAPSHOT~8185dcf699
dateFormat X
axisFormat %s
section baseline
no_agent (14.929 s) : 14929000, 14929000
. : milestone, 14929000,
appsec (14.829 s) : 14829000, 14829000
. : milestone, 14829000,
iast (18.069 s) : 18069000, 18069000
. : milestone, 18069000,
iast_GLOBAL (17.759 s) : 17759000, 17759000
. : milestone, 17759000,
profiling (15.072 s) : 15072000, 15072000
. : milestone, 15072000,
tracing (15.164 s) : 15164000, 15164000
. : milestone, 15164000,
section candidate
no_agent (15.234 s) : 15234000, 15234000
. : milestone, 15234000,
appsec (14.816 s) : 14816000, 14816000
. : milestone, 14816000,
iast (18.314 s) : 18314000, 18314000
. : milestone, 18314000,
iast_GLOBAL (18.459 s) : 18459000, 18459000
. : milestone, 18459000,
profiling (15.496 s) : 15496000, 15496000
. : milestone, 15496000,
tracing (15.101 s) : 15101000, 15101000
. : milestone, 15101000,
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
When
setAccessible()failed for a field due to Java 9+ module encapsulation,ObjectIntrospectionreturnedobj.toString()for the entire object.This caused JDK internal string representations such as
"class java.lang.Object"to reach the WAF engine, where they could matchphrase_matchrules (e.g.,crs-944-130 java_code_injection) and generate false positive security events on every request, leading to a CPU spike.This change replaces the early
returnwith acontinue, so that inaccessible fields are skipped while accessible fields on the same object are still reported to the WAF.Motivation
Avoid false positive security events and unnecessary CPU spikes caused by internal JDK string representations being analyzed by the WAF.
https://datadoghq.atlassian.net/browse/SCRS-2006
Additional Notes
setAccessible()fails under Java 9+ module encapsulation.ObjectIntrospectioncontinues processing remaining accessible fields instead of falling back toobj.toString().Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: APPSEC-61693
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.