Add ObjectInputStream.readObject to forbidden apis#10952
Conversation
Co-authored-by: dougqh <dougqh@gmail.com>
|
Bits Dev status: ✅ Done Comment @DataDog to request changes |
|
I can only run on private repositories. |
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~48440ff3ee, baseline=1.61.0-SNAPSHOT~b6e89cdef9
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.063 s) : 0, 1063099
Total [baseline] (8.881 s) : 0, 8881227
Agent [candidate] (1.064 s) : 0, 1064183
Total [candidate] (8.885 s) : 0, 8885065
section iast
Agent [baseline] (1.23 s) : 0, 1229854
Total [baseline] (9.613 s) : 0, 9612650
Agent [candidate] (1.233 s) : 0, 1233271
Total [candidate] (9.622 s) : 0, 9621542
gantt
title insecure-bank - break down per module: candidate=1.61.0-SNAPSHOT~48440ff3ee, baseline=1.61.0-SNAPSHOT~b6e89cdef9
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.198 ms) : 0, 1198
crashtracking [candidate] (1.231 ms) : 0, 1231
BytebuddyAgent [baseline] (631.873 ms) : 0, 631873
BytebuddyAgent [candidate] (632.433 ms) : 0, 632433
AgentMeter [baseline] (29.972 ms) : 0, 29972
AgentMeter [candidate] (29.686 ms) : 0, 29686
GlobalTracer [baseline] (259.578 ms) : 0, 259578
GlobalTracer [candidate] (259.353 ms) : 0, 259353
AppSec [baseline] (32.141 ms) : 0, 32141
AppSec [candidate] (32.061 ms) : 0, 32061
Debugger [baseline] (59.986 ms) : 0, 59986
Debugger [candidate] (60.243 ms) : 0, 60243
Remote Config [baseline] (590.571 µs) : 0, 591
Remote Config [candidate] (611.067 µs) : 0, 611
Telemetry [baseline] (8.054 ms) : 0, 8054
Telemetry [candidate] (8.111 ms) : 0, 8111
Flare Poller [baseline] (3.549 ms) : 0, 3549
Flare Poller [candidate] (4.285 ms) : 0, 4285
section iast
crashtracking [baseline] (1.198 ms) : 0, 1198
crashtracking [candidate] (1.203 ms) : 0, 1203
BytebuddyAgent [baseline] (797.856 ms) : 0, 797856
BytebuddyAgent [candidate] (799.206 ms) : 0, 799206
AgentMeter [baseline] (11.431 ms) : 0, 11431
AgentMeter [candidate] (11.427 ms) : 0, 11427
GlobalTracer [baseline] (247.795 ms) : 0, 247795
GlobalTracer [candidate] (249.103 ms) : 0, 249103
AppSec [baseline] (26.63 ms) : 0, 26630
AppSec [candidate] (26.884 ms) : 0, 26884
Debugger [baseline] (69.397 ms) : 0, 69397
Debugger [candidate] (67.789 ms) : 0, 67789
Remote Config [baseline] (535.231 µs) : 0, 535
Remote Config [candidate] (526.332 µs) : 0, 526
Telemetry [baseline] (9.731 ms) : 0, 9731
Telemetry [candidate] (11.163 ms) : 0, 11163
Flare Poller [baseline] (3.562 ms) : 0, 3562
Flare Poller [candidate] (4.0 ms) : 0, 4000
IAST [baseline] (25.463 ms) : 0, 25463
IAST [candidate] (25.692 ms) : 0, 25692
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.61.0-SNAPSHOT~48440ff3ee, baseline=1.61.0-SNAPSHOT~b6e89cdef9
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.061 s) : 0, 1060618
Total [baseline] (11.099 s) : 0, 11099328
Agent [candidate] (1.068 s) : 0, 1068219
Total [candidate] (11.094 s) : 0, 11093967
section appsec
Agent [baseline] (1.257 s) : 0, 1257320
Total [baseline] (11.168 s) : 0, 11168431
Agent [candidate] (1.26 s) : 0, 1259526
Total [candidate] (11.219 s) : 0, 11218609
section iast
Agent [baseline] (1.234 s) : 0, 1234316
Total [baseline] (11.364 s) : 0, 11363729
Agent [candidate] (1.237 s) : 0, 1237176
Total [candidate] (11.386 s) : 0, 11385913
section profiling
Agent [baseline] (1.2 s) : 0, 1200052
Total [baseline] (11.18 s) : 0, 11179950
Agent [candidate] (1.194 s) : 0, 1194236
Total [candidate] (11.047 s) : 0, 11047037
gantt
title petclinic - break down per module: candidate=1.61.0-SNAPSHOT~48440ff3ee, baseline=1.61.0-SNAPSHOT~b6e89cdef9
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.214 ms) : 0, 1214
crashtracking [candidate] (1.225 ms) : 0, 1225
BytebuddyAgent [baseline] (631.3 ms) : 0, 631300
BytebuddyAgent [candidate] (636.068 ms) : 0, 636068
AgentMeter [baseline] (29.403 ms) : 0, 29403
AgentMeter [candidate] (29.683 ms) : 0, 29683
GlobalTracer [baseline] (257.355 ms) : 0, 257355
GlobalTracer [candidate] (259.523 ms) : 0, 259523
AppSec [baseline] (31.818 ms) : 0, 31818
AppSec [candidate] (32.178 ms) : 0, 32178
Debugger [baseline] (60.413 ms) : 0, 60413
Debugger [candidate] (60.944 ms) : 0, 60944
Remote Config [baseline] (593.997 µs) : 0, 594
Remote Config [candidate] (597.763 µs) : 0, 598
Telemetry [baseline] (8.006 ms) : 0, 8006
Telemetry [candidate] (8.136 ms) : 0, 8136
Flare Poller [baseline] (4.255 ms) : 0, 4255
Flare Poller [candidate] (3.53 ms) : 0, 3530
section appsec
crashtracking [baseline] (1.218 ms) : 0, 1218
crashtracking [candidate] (1.213 ms) : 0, 1213
BytebuddyAgent [baseline] (665.296 ms) : 0, 665296
BytebuddyAgent [candidate] (665.749 ms) : 0, 665749
AgentMeter [baseline] (12.284 ms) : 0, 12284
AgentMeter [candidate] (12.323 ms) : 0, 12323
GlobalTracer [baseline] (259.992 ms) : 0, 259992
GlobalTracer [candidate] (260.993 ms) : 0, 260993
AppSec [baseline] (178.384 ms) : 0, 178384
AppSec [candidate] (178.338 ms) : 0, 178338
Debugger [baseline] (66.634 ms) : 0, 66634
Debugger [candidate] (67.184 ms) : 0, 67184
Remote Config [baseline] (642.098 µs) : 0, 642
Remote Config [candidate] (648.163 µs) : 0, 648
Telemetry [baseline] (8.277 ms) : 0, 8277
Telemetry [candidate] (8.355 ms) : 0, 8355
Flare Poller [baseline] (3.617 ms) : 0, 3617
Flare Poller [candidate] (3.689 ms) : 0, 3689
IAST [baseline] (24.362 ms) : 0, 24362
IAST [candidate] (24.455 ms) : 0, 24455
section iast
crashtracking [baseline] (1.197 ms) : 0, 1197
crashtracking [candidate] (1.226 ms) : 0, 1226
BytebuddyAgent [baseline] (799.507 ms) : 0, 799507
BytebuddyAgent [candidate] (802.288 ms) : 0, 802288
AgentMeter [baseline] (11.497 ms) : 0, 11497
AgentMeter [candidate] (11.62 ms) : 0, 11620
GlobalTracer [baseline] (249.385 ms) : 0, 249385
GlobalTracer [candidate] (249.679 ms) : 0, 249679
AppSec [baseline] (26.82 ms) : 0, 26820
AppSec [candidate] (26.579 ms) : 0, 26579
Debugger [baseline] (70.833 ms) : 0, 70833
Debugger [candidate] (70.22 ms) : 0, 70220
Remote Config [baseline] (539.645 µs) : 0, 540
Remote Config [candidate] (533.128 µs) : 0, 533
Telemetry [baseline] (9.261 ms) : 0, 9261
Telemetry [candidate] (9.769 ms) : 0, 9769
Flare Poller [baseline] (3.477 ms) : 0, 3477
Flare Poller [candidate] (3.424 ms) : 0, 3424
IAST [baseline] (25.616 ms) : 0, 25616
IAST [candidate] (25.368 ms) : 0, 25368
section profiling
ProfilingAgent [baseline] (95.458 ms) : 0, 95458
ProfilingAgent [candidate] (95.656 ms) : 0, 95656
crashtracking [baseline] (1.192 ms) : 0, 1192
crashtracking [candidate] (1.174 ms) : 0, 1174
BytebuddyAgent [baseline] (692.408 ms) : 0, 692408
BytebuddyAgent [candidate] (688.639 ms) : 0, 688639
AgentMeter [baseline] (9.142 ms) : 0, 9142
AgentMeter [candidate] (9.085 ms) : 0, 9085
GlobalTracer [baseline] (218.225 ms) : 0, 218225
GlobalTracer [candidate] (216.988 ms) : 0, 216988
AppSec [baseline] (32.694 ms) : 0, 32694
AppSec [candidate] (32.708 ms) : 0, 32708
Debugger [baseline] (67.113 ms) : 0, 67113
Debugger [candidate] (66.559 ms) : 0, 66559
Remote Config [baseline] (589.569 µs) : 0, 590
Remote Config [candidate] (575.396 µs) : 0, 575
Telemetry [baseline] (7.943 ms) : 0, 7943
Telemetry [candidate] (7.915 ms) : 0, 7915
Flare Poller [baseline] (3.631 ms) : 0, 3631
Flare Poller [candidate] (3.578 ms) : 0, 3578
Profiling [baseline] (96.019 ms) : 0, 96019
Profiling [candidate] (96.22 ms) : 0, 96220
LoadParameters
See matching parameters
SummaryFound 2 performance improvements and 0 performance regressions! Performance is the same for 17 metrics, 17 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~48440ff3ee, baseline=1.61.0-SNAPSHOT~b6e89cdef9
dateFormat X
axisFormat %s
section baseline
no_agent (18.309 ms) : 18122, 18496
. : milestone, 18309,
appsec (19.087 ms) : 18894, 19279
. : milestone, 19087,
code_origins (18.467 ms) : 18280, 18654
. : milestone, 18467,
iast (18.224 ms) : 18043, 18404
. : milestone, 18224,
profiling (18.681 ms) : 18497, 18865
. : milestone, 18681,
tracing (18.035 ms) : 17858, 18212
. : milestone, 18035,
section candidate
no_agent (18.255 ms) : 18070, 18440
. : milestone, 18255,
appsec (18.94 ms) : 18752, 19129
. : milestone, 18940,
code_origins (17.76 ms) : 17583, 17936
. : milestone, 17760,
iast (18.025 ms) : 17848, 18201
. : milestone, 18025,
profiling (19.029 ms) : 18836, 19221
. : milestone, 19029,
tracing (17.741 ms) : 17571, 17910
. : milestone, 17741,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~48440ff3ee, baseline=1.61.0-SNAPSHOT~b6e89cdef9
dateFormat X
axisFormat %s
section baseline
no_agent (1.238 ms) : 1225, 1250
. : milestone, 1238,
iast (3.361 ms) : 3313, 3410
. : milestone, 3361,
iast_FULL (5.895 ms) : 5836, 5954
. : milestone, 5895,
iast_GLOBAL (3.735 ms) : 3673, 3796
. : milestone, 3735,
profiling (2.152 ms) : 2131, 2173
. : milestone, 2152,
tracing (1.864 ms) : 1848, 1880
. : milestone, 1864,
section candidate
no_agent (1.222 ms) : 1210, 1234
. : milestone, 1222,
iast (3.165 ms) : 3123, 3208
. : milestone, 3165,
iast_FULL (6.018 ms) : 5956, 6079
. : milestone, 6018,
iast_GLOBAL (3.679 ms) : 3626, 3731
. : milestone, 3679,
profiling (2.235 ms) : 2213, 2257
. : milestone, 2235,
tracing (1.855 ms) : 1839, 1871
. : milestone, 1855,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~48440ff3ee, baseline=1.61.0-SNAPSHOT~b6e89cdef9
dateFormat X
axisFormat %s
section baseline
no_agent (1.494 ms) : 1482, 1505
. : milestone, 1494,
appsec (2.53 ms) : 2476, 2585
. : milestone, 2530,
iast (2.278 ms) : 2209, 2347
. : milestone, 2278,
iast_GLOBAL (2.326 ms) : 2256, 2396
. : milestone, 2326,
profiling (2.109 ms) : 2054, 2164
. : milestone, 2109,
tracing (2.096 ms) : 2042, 2150
. : milestone, 2096,
section candidate
no_agent (1.491 ms) : 1480, 1503
. : milestone, 1491,
appsec (3.852 ms) : 3629, 4075
. : milestone, 3852,
iast (2.276 ms) : 2207, 2346
. : milestone, 2276,
iast_GLOBAL (2.335 ms) : 2265, 2405
. : milestone, 2335,
profiling (2.134 ms) : 2077, 2190
. : milestone, 2134,
tracing (2.107 ms) : 2053, 2162
. : milestone, 2107,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~48440ff3ee, baseline=1.61.0-SNAPSHOT~b6e89cdef9
dateFormat X
axisFormat %s
section baseline
no_agent (15.025 s) : 15025000, 15025000
. : milestone, 15025000,
appsec (14.783 s) : 14783000, 14783000
. : milestone, 14783000,
iast (18.153 s) : 18153000, 18153000
. : milestone, 18153000,
iast_GLOBAL (17.81 s) : 17810000, 17810000
. : milestone, 17810000,
profiling (15.43 s) : 15430000, 15430000
. : milestone, 15430000,
tracing (14.815 s) : 14815000, 14815000
. : milestone, 14815000,
section candidate
no_agent (15.632 s) : 15632000, 15632000
. : milestone, 15632000,
appsec (14.716 s) : 14716000, 14716000
. : milestone, 14716000,
iast (18.313 s) : 18313000, 18313000
. : milestone, 18313000,
iast_GLOBAL (18.081 s) : 18081000, 18081000
. : milestone, 18081000,
profiling (14.819 s) : 14819000, 14819000
. : milestone, 14819000,
tracing (14.748 s) : 14748000, 14748000
. : milestone, 14748000,
|
| java.lang.reflect.Field#setDouble(java.lang.Object,double) | ||
| java.lang.invoke.MethodHandles.Lookup#unreflectSetter(java.lang.reflect.Field) | ||
|
|
||
| # avoid Java deserialization entrypoint |
There was a problem hiding this comment.
🎯 suggestion: What about adding reference to the security concerns expressed from the JDK documentation or even the related secure coding guidelines?
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
mergequeue build completed successfully, but the github api returned an error while merging the pr. DetailsError: PUT https://api.github.com/repos/DataDog/dd-trace-java/pulls/10952/merge: 405 Merge already in progress [] (Request ID: 9890:8D4A:DD9CD6:38D5230:69CAE786) FullStacktrace: |
Add ObjectInputStream.readObject to forbidden apis Co-authored-by: dougqh <dougqh@gmail.com> Removing unnecessary defaultmessage added by AI Adding URL to relevant documentation Merge branch 'master' into dd/prevent-objectinputstream-deserialization Co-authored-by: datadog-datadog-prod-us1[bot] <88084959+datadog-datadog-prod-us1[bot]@users.noreply.github.com> Co-authored-by: devflow.devflow-routing-intake <devflow.devflow-routing-intake@kubernetes.us1.ddbuild.io>
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What Does This Do
Adds a forbidden API filter to prevent the use of
ObjectInputStream.readObject()Motivation
Restrict future use of ObjectInputStream
Additional Notes
The filter includes a descriptive error message to guide developers on the proper way to handle exceptions when deserialization is required. This follows the same pattern as other reflection-based forbidden APIs already configured in the project.
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: APMLP-1135
PR by Bits - View session in Datadog
Comment @DataDog to request changes