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 64 metrics, 7 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.61.0-SNAPSHOT~c81802884f, baseline=1.61.0-SNAPSHOT~93c3816062
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.057 s) : 0, 1057379
Total [baseline] (8.832 s) : 0, 8831864
Agent [candidate] (1.065 s) : 0, 1064827
Total [candidate] (8.867 s) : 0, 8866571
section iast
Agent [baseline] (1.226 s) : 0, 1225728
Total [baseline] (9.563 s) : 0, 9562808
Agent [candidate] (1.236 s) : 0, 1236370
Total [candidate] (9.573 s) : 0, 9572969
gantt
title insecure-bank - break down per module: candidate=1.61.0-SNAPSHOT~c81802884f, baseline=1.61.0-SNAPSHOT~93c3816062
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.195 ms) : 0, 1195
crashtracking [candidate] (1.215 ms) : 0, 1215
BytebuddyAgent [baseline] (627.782 ms) : 0, 627782
BytebuddyAgent [candidate] (629.98 ms) : 0, 629980
AgentMeter [baseline] (29.023 ms) : 0, 29023
AgentMeter [candidate] (29.451 ms) : 0, 29451
GlobalTracer [baseline] (256.975 ms) : 0, 256975
GlobalTracer [candidate] (259.495 ms) : 0, 259495
AppSec [baseline] (31.57 ms) : 0, 31570
AppSec [candidate] (32.026 ms) : 0, 32026
Debugger [baseline] (58.984 ms) : 0, 58984
Debugger [candidate] (59.172 ms) : 0, 59172
Remote Config [baseline] (594.416 µs) : 0, 594
Remote Config [candidate] (594.024 µs) : 0, 594
Telemetry [baseline] (8.694 ms) : 0, 8694
Telemetry [candidate] (8.735 ms) : 0, 8735
Flare Poller [baseline] (6.502 ms) : 0, 6502
Flare Poller [candidate] (8.027 ms) : 0, 8027
section iast
crashtracking [baseline] (1.198 ms) : 0, 1198
crashtracking [candidate] (1.207 ms) : 0, 1207
BytebuddyAgent [baseline] (795.356 ms) : 0, 795356
BytebuddyAgent [candidate] (802.636 ms) : 0, 802636
AgentMeter [baseline] (11.348 ms) : 0, 11348
AgentMeter [candidate] (11.582 ms) : 0, 11582
GlobalTracer [baseline] (247.566 ms) : 0, 247566
GlobalTracer [candidate] (249.561 ms) : 0, 249561
AppSec [baseline] (26.336 ms) : 0, 26336
AppSec [candidate] (26.632 ms) : 0, 26632
Debugger [baseline] (62.626 ms) : 0, 62626
Debugger [candidate] (62.956 ms) : 0, 62956
Remote Config [baseline] (537.278 µs) : 0, 537
Remote Config [candidate] (530.717 µs) : 0, 531
Telemetry [baseline] (14.78 ms) : 0, 14780
Telemetry [candidate] (15.48 ms) : 0, 15480
Flare Poller [baseline] (4.67 ms) : 0, 4670
Flare Poller [candidate] (4.235 ms) : 0, 4235
IAST [baseline] (25.125 ms) : 0, 25125
IAST [candidate] (25.369 ms) : 0, 25369
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.61.0-SNAPSHOT~c81802884f, baseline=1.61.0-SNAPSHOT~93c3816062
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.074 s) : 0, 1073765
Total [baseline] (11.1 s) : 0, 11100434
Agent [candidate] (1.063 s) : 0, 1063376
Total [candidate] (11.098 s) : 0, 11097733
section appsec
Agent [baseline] (1.249 s) : 0, 1249247
Total [baseline] (11.192 s) : 0, 11191791
Agent [candidate] (1.246 s) : 0, 1246020
Total [candidate] (11.139 s) : 0, 11139061
section iast
Agent [baseline] (1.23 s) : 0, 1229895
Total [baseline] (11.327 s) : 0, 11326884
Agent [candidate] (1.229 s) : 0, 1228867
Total [candidate] (11.349 s) : 0, 11348531
section profiling
Agent [baseline] (1.189 s) : 0, 1188948
Total [baseline] (11.226 s) : 0, 11226410
Agent [candidate] (1.181 s) : 0, 1180650
Total [candidate] (11.079 s) : 0, 11078875
gantt
title petclinic - break down per module: candidate=1.61.0-SNAPSHOT~c81802884f, baseline=1.61.0-SNAPSHOT~93c3816062
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.213 ms) : 0, 1213
crashtracking [candidate] (1.201 ms) : 0, 1201
BytebuddyAgent [baseline] (635.871 ms) : 0, 635871
BytebuddyAgent [candidate] (630.191 ms) : 0, 630191
AgentMeter [baseline] (29.675 ms) : 0, 29675
AgentMeter [candidate] (29.41 ms) : 0, 29410
GlobalTracer [baseline] (260.661 ms) : 0, 260661
GlobalTracer [candidate] (258.942 ms) : 0, 258942
AppSec [baseline] (32.08 ms) : 0, 32080
AppSec [candidate] (31.764 ms) : 0, 31764
Debugger [baseline] (60.398 ms) : 0, 60398
Debugger [candidate] (59.86 ms) : 0, 59860
Remote Config [baseline] (600.462 µs) : 0, 600
Remote Config [candidate] (586.481 µs) : 0, 586
Telemetry [baseline] (8.717 ms) : 0, 8717
Telemetry [candidate] (8.729 ms) : 0, 8729
Flare Poller [baseline] (8.118 ms) : 0, 8118
Flare Poller [candidate] (6.482 ms) : 0, 6482
section appsec
crashtracking [baseline] (1.194 ms) : 0, 1194
crashtracking [candidate] (1.194 ms) : 0, 1194
BytebuddyAgent [baseline] (659.679 ms) : 0, 659679
BytebuddyAgent [candidate] (658.051 ms) : 0, 658051
AgentMeter [baseline] (12.122 ms) : 0, 12122
AgentMeter [candidate] (12.036 ms) : 0, 12036
GlobalTracer [baseline] (258.964 ms) : 0, 258964
GlobalTracer [candidate] (258.598 ms) : 0, 258598
IAST [baseline] (23.972 ms) : 0, 23972
IAST [candidate] (23.918 ms) : 0, 23918
AppSec [baseline] (177.902 ms) : 0, 177902
AppSec [candidate] (177.444 ms) : 0, 177444
Debugger [baseline] (65.814 ms) : 0, 65814
Debugger [candidate] (65.392 ms) : 0, 65392
Remote Config [baseline] (574.048 µs) : 0, 574
Remote Config [candidate] (580.492 µs) : 0, 580
Telemetry [baseline] (9.087 ms) : 0, 9087
Telemetry [candidate] (8.942 ms) : 0, 8942
Flare Poller [baseline] (3.583 ms) : 0, 3583
Flare Poller [candidate] (3.559 ms) : 0, 3559
section iast
crashtracking [baseline] (1.203 ms) : 0, 1203
crashtracking [candidate] (1.188 ms) : 0, 1188
BytebuddyAgent [baseline] (798.214 ms) : 0, 798214
BytebuddyAgent [candidate] (797.227 ms) : 0, 797227
AgentMeter [baseline] (11.386 ms) : 0, 11386
AgentMeter [candidate] (11.361 ms) : 0, 11361
GlobalTracer [baseline] (247.891 ms) : 0, 247891
GlobalTracer [candidate] (248.059 ms) : 0, 248059
IAST [baseline] (25.142 ms) : 0, 25142
IAST [candidate] (25.058 ms) : 0, 25058
AppSec [baseline] (26.4 ms) : 0, 26400
AppSec [candidate] (26.373 ms) : 0, 26373
Debugger [baseline] (65.259 ms) : 0, 65259
Debugger [candidate] (64.612 ms) : 0, 64612
Remote Config [baseline] (558.029 µs) : 0, 558
Remote Config [candidate] (527.827 µs) : 0, 528
Telemetry [baseline] (13.432 ms) : 0, 13432
Telemetry [candidate] (14.16 ms) : 0, 14160
Flare Poller [baseline] (4.216 ms) : 0, 4216
Flare Poller [candidate] (4.263 ms) : 0, 4263
section profiling
crashtracking [baseline] (1.168 ms) : 0, 1168
crashtracking [candidate] (1.171 ms) : 0, 1171
BytebuddyAgent [baseline] (684.453 ms) : 0, 684453
BytebuddyAgent [candidate] (681.882 ms) : 0, 681882
AgentMeter [baseline] (8.77 ms) : 0, 8770
AgentMeter [candidate] (8.64 ms) : 0, 8640
GlobalTracer [baseline] (217.395 ms) : 0, 217395
GlobalTracer [candidate] (215.13 ms) : 0, 215130
AppSec [baseline] (32.406 ms) : 0, 32406
AppSec [candidate] (31.953 ms) : 0, 31953
Debugger [baseline] (64.506 ms) : 0, 64506
Debugger [candidate] (64.452 ms) : 0, 64452
Remote Config [baseline] (598.712 µs) : 0, 599
Remote Config [candidate] (581.55 µs) : 0, 582
Telemetry [baseline] (9.969 ms) : 0, 9969
Telemetry [candidate] (8.923 ms) : 0, 8923
Flare Poller [baseline] (3.529 ms) : 0, 3529
Flare Poller [candidate] (3.449 ms) : 0, 3449
ProfilingAgent [baseline] (95.184 ms) : 0, 95184
ProfilingAgent [candidate] (93.749 ms) : 0, 93749
Profiling [baseline] (95.761 ms) : 0, 95761
Profiling [candidate] (94.308 ms) : 0, 94308
LoadParameters
See matching parameters
SummaryFound 2 performance improvements and 1 performance regressions! Performance is the same for 17 metrics, 16 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~c81802884f, baseline=1.61.0-SNAPSHOT~93c3816062
dateFormat X
axisFormat %s
section baseline
no_agent (1.171 ms) : 1160, 1183
. : milestone, 1171,
iast (3.201 ms) : 3157, 3245
. : milestone, 3201,
iast_FULL (5.973 ms) : 5912, 6034
. : milestone, 5973,
iast_GLOBAL (3.617 ms) : 3568, 3667
. : milestone, 3617,
profiling (2.039 ms) : 2022, 2057
. : milestone, 2039,
tracing (1.823 ms) : 1808, 1838
. : milestone, 1823,
section candidate
no_agent (1.196 ms) : 1185, 1208
. : milestone, 1196,
iast (3.158 ms) : 3116, 3200
. : milestone, 3158,
iast_FULL (5.852 ms) : 5793, 5911
. : milestone, 5852,
iast_GLOBAL (3.543 ms) : 3491, 3594
. : milestone, 3543,
profiling (2.277 ms) : 2256, 2298
. : milestone, 2277,
tracing (1.773 ms) : 1758, 1788
. : milestone, 1773,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~c81802884f, baseline=1.61.0-SNAPSHOT~93c3816062
dateFormat X
axisFormat %s
section baseline
no_agent (17.206 ms) : 17033, 17379
. : milestone, 17206,
appsec (19.433 ms) : 19232, 19633
. : milestone, 19433,
code_origins (17.791 ms) : 17613, 17970
. : milestone, 17791,
iast (18.069 ms) : 17888, 18251
. : milestone, 18069,
profiling (18.808 ms) : 18616, 19000
. : milestone, 18808,
tracing (17.646 ms) : 17470, 17823
. : milestone, 17646,
section candidate
no_agent (17.262 ms) : 17092, 17432
. : milestone, 17262,
appsec (18.406 ms) : 18222, 18591
. : milestone, 18406,
code_origins (17.577 ms) : 17401, 17754
. : milestone, 17577,
iast (17.825 ms) : 17648, 18002
. : milestone, 17825,
profiling (19.503 ms) : 19310, 19697
. : milestone, 19503,
tracing (17.426 ms) : 17256, 17596
. : milestone, 17426,
DacapoParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 1 unstable metrics.
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~c81802884f, baseline=1.61.0-SNAPSHOT~93c3816062
dateFormat X
axisFormat %s
section baseline
no_agent (1.474 ms) : 1462, 1485
. : milestone, 1474,
appsec (3.825 ms) : 3605, 4046
. : milestone, 3825,
iast (2.25 ms) : 2181, 2320
. : milestone, 2250,
iast_GLOBAL (2.293 ms) : 2224, 2363
. : milestone, 2293,
profiling (2.103 ms) : 2047, 2160
. : milestone, 2103,
tracing (2.072 ms) : 2018, 2126
. : milestone, 2072,
section candidate
no_agent (1.47 ms) : 1458, 1481
. : milestone, 1470,
appsec (2.507 ms) : 2452, 2562
. : milestone, 2507,
iast (2.256 ms) : 2186, 2325
. : milestone, 2256,
iast_GLOBAL (2.292 ms) : 2222, 2361
. : milestone, 2292,
profiling (2.509 ms) : 2345, 2672
. : milestone, 2509,
tracing (2.071 ms) : 2017, 2125
. : milestone, 2071,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~c81802884f, baseline=1.61.0-SNAPSHOT~93c3816062
dateFormat X
axisFormat %s
section baseline
no_agent (15.3 s) : 15300000, 15300000
. : milestone, 15300000,
appsec (15.01 s) : 15010000, 15010000
. : milestone, 15010000,
iast (18.322 s) : 18322000, 18322000
. : milestone, 18322000,
iast_GLOBAL (17.806 s) : 17806000, 17806000
. : milestone, 17806000,
profiling (14.731 s) : 14731000, 14731000
. : milestone, 14731000,
tracing (15.147 s) : 15147000, 15147000
. : milestone, 15147000,
section candidate
no_agent (15.4 s) : 15400000, 15400000
. : milestone, 15400000,
appsec (15.026 s) : 15026000, 15026000
. : milestone, 15026000,
iast (18.518 s) : 18518000, 18518000
. : milestone, 18518000,
iast_GLOBAL (17.588 s) : 17588000, 17588000
. : milestone, 17588000,
profiling (14.81 s) : 14810000, 14810000
. : milestone, 14810000,
tracing (15.251 s) : 15251000, 15251000
. : milestone, 15251000,
|
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.