-
Notifications
You must be signed in to change notification settings - Fork 293
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
Email Injection detection in IAST #8205
base: master
Are you sure you want to change the base?
Conversation
internal-api/src/main/java/datadog/trace/api/iast/VulnerabilityMarks.java
Outdated
Show resolved
Hide resolved
internal-api/src/main/java/datadog/trace/api/iast/sink/EmailInjectionModule.java
Outdated
Show resolved
Hide resolved
dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sink/EmailInjectionModuleImpl.java
Outdated
Show resolved
Hide resolved
...ax-mail/src/main/java/datadog/trace/instrumentation/javax/mail/JavaxMailInstrumentation.java
Show resolved
Hide resolved
Nice work @sezen-datadog! you are in the right direction, we can discuss offline the caveats if you want 😃 My comments related to the new iast module can be extended if we need an Object instead of an String Just in case no one had shared with you before, this is an interesting document when we need to implement new iast vulnerabilities |
...ax-mail/src/main/java/datadog/trace/instrumentation/javax/mail/JavaxMailInstrumentation.java
Outdated
Show resolved
Hide resolved
...ax-mail/src/main/java/datadog/trace/instrumentation/javax/mail/JavaxMailInstrumentation.java
Show resolved
Hide resolved
...ax-mail/src/main/java/datadog/trace/instrumentation/javax/mail/JavaxMailInstrumentation.java
Outdated
Show resolved
Hide resolved
…/trace/instrumentation/javax/mail/JavaxMailInstrumentation.java Co-authored-by: Alejandro González García <alejandro.gonzalez@datadoghq.com>
…/trace/instrumentation/javax/mail/JavaxMailInstrumentation.java Co-authored-by: Alejandro González García <alejandro.gonzalez@datadoghq.com>
setContext and setText of Part StringEscapeUtilsCallsite |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 56 metrics, 6 unstable metrics.
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.46.0-SNAPSHOT~460737dc10, baseline=1.46.0-SNAPSHOT~fbb36f9b5b
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.053 s) : 0, 1053244
Total [baseline] (10.545 s) : 0, 10545444
Agent [candidate] (1.054 s) : 0, 1053650
Total [candidate] (10.43 s) : 0, 10430031
section appsec
Agent [baseline] (1.19 s) : 0, 1190489
Total [baseline] (10.761 s) : 0, 10760922
Agent [candidate] (1.189 s) : 0, 1189106
Total [candidate] (10.701 s) : 0, 10700542
section iast
Agent [baseline] (1.193 s) : 0, 1192665
Total [baseline] (11.026 s) : 0, 11025968
Agent [candidate] (1.187 s) : 0, 1186568
Total [candidate] (10.963 s) : 0, 10963119
section profiling
Agent [baseline] (1.253 s) : 0, 1252891
Total [baseline] (10.798 s) : 0, 10798009
Agent [candidate] (1.273 s) : 0, 1272881
Total [candidate] (10.89 s) : 0, 10890247
gantt
title petclinic - break down per module: candidate=1.46.0-SNAPSHOT~460737dc10, baseline=1.46.0-SNAPSHOT~fbb36f9b5b
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (712.559 ms) : 0, 712559
BytebuddyAgent [candidate] (713.995 ms) : 0, 713995
GlobalTracer [baseline] (254.982 ms) : 0, 254982
GlobalTracer [candidate] (255.6 ms) : 0, 255600
AppSec [baseline] (56.427 ms) : 0, 56427
AppSec [candidate] (55.34 ms) : 0, 55340
Remote Config [baseline] (740.518 µs) : 0, 741
Remote Config [candidate] (713.39 µs) : 0, 713
Telemetry [baseline] (13.651 ms) : 0, 13651
Telemetry [candidate] (12.95 ms) : 0, 12950
section appsec
BytebuddyAgent [baseline] (732.539 ms) : 0, 732539
BytebuddyAgent [candidate] (731.74 ms) : 0, 731740
GlobalTracer [baseline] (253.012 ms) : 0, 253012
GlobalTracer [candidate] (252.695 ms) : 0, 252695
AppSec [baseline] (171.37 ms) : 0, 171370
AppSec [candidate] (170.562 ms) : 0, 170562
IAST [baseline] (19.5 ms) : 0, 19500
IAST [candidate] (19.56 ms) : 0, 19560
Remote Config [baseline] (677.02 µs) : 0, 677
Remote Config [candidate] (656.145 µs) : 0, 656
Telemetry [baseline] (8.196 ms) : 0, 8196
Telemetry [candidate] (8.61 ms) : 0, 8610
section iast
BytebuddyAgent [baseline] (839.457 ms) : 0, 839457
BytebuddyAgent [candidate] (836.329 ms) : 0, 836329
GlobalTracer [baseline] (247.832 ms) : 0, 247832
GlobalTracer [candidate] (246.012 ms) : 0, 246012
AppSec [baseline] (58.567 ms) : 0, 58567
AppSec [candidate] (57.953 ms) : 0, 57953
IAST [baseline] (21.977 ms) : 0, 21977
IAST [candidate] (21.628 ms) : 0, 21628
Remote Config [baseline] (680.426 µs) : 0, 680
Remote Config [candidate] (678.126 µs) : 0, 678
Telemetry [baseline] (8.937 ms) : 0, 8937
Telemetry [candidate] (8.806 ms) : 0, 8806
section profiling
BytebuddyAgent [baseline] (702.309 ms) : 0, 702309
BytebuddyAgent [candidate] (703.504 ms) : 0, 703504
GlobalTracer [baseline] (349.197 ms) : 0, 349197
GlobalTracer [candidate] (368.893 ms) : 0, 368893
AppSec [baseline] (54.634 ms) : 0, 54634
AppSec [candidate] (54.026 ms) : 0, 54026
Remote Config [baseline] (711.009 µs) : 0, 711
Remote Config [candidate] (708.045 µs) : 0, 708
Telemetry [baseline] (8.747 ms) : 0, 8747
Telemetry [candidate] (8.862 ms) : 0, 8862
ProfilingAgent [baseline] (95.292 ms) : 0, 95292
ProfilingAgent [candidate] (94.991 ms) : 0, 94991
Profiling [baseline] (95.316 ms) : 0, 95316
Profiling [candidate] (95.017 ms) : 0, 95017
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.46.0-SNAPSHOT~460737dc10, baseline=1.46.0-SNAPSHOT~fbb36f9b5b
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.069 s) : 0, 1068928
Total [baseline] (8.66 s) : 0, 8660427
Agent [candidate] (1.063 s) : 0, 1063167
Total [candidate] (8.619 s) : 0, 8618547
section iast
Agent [baseline] (1.183 s) : 0, 1182720
Total [baseline] (9.218 s) : 0, 9218316
Agent [candidate] (1.19 s) : 0, 1189712
Total [candidate] (9.224 s) : 0, 9224043
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.183 s) : 0, 1182880
Total [baseline] (9.156 s) : 0, 9155903
Agent [candidate] (1.183 s) : 0, 1183078
Total [candidate] (9.205 s) : 0, 9204576
section iast_TELEMETRY_OFF
Agent [baseline] (1.175 s) : 0, 1175472
Total [baseline] (9.161 s) : 0, 9161404
Agent [candidate] (1.187 s) : 0, 1186534
Total [candidate] (9.206 s) : 0, 9205657
gantt
title insecure-bank - break down per module: candidate=1.46.0-SNAPSHOT~460737dc10, baseline=1.46.0-SNAPSHOT~fbb36f9b5b
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (724.354 ms) : 0, 724354
BytebuddyAgent [candidate] (719.749 ms) : 0, 719749
GlobalTracer [baseline] (258.235 ms) : 0, 258235
GlobalTracer [candidate] (257.605 ms) : 0, 257605
AppSec [baseline] (56.512 ms) : 0, 56512
AppSec [candidate] (56.202 ms) : 0, 56202
Remote Config [baseline] (756.568 µs) : 0, 757
Remote Config [candidate] (721.568 µs) : 0, 722
Telemetry [baseline] (13.853 ms) : 0, 13853
Telemetry [candidate] (13.656 ms) : 0, 13656
section iast
BytebuddyAgent [baseline] (831.975 ms) : 0, 831975
BytebuddyAgent [candidate] (837.254 ms) : 0, 837254
GlobalTracer [baseline] (246.598 ms) : 0, 246598
GlobalTracer [candidate] (247.699 ms) : 0, 247699
AppSec [baseline] (57.927 ms) : 0, 57927
AppSec [candidate] (58.258 ms) : 0, 58258
IAST [baseline] (21.731 ms) : 0, 21731
IAST [candidate] (21.749 ms) : 0, 21749
Remote Config [baseline] (670.837 µs) : 0, 671
Remote Config [candidate] (684.974 µs) : 0, 685
Telemetry [baseline] (8.883 ms) : 0, 8883
Telemetry [candidate] (8.9 ms) : 0, 8900
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (831.701 ms) : 0, 831701
BytebuddyAgent [candidate] (831.956 ms) : 0, 831956
GlobalTracer [baseline] (246.778 ms) : 0, 246778
GlobalTracer [candidate] (246.894 ms) : 0, 246894
AppSec [baseline] (58.268 ms) : 0, 58268
AppSec [candidate] (58.131 ms) : 0, 58131
IAST [baseline] (21.605 ms) : 0, 21605
IAST [candidate] (21.621 ms) : 0, 21621
Remote Config [baseline] (669.999 µs) : 0, 670
Remote Config [candidate] (675.496 µs) : 0, 675
Telemetry [baseline] (8.826 ms) : 0, 8826
Telemetry [candidate] (8.819 ms) : 0, 8819
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (826.541 ms) : 0, 826541
BytebuddyAgent [candidate] (834.512 ms) : 0, 834512
GlobalTracer [baseline] (246.002 ms) : 0, 246002
GlobalTracer [candidate] (248.131 ms) : 0, 248131
AppSec [baseline] (57.692 ms) : 0, 57692
AppSec [candidate] (58.163 ms) : 0, 58163
IAST [baseline] (20.947 ms) : 0, 20947
IAST [candidate] (21.249 ms) : 0, 21249
Remote Config [baseline] (666.653 µs) : 0, 667
Remote Config [candidate] (673.04 µs) : 0, 673
Telemetry [baseline] (8.635 ms) : 0, 8635
Telemetry [candidate] (8.686 ms) : 0, 8686
LoadParameters
See matching parameters
SummaryFound 2 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 16 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~460737dc10, baseline=1.46.0-SNAPSHOT~fbb36f9b5b
dateFormat X
axisFormat %s
section baseline
no_agent (377.659 µs) : 356, 399
. : milestone, 378,
iast (506.169 µs) : 484, 528
. : milestone, 506,
iast_FULL (748.332 µs) : 726, 770
. : milestone, 748,
iast_GLOBAL (560.994 µs) : 538, 584
. : milestone, 561,
iast_HARDCODED_SECRET_DISABLED (512.659 µs) : 490, 535
. : milestone, 513,
iast_INACTIVE (456.657 µs) : 435, 478
. : milestone, 457,
iast_TELEMETRY_OFF (497.379 µs) : 475, 519
. : milestone, 497,
tracing (449.566 µs) : 429, 470
. : milestone, 450,
section candidate
no_agent (378.071 µs) : 358, 398
. : milestone, 378,
iast (499.384 µs) : 478, 521
. : milestone, 499,
iast_FULL (659.354 µs) : 638, 681
. : milestone, 659,
iast_GLOBAL (523.915 µs) : 503, 545
. : milestone, 524,
iast_HARDCODED_SECRET_DISABLED (496.532 µs) : 475, 518
. : milestone, 497,
iast_INACTIVE (461.481 µs) : 439, 484
. : milestone, 461,
iast_TELEMETRY_OFF (482.199 µs) : 461, 504
. : milestone, 482,
tracing (451.015 µs) : 430, 472
. : milestone, 451,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~460737dc10, baseline=1.46.0-SNAPSHOT~fbb36f9b5b
dateFormat X
axisFormat %s
section baseline
no_agent (1.351 ms) : 1331, 1371
. : milestone, 1351,
appsec (1.732 ms) : 1708, 1756
. : milestone, 1732,
appsec_no_iast (1.769 ms) : 1746, 1792
. : milestone, 1769,
iast (1.503 ms) : 1478, 1527
. : milestone, 1503,
profiling (1.52 ms) : 1497, 1543
. : milestone, 1520,
tracing (1.495 ms) : 1471, 1518
. : milestone, 1495,
section candidate
no_agent (1.352 ms) : 1332, 1371
. : milestone, 1352,
appsec (1.746 ms) : 1722, 1770
. : milestone, 1746,
appsec_no_iast (1.744 ms) : 1720, 1767
. : milestone, 1744,
iast (1.5 ms) : 1477, 1523
. : milestone, 1500,
profiling (1.548 ms) : 1523, 1573
. : milestone, 1548,
tracing (1.476 ms) : 1450, 1502
. : milestone, 1476,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.46.0-SNAPSHOT~460737dc10, baseline=1.46.0-SNAPSHOT~fbb36f9b5b
dateFormat X
axisFormat %s
section baseline
no_agent (1.474 ms) : 1462, 1485
. : milestone, 1474,
appsec (2.372 ms) : 2329, 2415
. : milestone, 2372,
iast (2.115 ms) : 2060, 2169
. : milestone, 2115,
iast_GLOBAL (2.163 ms) : 2109, 2218
. : milestone, 2163,
profiling (1.974 ms) : 1931, 2017
. : milestone, 1974,
tracing (1.958 ms) : 1917, 2000
. : milestone, 1958,
section candidate
no_agent (1.479 ms) : 1467, 1491
. : milestone, 1479,
appsec (2.374 ms) : 2331, 2417
. : milestone, 2374,
iast (2.113 ms) : 2059, 2167
. : milestone, 2113,
iast_GLOBAL (2.165 ms) : 2110, 2220
. : milestone, 2165,
profiling (1.993 ms) : 1948, 2038
. : milestone, 1993,
tracing (1.968 ms) : 1926, 2010
. : milestone, 1968,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.46.0-SNAPSHOT~460737dc10, baseline=1.46.0-SNAPSHOT~fbb36f9b5b
dateFormat X
axisFormat %s
section baseline
no_agent (15.524 s) : 15524000, 15524000
. : milestone, 15524000,
appsec (15.004 s) : 15004000, 15004000
. : milestone, 15004000,
iast (18.547 s) : 18547000, 18547000
. : milestone, 18547000,
iast_GLOBAL (18.159 s) : 18159000, 18159000
. : milestone, 18159000,
profiling (15.063 s) : 15063000, 15063000
. : milestone, 15063000,
tracing (14.785 s) : 14785000, 14785000
. : milestone, 14785000,
section candidate
no_agent (14.697 s) : 14697000, 14697000
. : milestone, 14697000,
appsec (15.025 s) : 15025000, 15025000
. : milestone, 15025000,
iast (18.624 s) : 18624000, 18624000
. : milestone, 18624000,
iast_GLOBAL (18.322 s) : 18322000, 18322000
. : milestone, 18322000,
profiling (15.139 s) : 15139000, 15139000
. : milestone, 15139000,
tracing (14.843 s) : 14843000, 14843000
. : milestone, 14843000,
|
What Does This Do
Controls the mails to detect tainted content for javax mail methods, in particular, Transport.send
Motivation
Email HTML injection is a vulnerability where user input is included in the content of an email without proper validation and sanitization. This vulnerability can have severe consequences as it opens the door for various attacks, including phishing, social engineering exploits, and the exploitation of email client vulnerabilities.
This modification provides a control of the body of the email that is meant to be sent. If an injection occurred in the mail body and no sanitization has taken place, the sink will raise an alert.
Jira ticket: APPSEC-56330