-
Notifications
You must be signed in to change notification settings - Fork 320
RUM: Prevent any Content-Length header from being set upon injection #10081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PerfectSlayer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. One minor comment / question
...-5.0/src/main/java/datadog/trace/instrumentation/servlet5/RumHttpServletResponseWrapper.java
Outdated
Show resolved
Hide resolved
...-3.0/src/main/java/datadog/trace/instrumentation/servlet3/RumHttpServletResponseWrapper.java
Outdated
Show resolved
Hide resolved
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 52 metrics, 13 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.57.0-SNAPSHOT~50c7b67c1e, baseline=1.57.0-SNAPSHOT~c426f8c01f
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.06 s) : 0, 1059746
Total [baseline] (10.852 s) : 0, 10852196
Agent [candidate] (1.053 s) : 0, 1052965
Total [candidate] (10.827 s) : 0, 10826500
section appsec
Agent [baseline] (1.236 s) : 0, 1235759
Total [baseline] (10.984 s) : 0, 10983539
Agent [candidate] (1.23 s) : 0, 1229936
Total [candidate] (10.944 s) : 0, 10943773
section iast
Agent [baseline] (1.202 s) : 0, 1202350
Total [baseline] (11.186 s) : 0, 11185538
Agent [candidate] (1.199 s) : 0, 1198676
Total [candidate] (11.179 s) : 0, 11179382
section profiling
Agent [baseline] (1.198 s) : 0, 1197557
Total [baseline] (10.893 s) : 0, 10893286
Agent [candidate] (1.21 s) : 0, 1209626
Total [candidate] (10.981 s) : 0, 10981289
gantt
title petclinic - break down per module: candidate=1.57.0-SNAPSHOT~50c7b67c1e, baseline=1.57.0-SNAPSHOT~c426f8c01f
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.491 ms) : 0, 1491
crashtracking [candidate] (1.479 ms) : 0, 1479
BytebuddyAgent [baseline] (712.548 ms) : 0, 712548
BytebuddyAgent [candidate] (707.595 ms) : 0, 707595
GlobalTracer [baseline] (250.637 ms) : 0, 250637
GlobalTracer [candidate] (249.41 ms) : 0, 249410
AppSec [baseline] (32.386 ms) : 0, 32386
AppSec [candidate] (32.051 ms) : 0, 32051
Debugger [baseline] (6.493 ms) : 0, 6493
Debugger [candidate] (6.424 ms) : 0, 6424
Remote Config [baseline] (698.547 µs) : 0, 699
Remote Config [candidate] (668.084 µs) : 0, 668
Telemetry [baseline] (14.972 ms) : 0, 14972
Telemetry [candidate] (14.155 ms) : 0, 14155
Flare Poller [baseline] (5.522 ms) : 0, 5522
Flare Poller [candidate] (6.391 ms) : 0, 6391
section appsec
crashtracking [baseline] (1.486 ms) : 0, 1486
crashtracking [candidate] (1.478 ms) : 0, 1478
BytebuddyAgent [baseline] (735.743 ms) : 0, 735743
BytebuddyAgent [candidate] (731.948 ms) : 0, 731948
GlobalTracer [baseline] (242.374 ms) : 0, 242374
GlobalTracer [candidate] (242.104 ms) : 0, 242104
AppSec [baseline] (176.458 ms) : 0, 176458
AppSec [candidate] (175.296 ms) : 0, 175296
Debugger [baseline] (6.387 ms) : 0, 6387
Debugger [candidate] (6.304 ms) : 0, 6304
Remote Config [baseline] (710.569 µs) : 0, 711
Remote Config [candidate] (695.485 µs) : 0, 695
Telemetry [baseline] (8.299 ms) : 0, 8299
Telemetry [candidate] (8.224 ms) : 0, 8224
Flare Poller [baseline] (4.052 ms) : 0, 4052
Flare Poller [candidate] (4.013 ms) : 0, 4013
IAST [baseline] (25.206 ms) : 0, 25206
IAST [candidate] (24.831 ms) : 0, 24831
section iast
crashtracking [baseline] (1.491 ms) : 0, 1491
crashtracking [candidate] (1.485 ms) : 0, 1485
BytebuddyAgent [baseline] (839.42 ms) : 0, 839420
BytebuddyAgent [candidate] (836.662 ms) : 0, 836662
GlobalTracer [baseline] (238.962 ms) : 0, 238962
GlobalTracer [candidate] (238.037 ms) : 0, 238037
AppSec [baseline] (29.022 ms) : 0, 29022
AppSec [candidate] (31.544 ms) : 0, 31544
Debugger [baseline] (6.068 ms) : 0, 6068
Debugger [candidate] (6.179 ms) : 0, 6179
Remote Config [baseline] (617.404 µs) : 0, 617
Remote Config [candidate] (619.978 µs) : 0, 620
Telemetry [baseline] (8.095 ms) : 0, 8095
Telemetry [candidate] (8.044 ms) : 0, 8044
Flare Poller [baseline] (10.794 ms) : 0, 10794
Flare Poller [candidate] (10.851 ms) : 0, 10851
IAST [baseline] (32.935 ms) : 0, 32935
IAST [candidate] (30.028 ms) : 0, 30028
section profiling
ProfilingAgent [baseline] (110.533 ms) : 0, 110533
ProfilingAgent [candidate] (112.533 ms) : 0, 112533
crashtracking [baseline] (1.44 ms) : 0, 1440
crashtracking [candidate] (1.45 ms) : 0, 1450
BytebuddyAgent [baseline] (733.931 ms) : 0, 733931
BytebuddyAgent [candidate] (741.089 ms) : 0, 741089
GlobalTracer [baseline] (222.043 ms) : 0, 222043
GlobalTracer [candidate] (223.768 ms) : 0, 223768
AppSec [baseline] (32.251 ms) : 0, 32251
AppSec [candidate] (32.639 ms) : 0, 32639
Debugger [baseline] (8.462 ms) : 0, 8462
Debugger [candidate] (7.01 ms) : 0, 7010
Remote Config [baseline] (688.323 µs) : 0, 688
Remote Config [candidate] (1.465 ms) : 0, 1465
Telemetry [baseline] (14.702 ms) : 0, 14702
Telemetry [candidate] (15.577 ms) : 0, 15577
Flare Poller [baseline] (4.134 ms) : 0, 4134
Flare Poller [candidate] (4.216 ms) : 0, 4216
Profiling [baseline] (111.171 ms) : 0, 111171
Profiling [candidate] (113.191 ms) : 0, 113191
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.57.0-SNAPSHOT~50c7b67c1e, baseline=1.57.0-SNAPSHOT~c426f8c01f
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.053 s) : 0, 1052613
Total [baseline] (8.687 s) : 0, 8686561
Agent [candidate] (1.06 s) : 0, 1059857
Total [candidate] (8.683 s) : 0, 8682870
section iast
Agent [baseline] (1.193 s) : 0, 1193362
Total [baseline] (9.351 s) : 0, 9350565
Agent [candidate] (1.199 s) : 0, 1199190
Total [candidate] (9.357 s) : 0, 9357166
gantt
title insecure-bank - break down per module: candidate=1.57.0-SNAPSHOT~50c7b67c1e, baseline=1.57.0-SNAPSHOT~c426f8c01f
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.483 ms) : 0, 1483
crashtracking [candidate] (1.497 ms) : 0, 1497
BytebuddyAgent [baseline] (707.821 ms) : 0, 707821
BytebuddyAgent [candidate] (712.756 ms) : 0, 712756
GlobalTracer [baseline] (248.808 ms) : 0, 248808
GlobalTracer [candidate] (250.508 ms) : 0, 250508
AppSec [baseline] (32.035 ms) : 0, 32035
AppSec [candidate] (32.406 ms) : 0, 32406
Debugger [baseline] (6.358 ms) : 0, 6358
Debugger [candidate] (6.484 ms) : 0, 6484
Remote Config [baseline] (678.664 µs) : 0, 679
Remote Config [candidate] (695.164 µs) : 0, 695
Telemetry [baseline] (16.416 ms) : 0, 16416
Telemetry [candidate] (15.409 ms) : 0, 15409
Flare Poller [baseline] (4.106 ms) : 0, 4106
Flare Poller [candidate] (4.961 ms) : 0, 4961
section iast
crashtracking [baseline] (1.488 ms) : 0, 1488
crashtracking [candidate] (1.489 ms) : 0, 1489
BytebuddyAgent [baseline] (832.469 ms) : 0, 832469
BytebuddyAgent [candidate] (836.576 ms) : 0, 836576
GlobalTracer [baseline] (237.697 ms) : 0, 237697
GlobalTracer [candidate] (238.464 ms) : 0, 238464
AppSec [baseline] (28.908 ms) : 0, 28908
AppSec [candidate] (30.917 ms) : 0, 30917
Debugger [baseline] (6.051 ms) : 0, 6051
Debugger [candidate] (6.033 ms) : 0, 6033
Remote Config [baseline] (605.313 µs) : 0, 605
Remote Config [candidate] (610.074 µs) : 0, 610
Telemetry [baseline] (7.992 ms) : 0, 7992
Telemetry [candidate] (8.11 ms) : 0, 8110
Flare Poller [baseline] (10.645 ms) : 0, 10645
Flare Poller [candidate] (10.746 ms) : 0, 10746
IAST [baseline] (32.683 ms) : 0, 32683
IAST [candidate] (31.162 ms) : 0, 31162
LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 2 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.57.0-SNAPSHOT~50c7b67c1e, baseline=1.57.0-SNAPSHOT~c426f8c01f
dateFormat X
axisFormat %s
section baseline
no_agent (1.28 ms) : 1268, 1293
. : milestone, 1280,
iast (3.24 ms) : 3195, 3286
. : milestone, 3240,
iast_FULL (5.948 ms) : 5887, 6008
. : milestone, 5948,
iast_GLOBAL (3.35 ms) : 3304, 3396
. : milestone, 3350,
profiling (2.3 ms) : 2275, 2325
. : milestone, 2300,
tracing (1.829 ms) : 1813, 1846
. : milestone, 1829,
section candidate
no_agent (1.208 ms) : 1197, 1220
. : milestone, 1208,
iast (3.211 ms) : 3165, 3256
. : milestone, 3211,
iast_FULL (5.791 ms) : 5734, 5849
. : milestone, 5791,
iast_GLOBAL (3.654 ms) : 3590, 3717
. : milestone, 3654,
profiling (1.969 ms) : 1951, 1987
. : milestone, 1969,
tracing (1.822 ms) : 1806, 1837
. : milestone, 1822,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.57.0-SNAPSHOT~50c7b67c1e, baseline=1.57.0-SNAPSHOT~c426f8c01f
dateFormat X
axisFormat %s
section baseline
no_agent (17.377 ms) : 17201, 17552
. : milestone, 17377,
appsec (18.761 ms) : 18571, 18950
. : milestone, 18761,
code_origins (17.67 ms) : 17496, 17844
. : milestone, 17670,
iast (17.804 ms) : 17625, 17982
. : milestone, 17804,
profiling (18.983 ms) : 18795, 19172
. : milestone, 18983,
tracing (17.857 ms) : 17681, 18033
. : milestone, 17857,
section candidate
no_agent (18.415 ms) : 18227, 18603
. : milestone, 18415,
appsec (18.519 ms) : 18332, 18705
. : milestone, 18519,
code_origins (17.722 ms) : 17548, 17895
. : milestone, 17722,
iast (18.019 ms) : 17836, 18202
. : milestone, 18019,
profiling (18.551 ms) : 18368, 18735
. : milestone, 18551,
tracing (17.464 ms) : 17295, 17633
. : milestone, 17464,
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 biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.57.0-SNAPSHOT~50c7b67c1e, baseline=1.57.0-SNAPSHOT~c426f8c01f
dateFormat X
axisFormat %s
section baseline
no_agent (14.862 s) : 14862000, 14862000
. : milestone, 14862000,
appsec (14.607 s) : 14607000, 14607000
. : milestone, 14607000,
iast (18.106 s) : 18106000, 18106000
. : milestone, 18106000,
iast_GLOBAL (17.843 s) : 17843000, 17843000
. : milestone, 17843000,
profiling (14.831 s) : 14831000, 14831000
. : milestone, 14831000,
tracing (14.901 s) : 14901000, 14901000
. : milestone, 14901000,
section candidate
no_agent (15.644 s) : 15644000, 15644000
. : milestone, 15644000,
appsec (15.059 s) : 15059000, 15059000
. : milestone, 15059000,
iast (18.657 s) : 18657000, 18657000
. : milestone, 18657000,
iast_GLOBAL (18.087 s) : 18087000, 18087000
. : milestone, 18087000,
profiling (14.819 s) : 14819000, 14819000
. : milestone, 14819000,
tracing (14.858 s) : 14858000, 14858000
. : milestone, 14858000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.57.0-SNAPSHOT~50c7b67c1e, baseline=1.57.0-SNAPSHOT~c426f8c01f
dateFormat X
axisFormat %s
section baseline
no_agent (1.474 ms) : 1462, 1485
. : milestone, 1474,
appsec (3.644 ms) : 3430, 3857
. : milestone, 3644,
iast (2.205 ms) : 2141, 2270
. : milestone, 2205,
iast_GLOBAL (2.252 ms) : 2187, 2318
. : milestone, 2252,
profiling (2.06 ms) : 2008, 2113
. : milestone, 2060,
tracing (2.034 ms) : 1983, 2085
. : milestone, 2034,
section candidate
no_agent (1.469 ms) : 1458, 1480
. : milestone, 1469,
appsec (3.688 ms) : 3471, 3904
. : milestone, 3688,
iast (2.203 ms) : 2138, 2267
. : milestone, 2203,
iast_GLOBAL (2.254 ms) : 2189, 2319
. : milestone, 2254,
profiling (2.072 ms) : 2019, 2125
. : milestone, 2072,
tracing (2.042 ms) : 1990, 2093
. : milestone, 2042,
|
What Does This Do
Application servers typically set the content length using the response methods
setContentLengthorsetContentLengthLong.However, some frameworks - Spring Security being one example - also set the content length by explicitly calling
addHeader("Content-Length", ...).This PR ensures that the content length cannot be set using
setHeaderoraddHeader, preventing the content from being accidentally truncated.It also refines CSP matching (for telemetry) because:
Tests have been added to all the spring boot modules we instrument.
Motivation
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any useful labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]