Propagation of translateEscapes of String class#8186
Conversation
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 60 metrics, 3 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.46.0-SNAPSHOT~44f3db9c3a, baseline=1.46.0-SNAPSHOT~9b06903e18
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.058 s) : 0, 1057899
Total [baseline] (8.668 s) : 0, 8668464
Agent [candidate] (1.053 s) : 0, 1052559
Total [candidate] (8.618 s) : 0, 8617868
section iast
Agent [baseline] (1.183 s) : 0, 1182531
Total [baseline] (9.18 s) : 0, 9179899
Agent [candidate] (1.182 s) : 0, 1182080
Total [candidate] (9.192 s) : 0, 9191971
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.18 s) : 0, 1179823
Total [baseline] (9.148 s) : 0, 9147698
Agent [candidate] (1.181 s) : 0, 1181225
Total [candidate] (9.163 s) : 0, 9163381
section iast_TELEMETRY_OFF
Agent [baseline] (1.184 s) : 0, 1184008
Total [baseline] (9.198 s) : 0, 9197734
Agent [candidate] (1.179 s) : 0, 1178905
Total [candidate] (9.166 s) : 0, 9165519
gantt
title insecure-bank - break down per module: candidate=1.46.0-SNAPSHOT~44f3db9c3a, baseline=1.46.0-SNAPSHOT~9b06903e18
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (714.586 ms) : 0, 714586
BytebuddyAgent [candidate] (714.461 ms) : 0, 714461
GlobalTracer [baseline] (256.269 ms) : 0, 256269
GlobalTracer [candidate] (255.58 ms) : 0, 255580
AppSec [baseline] (56.997 ms) : 0, 56997
AppSec [candidate] (55.925 ms) : 0, 55925
Remote Config [baseline] (715.232 µs) : 0, 715
Remote Config [candidate] (723.661 µs) : 0, 724
Telemetry [baseline] (14.328 ms) : 0, 14328
Telemetry [candidate] (10.797 ms) : 0, 10797
section iast
BytebuddyAgent [baseline] (832.313 ms) : 0, 832313
BytebuddyAgent [candidate] (831.404 ms) : 0, 831404
GlobalTracer [baseline] (246.298 ms) : 0, 246298
GlobalTracer [candidate] (246.474 ms) : 0, 246474
AppSec [baseline] (57.903 ms) : 0, 57903
AppSec [candidate] (57.971 ms) : 0, 57971
IAST [baseline] (21.601 ms) : 0, 21601
IAST [candidate] (21.618 ms) : 0, 21618
Remote Config [baseline] (667.024 µs) : 0, 667
Remote Config [candidate] (692.242 µs) : 0, 692
Telemetry [baseline] (8.78 ms) : 0, 8780
Telemetry [candidate] (8.928 ms) : 0, 8928
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (829.77 ms) : 0, 829770
BytebuddyAgent [candidate] (830.541 ms) : 0, 830541
GlobalTracer [baseline] (246.14 ms) : 0, 246140
GlobalTracer [candidate] (246.329 ms) : 0, 246329
AppSec [baseline] (58.194 ms) : 0, 58194
AppSec [candidate] (58.427 ms) : 0, 58427
IAST [baseline] (21.363 ms) : 0, 21363
IAST [candidate] (21.494 ms) : 0, 21494
Remote Config [baseline] (660.563 µs) : 0, 661
Remote Config [candidate] (667.983 µs) : 0, 668
Telemetry [baseline] (8.729 ms) : 0, 8729
Telemetry [candidate] (8.798 ms) : 0, 8798
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (833.259 ms) : 0, 833259
BytebuddyAgent [candidate] (829.239 ms) : 0, 829239
GlobalTracer [baseline] (247.509 ms) : 0, 247509
GlobalTracer [candidate] (246.76 ms) : 0, 246760
AppSec [baseline] (58.074 ms) : 0, 58074
AppSec [candidate] (57.726 ms) : 0, 57726
IAST [baseline] (20.845 ms) : 0, 20845
IAST [candidate] (20.843 ms) : 0, 20843
Remote Config [baseline] (654.445 µs) : 0, 654
Remote Config [candidate] (662.298 µs) : 0, 662
Telemetry [baseline] (8.65 ms) : 0, 8650
Telemetry [candidate] (8.623 ms) : 0, 8623
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.46.0-SNAPSHOT~44f3db9c3a, baseline=1.46.0-SNAPSHOT~9b06903e18
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.06 s) : 0, 1059625
Total [baseline] (10.429 s) : 0, 10428629
Agent [candidate] (1.053 s) : 0, 1052741
Total [candidate] (10.433 s) : 0, 10432796
section appsec
Agent [baseline] (1.188 s) : 0, 1187757
Total [baseline] (10.72 s) : 0, 10720082
Agent [candidate] (1.189 s) : 0, 1188567
Total [candidate] (10.701 s) : 0, 10700827
section iast
Agent [baseline] (1.198 s) : 0, 1197645
Total [baseline] (10.959 s) : 0, 10958855
Agent [candidate] (1.183 s) : 0, 1182830
Total [candidate] (11.001 s) : 0, 11000770
section profiling
Agent [baseline] (1.252 s) : 0, 1252429
Total [baseline] (10.765 s) : 0, 10765017
Agent [candidate] (1.263 s) : 0, 1263297
Total [candidate] (10.947 s) : 0, 10946878
gantt
title petclinic - break down per module: candidate=1.46.0-SNAPSHOT~44f3db9c3a, baseline=1.46.0-SNAPSHOT~9b06903e18
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (716.914 ms) : 0, 716914
BytebuddyAgent [candidate] (712.42 ms) : 0, 712420
GlobalTracer [baseline] (256.602 ms) : 0, 256602
GlobalTracer [candidate] (255.227 ms) : 0, 255227
AppSec [baseline] (56.842 ms) : 0, 56842
AppSec [candidate] (55.766 ms) : 0, 55766
Remote Config [baseline] (731.586 µs) : 0, 732
Remote Config [candidate] (716.911 µs) : 0, 717
Telemetry [baseline] (13.485 ms) : 0, 13485
Telemetry [candidate] (13.661 ms) : 0, 13661
section appsec
BytebuddyAgent [baseline] (730.292 ms) : 0, 730292
BytebuddyAgent [candidate] (731.036 ms) : 0, 731036
GlobalTracer [baseline] (253.259 ms) : 0, 253259
GlobalTracer [candidate] (252.875 ms) : 0, 252875
AppSec [baseline] (170.679 ms) : 0, 170679
AppSec [candidate] (171.02 ms) : 0, 171020
Remote Config [baseline] (657.581 µs) : 0, 658
Remote Config [candidate] (670.777 µs) : 0, 671
Telemetry [baseline] (8.206 ms) : 0, 8206
Telemetry [candidate] (8.221 ms) : 0, 8221
IAST [baseline] (19.42 ms) : 0, 19420
IAST [candidate] (19.423 ms) : 0, 19423
section iast
BytebuddyAgent [baseline] (843.272 ms) : 0, 843272
BytebuddyAgent [candidate] (832.029 ms) : 0, 832029
GlobalTracer [baseline] (249.334 ms) : 0, 249334
GlobalTracer [candidate] (246.747 ms) : 0, 246747
AppSec [baseline] (58.488 ms) : 0, 58488
AppSec [candidate] (57.881 ms) : 0, 57881
Remote Config [baseline] (698.885 µs) : 0, 699
Remote Config [candidate] (655.999 µs) : 0, 656
Telemetry [baseline] (8.92 ms) : 0, 8920
Telemetry [candidate] (8.88 ms) : 0, 8880
IAST [baseline] (21.826 ms) : 0, 21826
IAST [candidate] (21.641 ms) : 0, 21641
section profiling
BytebuddyAgent [baseline] (702.657 ms) : 0, 702657
BytebuddyAgent [candidate] (708.609 ms) : 0, 708609
GlobalTracer [baseline] (349.166 ms) : 0, 349166
GlobalTracer [candidate] (352.053 ms) : 0, 352053
AppSec [baseline] (54.289 ms) : 0, 54289
AppSec [candidate] (54.789 ms) : 0, 54789
Remote Config [baseline] (652.803 µs) : 0, 653
Remote Config [candidate] (657.404 µs) : 0, 657
Telemetry [baseline] (8.805 ms) : 0, 8805
Telemetry [candidate] (8.947 ms) : 0, 8947
ProfilingAgent [baseline] (94.911 ms) : 0, 94911
ProfilingAgent [candidate] (96.012 ms) : 0, 96012
Profiling [baseline] (94.935 ms) : 0, 94935
Profiling [candidate] (96.036 ms) : 0, 96036
LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 17 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~44f3db9c3a, baseline=1.46.0-SNAPSHOT~9b06903e18
dateFormat X
axisFormat %s
section baseline
no_agent (386.278 µs) : 366, 406
. : milestone, 386,
iast (510.915 µs) : 489, 533
. : milestone, 511,
iast_FULL (737.869 µs) : 716, 760
. : milestone, 738,
iast_GLOBAL (550.058 µs) : 529, 572
. : milestone, 550,
iast_HARDCODED_SECRET_DISABLED (507.495 µs) : 486, 529
. : milestone, 507,
iast_INACTIVE (460.294 µs) : 439, 482
. : milestone, 460,
iast_TELEMETRY_OFF (492.965 µs) : 471, 515
. : milestone, 493,
tracing (449.675 µs) : 429, 471
. : milestone, 450,
section candidate
no_agent (377.126 µs) : 356, 398
. : milestone, 377,
iast (492.837 µs) : 471, 514
. : milestone, 493,
iast_FULL (655.465 µs) : 634, 677
. : milestone, 655,
iast_GLOBAL (521.237 µs) : 499, 543
. : milestone, 521,
iast_HARDCODED_SECRET_DISABLED (501.464 µs) : 480, 523
. : milestone, 501,
iast_INACTIVE (463.084 µs) : 440, 486
. : milestone, 463,
iast_TELEMETRY_OFF (481.471 µs) : 460, 503
. : milestone, 481,
tracing (450.256 µs) : 429, 471
. : milestone, 450,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~44f3db9c3a, baseline=1.46.0-SNAPSHOT~9b06903e18
dateFormat X
axisFormat %s
section baseline
no_agent (1.342 ms) : 1323, 1362
. : milestone, 1342,
appsec (1.752 ms) : 1728, 1776
. : milestone, 1752,
appsec_no_iast (1.748 ms) : 1724, 1772
. : milestone, 1748,
iast (1.506 ms) : 1481, 1530
. : milestone, 1506,
profiling (1.551 ms) : 1526, 1575
. : milestone, 1551,
tracing (1.489 ms) : 1465, 1514
. : milestone, 1489,
section candidate
no_agent (1.36 ms) : 1340, 1379
. : milestone, 1360,
appsec (1.741 ms) : 1717, 1765
. : milestone, 1741,
appsec_no_iast (1.743 ms) : 1720, 1766
. : milestone, 1743,
iast (1.509 ms) : 1486, 1533
. : milestone, 1509,
profiling (1.554 ms) : 1527, 1580
. : milestone, 1554,
tracing (1.488 ms) : 1464, 1512
. : milestone, 1488,
DacapoParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 0 unstable metrics.
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.46.0-SNAPSHOT~44f3db9c3a, baseline=1.46.0-SNAPSHOT~9b06903e18
dateFormat X
axisFormat %s
section baseline
no_agent (1.468 ms) : 1457, 1480
. : milestone, 1468,
appsec (3.568 ms) : 3355, 3780
. : milestone, 3568,
iast (2.096 ms) : 2042, 2150
. : milestone, 2096,
iast_GLOBAL (2.15 ms) : 2095, 2205
. : milestone, 2150,
profiling (1.973 ms) : 1928, 2018
. : milestone, 1973,
tracing (1.937 ms) : 1895, 1979
. : milestone, 1937,
section candidate
no_agent (1.467 ms) : 1456, 1479
. : milestone, 1467,
appsec (2.361 ms) : 2318, 2404
. : milestone, 2361,
iast (2.106 ms) : 2052, 2160
. : milestone, 2106,
iast_GLOBAL (2.153 ms) : 2097, 2208
. : milestone, 2153,
profiling (1.971 ms) : 1928, 2015
. : milestone, 1971,
tracing (1.945 ms) : 1903, 1987
. : milestone, 1945,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.46.0-SNAPSHOT~44f3db9c3a, baseline=1.46.0-SNAPSHOT~9b06903e18
dateFormat X
axisFormat %s
section baseline
no_agent (15.218 s) : 15218000, 15218000
. : milestone, 15218000,
appsec (15.07 s) : 15070000, 15070000
. : milestone, 15070000,
iast (18.943 s) : 18943000, 18943000
. : milestone, 18943000,
iast_GLOBAL (18.095 s) : 18095000, 18095000
. : milestone, 18095000,
profiling (15.074 s) : 15074000, 15074000
. : milestone, 15074000,
tracing (15.208 s) : 15208000, 15208000
. : milestone, 15208000,
section candidate
no_agent (14.876 s) : 14876000, 14876000
. : milestone, 14876000,
appsec (15.2 s) : 15200000, 15200000
. : milestone, 15200000,
iast (18.861 s) : 18861000, 18861000
. : milestone, 18861000,
iast_GLOBAL (17.964 s) : 17964000, 17964000
. : milestone, 17964000,
profiling (14.935 s) : 14935000, 14935000
. : milestone, 14935000,
tracing (15.01 s) : 15010000, 15010000
. : milestone, 15010000,
|
* Use env-entry to add tags per webapp deployment * fix gradle file * Migrate to hasmethodadvice * exclude classes from coverage * codenarc * add more repos * jacoco * Update internal-api/src/main/java/datadog/trace/api/ClassloaderConfigurationOverrides.java Co-authored-by: Bruce Bujon <PerfectSlayer@users.noreply.github.com> * review * use our named * more coverage * Update internal-api/src/main/java/datadog/trace/api/ClassloaderConfigurationOverrides.java Co-authored-by: Stuart McCulloch <stuart.mcculloch@datadoghq.com> * Update internal-api/src/main/java/datadog/trace/api/ClassloaderConfigurationOverrides.java Co-authored-by: Stuart McCulloch <stuart.mcculloch@datadoghq.com> * review * add jmh * optimize * widen muzzle excludes * exclude lazy from branch coverage * clean * Do not set contextual service name if jee-split-by-deployment is not enabled --------- Co-authored-by: Bruce Bujon <PerfectSlayer@users.noreply.github.com> Co-authored-by: Stuart McCulloch <stuart.mcculloch@datadoghq.com>
| if (rangesSelf.length == 0) { | ||
| return; // original string is not tainted | ||
| } | ||
| final Range[] newRanges = Ranges.forSubstring(0, result.length(), rangesSelf); |
There was a problem hiding this comment.
AFAIK the translateEscapes never changes the length of the original string (it's a 1to1 mapping). So I think it will be safe to just reuse original ranges array (rangesSelf)
Mariovido
left a comment
There was a problem hiding this comment.
You have some jobs in the pipeline failing, they must be green before merging :)
| given: | ||
| final taintedObjects = ctx.getTaintedObjects() | ||
| def self = addFromTaintFormat(taintedObjects, testString) | ||
| def result = self |
There was a problem hiding this comment.
| def result = self | |
| def result = self.translateEscapes() |
| return; // original string is not tainted | ||
| } | ||
| final Range[] rangesSelf = taintedSelf.getRanges(); | ||
| if (rangesSelf.length == 0) { |
There was a problem hiding this comment.
Did you copy this from another method?, we shouldn't have tainted values without ranges (if it does not have ranges then it's not tainted 😓)
| import datadog.smoketest.AbstractIast17SpringBootTest | ||
|
|
||
| class IastSpringBootSmokeTest extends AbstractIast17SpringBootTest { | ||
| } |
There was a problem hiding this comment.
Do we need empty test class?
What Does This Do
Taints translateEscapes string
Motivation
This is a feature added to String class operations in Java 15 so we add a propagation for this method
Additional Notes
Contributor Checklist
Jira ticket: APPSEC-55380