-
Notifications
You must be signed in to change notification settings - Fork 140
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
[ASM] Add null check for content body before running security checks #4950
Conversation
…ionResponseFilter processes it
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.
LGTM
Datadog ReportBranch report: ❄️ New Flaky Tests (2)
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing the following branches/commits: Execution-time benchmarks measure the whole time it takes to execute a program. And are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are shown in red. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (4950) - mean (71ms) : 62, 80
. : milestone, 71,
master - mean (71ms) : 61, 82
. : milestone, 71,
section CallTarget+Inlining+NGEN
This PR (4950) - mean (995ms) : 978, 1013
. : milestone, 995,
master - mean (995ms) : 974, 1015
. : milestone, 995,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (4950) - mean (106ms) : 103, 109
. : milestone, 106,
master - mean (106ms) : 101, 110
. : milestone, 106,
section CallTarget+Inlining+NGEN
This PR (4950) - mean (684ms) : 669, 700
. : milestone, 684,
master - mean (685ms) : 670, 700
. : milestone, 685,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (4950) - mean (90ms) : 88, 92
. : milestone, 90,
master - mean (89ms) : 85, 92
. : milestone, 89,
section CallTarget+Inlining+NGEN
This PR (4950) - mean (665ms) : 639, 691
. : milestone, 665,
master - mean (661ms) : 636, 685
. : milestone, 661,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (4950) - mean (188ms) : 185, 192
. : milestone, 188,
master - mean (188ms) : 185, 192
. : milestone, 188,
section CallTarget+Inlining+NGEN
This PR (4950) - mean (1,131ms) : 1110, 1152
. : milestone, 1131,
master - mean (1,128ms) : 1102, 1153
. : milestone, 1128,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (4950) - mean (271ms) : 268, 275
. : milestone, 271,
master - mean (271ms) : 267, 275
. : milestone, 271,
section CallTarget+Inlining+NGEN
This PR (4950) - mean (1,089ms) : 1062, 1117
. : milestone, 1089,
master - mean (1,086ms) : 1062, 1110
. : milestone, 1086,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (4950) - mean (262ms) : 256, 267
. : milestone, 262,
master - mean (261ms) : 256, 265
. : milestone, 261,
section CallTarget+Inlining+NGEN
This PR (4950) - mean (1,057ms) : 1036, 1079
. : milestone, 1057,
master - mean (1,052ms) : 1022, 1083
. : milestone, 1052,
|
Throughput/Crank Report:zap:Throughput results for AspNetCoreSimpleController comparing the following branches/commits: Cases where throughput results for the PR are worse than latest master (5% drop or greater), results are shown in red. Note that these results are based on a single point-in-time result for each branch. For full results, see one of the many, many dashboards! gantt
title Throughput Linux x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (4950) (11.309M) : 0, 11308779
master (11.626M) : 0, 11626386
benchmarks/2.9.0 (11.328M) : 0, 11327845
section Automatic
This PR (4950) (7.759M) : 0, 7758593
master (7.992M) : 0, 7991701
benchmarks/2.9.0 (8.136M) : 0, 8136367
section Trace stats
This PR (4950) (8.165M) : 0, 8164514
master (8.096M) : 0, 8095574
section Manual
This PR (4950) (9.827M) : 0, 9826716
master (9.977M) : 0, 9976603
section Manual + Automatic
This PR (4950) (7.362M) : 0, 7362332
master (7.452M) : 0, 7451788
section Version Conflict
This PR (4950) (6.662M) : 0, 6662452
master (6.671M) : 0, 6670594
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (4950) (9.653M) : 0, 9652766
master (9.409M) : 0, 9408968
benchmarks/2.9.0 (9.420M) : 0, 9419924
section Automatic
This PR (4950) (6.386M) : 0, 6386052
master (6.357M) : 0, 6356859
section Trace stats
This PR (4950) (6.941M) : 0, 6941256
master (6.816M) : 0, 6816099
section Manual
This PR (4950) (8.271M) : 0, 8271214
master (8.210M) : 0, 8210002
section Manual + Automatic
This PR (4950) (6.287M) : 0, 6287171
master (6.279M) : 0, 6278638
section Version Conflict
This PR (4950) (5.623M) : 0, 5622533
master (5.563M) : 0, 5562691
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (4950) (10.659M) : 0, 10658615
master (9.164M) : 0, 9163580
benchmarks/2.9.0 (9.398M) : 0, 9397967
section Automatic
This PR (4950) (7.519M) : 0, 7518953
master (6.719M) : 0, 6718549
benchmarks/2.9.0 (6.738M) : 0, 6737745
section Trace stats
This PR (4950) (7.894M) : 0, 7894249
master (7.093M) : 0, 7092954
section Manual
This PR (4950) (9.331M) : 0, 9330981
master (8.069M) : 0, 8069148
section Manual + Automatic
This PR (4950) (7.216M) : 0, 7215729
master (6.254M) : 0, 6253624
section Version Conflict
This PR (4950) (6.528M) : 0, 6528321
master (5.744M) : 0, 5743710
gantt
title Throughput Linux x64 (ASM) (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (4950) (7.410M) : 0, 7410392
master (7.235M) : 0, 7235099
benchmarks/2.9.0 (7.548M) : 0, 7547683
section No attack
This PR (4950) (1.977M) : 0, 1976742
master (1.933M) : 0, 1932936
benchmarks/2.9.0 (3.158M) : 0, 3158374
section Attack
This PR (4950) (1.568M) : 0, 1568011
master (1.547M) : 0, 1547342
benchmarks/2.9.0 (2.521M) : 0, 2520552
section Blocking
This PR (4950) (3.252M) : 0, 3252136
master (3.194M) : 0, 3194354
section IAST default
This PR (4950) (6.618M) : 0, 6618079
master (6.257M) : 0, 6256506
section IAST full
This PR (4950) (5.750M) : 0, 5749576
master (5.759M) : 0, 5759115
section Base vuln
This PR (4950) (0.956M) : 0, 956147
master (0.955M) : 0, 955244
section IAST vuln
This PR (4950) (0.876M) : 0, 875751
master (0.873M) : 0, 873378
|
Benchmarks Report 🐌Benchmarks for #4950 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Fewer allocations 🎉
|
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 | 41.72 KB | 41.4 KB | -323 B | -0.77% |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | WriteAndFlushEnrichedTraces |
net6.0 | 574μs | 395ns | 1.53μs | 0.546 | 0 | 0 | 41.72 KB |
master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 659μs | 372ns | 1.39μs | 0.327 | 0 | 0 | 41.71 KB |
master | WriteAndFlushEnrichedTraces |
net472 | 805μs | 3.46μs | 13.4μs | 8.2 | 2.34 | 0.391 | 53.23 KB |
#4950 | WriteAndFlushEnrichedTraces |
net6.0 | 542μs | 1.76μs | 6.57μs | 0.553 | 0 | 0 | 41.4 KB |
#4950 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 664μs | 412ns | 1.54μs | 0.334 | 0 | 0 | 41.78 KB |
#4950 | WriteAndFlushEnrichedTraces |
net472 | 844μs | 3.18μs | 12.3μs | 8.17 | 2.45 | 0.408 | 53.23 KB |
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | ExecuteNonQuery |
net6.0 | 1.03μs | 0.604ns | 2.34ns | 0.0109 | 0 | 0 | 768 B |
master | ExecuteNonQuery |
netcoreapp3.1 | 1.48μs | 0.465ns | 1.68ns | 0.0104 | 0 | 0 | 768 B |
master | ExecuteNonQuery |
net472 | 1.73μs | 3.42ns | 13.3ns | 0.115 | 0 | 0 | 730 B |
#4950 | ExecuteNonQuery |
net6.0 | 1.08μs | 0.478ns | 1.85ns | 0.0104 | 0 | 0 | 768 B |
#4950 | ExecuteNonQuery |
netcoreapp3.1 | 1.41μs | 2.13ns | 8.25ns | 0.0106 | 0 | 0 | 768 B |
#4950 | ExecuteNonQuery |
net472 | 1.79μs | 4.13ns | 16ns | 0.116 | 0 | 0 | 730 B |
Benchmarks.Trace.ElasticsearchBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #4950
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0
1.175
1,351.28
1,150.03
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0 | 1.175 | 1,351.28 | 1,150.03 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | CallElasticsearch |
net6.0 | 1.35μs | 0.598ns | 2.24ns | 0.0128 | 0 | 0 | 936 B |
master | CallElasticsearch |
netcoreapp3.1 | 1.5μs | 1.02ns | 3.82ns | 0.012 | 0 | 0 | 936 B |
master | CallElasticsearch |
net472 | 2.49μs | 3.93ns | 14.7ns | 0.151 | 0 | 0 | 955 B |
master | CallElasticsearchAsync |
net6.0 | 1.27μs | 0.502ns | 1.88ns | 0.0126 | 0 | 0 | 912 B |
master | CallElasticsearchAsync |
netcoreapp3.1 | 1.67μs | 0.697ns | 2.7ns | 0.0134 | 0 | 0 | 984 B |
master | CallElasticsearchAsync |
net472 | 2.64μs | 3.39ns | 13.1ns | 0.16 | 0.00131 | 0 | 1.01 KB |
#4950 | CallElasticsearch |
net6.0 | 1.15μs | 1.04ns | 3.87ns | 0.0133 | 0 | 0 | 936 B |
#4950 | CallElasticsearch |
netcoreapp3.1 | 1.53μs | 1.2ns | 4.66ns | 0.0129 | 0 | 0 | 936 B |
#4950 | CallElasticsearch |
net472 | 2.47μs | 2.17ns | 8.41ns | 0.151 | 0 | 0 | 955 B |
#4950 | CallElasticsearchAsync |
net6.0 | 1.26μs | 0.375ns | 1.4ns | 0.0125 | 0 | 0 | 912 B |
#4950 | CallElasticsearchAsync |
netcoreapp3.1 | 1.56μs | 0.658ns | 2.46ns | 0.0133 | 0 | 0 | 984 B |
#4950 | CallElasticsearchAsync |
net472 | 2.71μs | 0.866ns | 3.35ns | 0.16 | 0.00135 | 0 | 1.01 KB |
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | ExecuteAsync |
net6.0 | 1.26μs | 1.16ns | 4.51ns | 0.0125 | 0 | 0 | 912 B |
master | ExecuteAsync |
netcoreapp3.1 | 1.58μs | 0.947ns | 3.28ns | 0.012 | 0 | 0 | 912 B |
master | ExecuteAsync |
net472 | 1.77μs | 1.76ns | 6.33ns | 0.139 | 0 | 0 | 875 B |
#4950 | ExecuteAsync |
net6.0 | 1.31μs | 0.421ns | 1.52ns | 0.0125 | 0 | 0 | 912 B |
#4950 | ExecuteAsync |
netcoreapp3.1 | 1.56μs | 3.89ns | 15.1ns | 0.0124 | 0 | 0 | 912 B |
#4950 | ExecuteAsync |
net472 | 1.87μs | 1.05ns | 4.07ns | 0.139 | 0 | 0 | 875 B |
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | SendAsync |
net6.0 | 4.1μs | 1.18ns | 4.24ns | 0.0292 | 0 | 0 | 2.1 KB |
master | SendAsync |
netcoreapp3.1 | 5μs | 1.32ns | 4.95ns | 0.0353 | 0 | 0 | 2.63 KB |
master | SendAsync |
net472 | 7.63μs | 7.41ns | 28.7ns | 0.524 | 0 | 0 | 3.31 KB |
#4950 | SendAsync |
net6.0 | 4.06μs | 2.36ns | 9.12ns | 0.0282 | 0 | 0 | 2.1 KB |
#4950 | SendAsync |
netcoreapp3.1 | 5μs | 2.46ns | 9.54ns | 0.035 | 0 | 0 | 2.63 KB |
#4950 | SendAsync |
net472 | 7.78μs | 3.91ns | 15.1ns | 0.525 | 0 | 0 | 3.31 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ More allocations ⚠️
Slower ⚠️ in #4950
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑netcoreapp3.1
1.450
70,400.00
102,100.00
multimodal
Faster 🎉 in #4950
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑net472
1.239
62,200.00
50,200.00
More allocations ⚠️ in #4950
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑net472
59.7 KB
60.02 KB
320 B
0.54%
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑netcoreapp3.1 | 1.450 | 70,400.00 | 102,100.00 | multimodal |
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑net472 | 1.239 | 62,200.00 | 50,200.00 |
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑net472 | 59.7 KB | 60.02 KB | 320 B | 0.54% |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StringConcatBenchmark(parameters=Syste(...)ring] [48]) |
net6.0 | 62.4μs | 783ns | 7.6μs | 0 | 0 | 0 | 43.44 KB |
master | StringConcatBenchmark(parameters=Syste(...)ring] [48]) |
netcoreapp3.1 | 63μs | 960ns | 9.6μs | 0 | 0 | 0 | 42.64 KB |
master | StringConcatBenchmark(parameters=Syste(...)ring] [48]) |
net472 | 37.7μs | 128ns | 479ns | 0 | 0 | 0 | 59.7 KB |
master | StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) |
net6.0 | 65μs | 281ns | 1.01μs | 0 | 0 | 0 | 43.29 KB |
master | StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) |
netcoreapp3.1 | 70.6μs | 303ns | 1.09μs | 0 | 0 | 0 | 42.64 KB |
master | StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) |
net472 | 62.2μs | 295ns | 1.18μs | 0 | 0 | 0 | 57.34 KB |
#4950 | StringConcatBenchmark(parameters=Syste(...)ring] [48]) |
net6.0 | 58.1μs | 715ns | 6.9μs | 0 | 0 | 0 | 43.44 KB |
#4950 | StringConcatBenchmark(parameters=Syste(...)ring] [48]) |
netcoreapp3.1 | 61.8μs | 723ns | 7.12μs | 0 | 0 | 0 | 42.64 KB |
#4950 | StringConcatBenchmark(parameters=Syste(...)ring] [48]) |
net472 | 37.9μs | 46.8ns | 162ns | 0 | 0 | 0 | 60.02 KB |
#4950 | StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) |
net6.0 | 91.7μs | 2.66μs | 26.6μs | 0 | 0 | 0 | 43.29 KB |
#4950 | StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) |
netcoreapp3.1 | 103μs | 2.68μs | 26.8μs | 0 | 0 | 0 | 42.64 KB |
#4950 | StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) |
net472 | 50.2μs | 55.7ns | 193ns | 0 | 0 | 0 | 57.34 KB |
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | EnrichedLog |
net6.0 | 1.6μs | 0.78ns | 2.81ns | 0.0216 | 0 | 0 | 1.57 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.28μs | 0.858ns | 3.21ns | 0.0205 | 0 | 0 | 1.57 KB |
master | EnrichedLog |
net472 | 2.67μs | 10.8ns | 42ns | 0.238 | 0 | 0 | 1.5 KB |
#4950 | EnrichedLog |
net6.0 | 1.44μs | 0.636ns | 2.46ns | 0.0216 | 0 | 0 | 1.57 KB |
#4950 | EnrichedLog |
netcoreapp3.1 | 2.15μs | 0.669ns | 2.59ns | 0.0215 | 0 | 0 | 1.57 KB |
#4950 | EnrichedLog |
net472 | 2.59μs | 2.02ns | 7.55ns | 0.238 | 0 | 0 | 1.5 KB |
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | EnrichedLog |
net6.0 | 114μs | 101ns | 389ns | 0.057 | 0 | 0 | 4.21 KB |
master | EnrichedLog |
netcoreapp3.1 | 118μs | 60.4ns | 226ns | 0 | 0 | 0 | 4.21 KB |
master | EnrichedLog |
net472 | 151μs | 94.5ns | 354ns | 0.679 | 0.226 | 0 | 4.39 KB |
#4950 | EnrichedLog |
net6.0 | 113μs | 185ns | 691ns | 0.0562 | 0 | 0 | 4.21 KB |
#4950 | EnrichedLog |
netcoreapp3.1 | 118μs | 157ns | 610ns | 0 | 0 | 0 | 4.21 KB |
#4950 | EnrichedLog |
net472 | 151μs | 90.5ns | 339ns | 0.69 | 0.23 | 0 | 4.39 KB |
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | EnrichedLog |
net6.0 | 3.02μs | 0.898ns | 3.48ns | 0.0302 | 0 | 0 | 2.13 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.15μs | 2.65ns | 9.9ns | 0.0269 | 0 | 0 | 2.13 KB |
master | EnrichedLog |
net472 | 4.83μs | 3.57ns | 13.8ns | 0.309 | 0 | 0 | 1.95 KB |
#4950 | EnrichedLog |
net6.0 | 2.92μs | 1.12ns | 4.2ns | 0.0291 | 0 | 0 | 2.13 KB |
#4950 | EnrichedLog |
netcoreapp3.1 | 4.16μs | 1.8ns | 6.97ns | 0.029 | 0 | 0 | 2.13 KB |
#4950 | EnrichedLog |
net472 | 4.87μs | 2.35ns | 8.49ns | 0.308 | 0 | 0 | 1.95 KB |
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | SendReceive |
net6.0 | 1.31μs | 0.694ns | 2.6ns | 0.0157 | 0 | 0 | 1.1 KB |
master | SendReceive |
netcoreapp3.1 | 1.77μs | 0.5ns | 1.94ns | 0.0142 | 0 | 0 | 1.1 KB |
master | SendReceive |
net472 | 2.33μs | 1.76ns | 6.59ns | 0.177 | 0 | 0 | 1.12 KB |
#4950 | SendReceive |
net6.0 | 1.41μs | 0.645ns | 2.5ns | 0.0155 | 0 | 0 | 1.1 KB |
#4950 | SendReceive |
netcoreapp3.1 | 1.68μs | 1.12ns | 4.18ns | 0.0151 | 0 | 0 | 1.1 KB |
#4950 | SendReceive |
net472 | 2.13μs | 2.95ns | 11.1ns | 0.176 | 0 | 0 | 1.12 KB |
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | EnrichedLog |
net6.0 | 2.69μs | 0.497ns | 1.79ns | 0.0215 | 0 | 0 | 1.53 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.88μs | 3.9ns | 15.1ns | 0.0209 | 0 | 0 | 1.58 KB |
master | EnrichedLog |
net472 | 4.3μs | 1.02ns | 3.8ns | 0.312 | 0 | 0 | 1.97 KB |
#4950 | EnrichedLog |
net6.0 | 2.63μs | 1.54ns | 5.96ns | 0.021 | 0 | 0 | 1.53 KB |
#4950 | EnrichedLog |
netcoreapp3.1 | 3.95μs | 0.941ns | 3.52ns | 0.0196 | 0 | 0 | 1.58 KB |
#4950 | EnrichedLog |
net472 | 4.33μs | 1.71ns | 6.64ns | 0.311 | 0 | 0 | 1.97 KB |
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 468ns | 0.185ns | 0.715ns | 0.00737 | 0 | 0 | 536 B |
master | StartFinishSpan |
netcoreapp3.1 | 689ns | 0.243ns | 0.908ns | 0.00709 | 0 | 0 | 536 B |
master | StartFinishSpan |
net472 | 788ns | 0.135ns | 0.523ns | 0.0851 | 0 | 0 | 538 B |
master | StartFinishScope |
net6.0 | 643ns | 0.262ns | 0.979ns | 0.00922 | 0 | 0 | 656 B |
master | StartFinishScope |
netcoreapp3.1 | 771ns | 0.24ns | 0.867ns | 0.00903 | 0 | 0 | 656 B |
master | StartFinishScope |
net472 | 940ns | 0.195ns | 0.755ns | 0.0979 | 0 | 0 | 618 B |
#4950 | StartFinishSpan |
net6.0 | 501ns | 0.136ns | 0.509ns | 0.00757 | 0 | 0 | 536 B |
#4950 | StartFinishSpan |
netcoreapp3.1 | 652ns | 0.234ns | 0.875ns | 0.00741 | 0 | 0 | 536 B |
#4950 | StartFinishSpan |
net472 | 745ns | 1.25ns | 4.69ns | 0.0853 | 0 | 0 | 538 B |
#4950 | StartFinishScope |
net6.0 | 614ns | 0.145ns | 0.542ns | 0.0093 | 0 | 0 | 656 B |
#4950 | StartFinishScope |
netcoreapp3.1 | 841ns | 0.162ns | 0.583ns | 0.00852 | 0 | 0 | 656 B |
#4950 | StartFinishScope |
net472 | 916ns | 0.617ns | 2.39ns | 0.0978 | 0 | 0 | 618 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #4950
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0
1.213
592.17
718.04
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472
1.113
1,048.71
1,166.77
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 | 1.213 | 592.17 | 718.04 | |
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472 | 1.113 | 1,048.71 | 1,166.77 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | RunOnMethodBegin |
net6.0 | 592ns | 0.263ns | 1.02ns | 0.00916 | 0 | 0 | 656 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 939ns | 1.82ns | 7.04ns | 0.00878 | 0 | 0 | 656 B |
master | RunOnMethodBegin |
net472 | 1.05μs | 1.08ns | 4.19ns | 0.0981 | 0 | 0 | 618 B |
#4950 | RunOnMethodBegin |
net6.0 | 718ns | 0.168ns | 0.652ns | 0.00931 | 0 | 0 | 656 B |
#4950 | RunOnMethodBegin |
netcoreapp3.1 | 949ns | 2.87ns | 11.1ns | 0.00866 | 0 | 0 | 656 B |
#4950 | RunOnMethodBegin |
net472 | 1.17μs | 0.426ns | 1.65ns | 0.098 | 0 | 0 | 618 B |
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.
Thank you!!!
c0826e9
to
d9d67c4
Compare
e532f7b
to
7d5847a
Compare
Summary of changes
Adds a null check on the content body before running security checks.
Reason for change
When a controller returns a
Microsoft.AspNetCore.Mvc.ObjectResult
with anull
object, theValue
field will end up beingnull
. This was not being checked before and could lead to aNullReferenceException
when analyzing the content body. This PR adds the check and adds a regression test for this scenario.Implementation details
Adds nullability to the updated files and ensures that the
Microsoft.AspNetCore.Mvc.ObjectResult
has a non-null body before running security checks on the body.Test coverage
Adds a new test case (with corresponding snapshots) for test case
Datadog.Trace.Security.IntegrationTests.ApiSecurity.AspNetCoreApiSecurity.TestApiSecurityScan
that tests thenull
body behavior. Before the fix, we throw aNullReferenceException
and return a 500 status code. After the fix, we return a 204 status code (as expected).Other details
N/A