Add server.request.body.filenames support for Jersey and RESTEasy#11171
Add server.request.body.filenames support for Jersey and RESTEasy#11171
Conversation
5ca9b2f to
86c4da5
Compare
|
@codex review |
1123a3b to
510fca6
Compare
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 61 metrics, 10 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.62.0-SNAPSHOT~21a57776c3, baseline=1.62.0-SNAPSHOT~081af53226
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.061 s) : 0, 1060631
Total [baseline] (11.157 s) : 0, 11157057
Agent [candidate] (1.06 s) : 0, 1059707
Total [candidate] (10.988 s) : 0, 10987780
section appsec
Agent [baseline] (1.248 s) : 0, 1247957
Total [baseline] (11.13 s) : 0, 11130061
Agent [candidate] (1.247 s) : 0, 1247186
Total [candidate] (11.113 s) : 0, 11112506
section iast
Agent [baseline] (1.226 s) : 0, 1226424
Total [baseline] (11.386 s) : 0, 11385530
Agent [candidate] (1.225 s) : 0, 1225268
Total [candidate] (11.316 s) : 0, 11316499
section profiling
Agent [baseline] (1.184 s) : 0, 1184143
Total [baseline] (11.039 s) : 0, 11039380
Agent [candidate] (1.189 s) : 0, 1189031
Total [candidate] (11.062 s) : 0, 11061989
gantt
title petclinic - break down per module: candidate=1.62.0-SNAPSHOT~21a57776c3, baseline=1.62.0-SNAPSHOT~081af53226
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.231 ms) : 0, 1231
crashtracking [candidate] (1.235 ms) : 0, 1235
BytebuddyAgent [baseline] (634.04 ms) : 0, 634040
BytebuddyAgent [candidate] (634.944 ms) : 0, 634944
AgentMeter [baseline] (29.586 ms) : 0, 29586
AgentMeter [candidate] (29.608 ms) : 0, 29608
GlobalTracer [baseline] (249.328 ms) : 0, 249328
GlobalTracer [candidate] (249.176 ms) : 0, 249176
AppSec [baseline] (32.477 ms) : 0, 32477
AppSec [candidate] (32.371 ms) : 0, 32371
Debugger [baseline] (60.012 ms) : 0, 60012
Debugger [candidate] (60.024 ms) : 0, 60024
Remote Config [baseline] (595.114 µs) : 0, 595
Remote Config [candidate] (591.257 µs) : 0, 591
Telemetry [baseline] (8.056 ms) : 0, 8056
Telemetry [candidate] (8.002 ms) : 0, 8002
Flare Poller [baseline] (9.114 ms) : 0, 9114
Flare Poller [candidate] (7.499 ms) : 0, 7499
section appsec
crashtracking [baseline] (1.22 ms) : 0, 1220
crashtracking [candidate] (1.206 ms) : 0, 1206
BytebuddyAgent [baseline] (661.637 ms) : 0, 661637
BytebuddyAgent [candidate] (660.792 ms) : 0, 660792
AgentMeter [baseline] (12.248 ms) : 0, 12248
AgentMeter [candidate] (12.207 ms) : 0, 12207
GlobalTracer [baseline] (248.978 ms) : 0, 248978
GlobalTracer [candidate] (248.433 ms) : 0, 248433
AppSec [baseline] (185.012 ms) : 0, 185012
AppSec [candidate] (185.219 ms) : 0, 185219
Debugger [baseline] (65.661 ms) : 0, 65661
Debugger [candidate] (66.223 ms) : 0, 66223
Remote Config [baseline] (594.784 µs) : 0, 595
Remote Config [candidate] (603.785 µs) : 0, 604
Telemetry [baseline] (8.34 ms) : 0, 8340
Telemetry [candidate] (8.293 ms) : 0, 8293
Flare Poller [baseline] (3.446 ms) : 0, 3446
Flare Poller [candidate] (3.509 ms) : 0, 3509
IAST [baseline] (24.498 ms) : 0, 24498
IAST [candidate] (24.493 ms) : 0, 24493
section iast
crashtracking [baseline] (1.216 ms) : 0, 1216
crashtracking [candidate] (1.227 ms) : 0, 1227
BytebuddyAgent [baseline] (802.019 ms) : 0, 802019
BytebuddyAgent [candidate] (801.985 ms) : 0, 801985
AgentMeter [baseline] (11.609 ms) : 0, 11609
AgentMeter [candidate] (11.575 ms) : 0, 11575
GlobalTracer [baseline] (240.095 ms) : 0, 240095
GlobalTracer [candidate] (239.469 ms) : 0, 239469
AppSec [baseline] (31.86 ms) : 0, 31860
AppSec [candidate] (32.561 ms) : 0, 32561
Debugger [baseline] (64.21 ms) : 0, 64210
Debugger [candidate] (63.205 ms) : 0, 63205
Remote Config [baseline] (539.261 µs) : 0, 539
Remote Config [candidate] (541.209 µs) : 0, 541
Telemetry [baseline] (9.376 ms) : 0, 9376
Telemetry [candidate] (9.311 ms) : 0, 9311
Flare Poller [baseline] (3.546 ms) : 0, 3546
Flare Poller [candidate] (3.578 ms) : 0, 3578
IAST [baseline] (25.798 ms) : 0, 25798
IAST [candidate] (25.751 ms) : 0, 25751
section profiling
ProfilingAgent [baseline] (93.987 ms) : 0, 93987
ProfilingAgent [candidate] (93.687 ms) : 0, 93687
crashtracking [baseline] (1.178 ms) : 0, 1178
crashtracking [candidate] (1.19 ms) : 0, 1190
BytebuddyAgent [baseline] (691.33 ms) : 0, 691330
BytebuddyAgent [candidate] (694.311 ms) : 0, 694311
AgentMeter [baseline] (9.165 ms) : 0, 9165
AgentMeter [candidate] (9.174 ms) : 0, 9174
GlobalTracer [baseline] (206.807 ms) : 0, 206807
GlobalTracer [candidate] (207.935 ms) : 0, 207935
AppSec [baseline] (32.632 ms) : 0, 32632
AppSec [candidate] (33.186 ms) : 0, 33186
Debugger [baseline] (65.89 ms) : 0, 65890
Debugger [candidate] (66.096 ms) : 0, 66096
Remote Config [baseline] (573.614 µs) : 0, 574
Remote Config [candidate] (569.87 µs) : 0, 570
Telemetry [baseline] (7.791 ms) : 0, 7791
Telemetry [candidate] (7.835 ms) : 0, 7835
Flare Poller [baseline] (3.556 ms) : 0, 3556
Flare Poller [candidate] (3.525 ms) : 0, 3525
Profiling [baseline] (94.552 ms) : 0, 94552
Profiling [candidate] (94.246 ms) : 0, 94246
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.62.0-SNAPSHOT~21a57776c3, baseline=1.62.0-SNAPSHOT~081af53226
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.067 s) : 0, 1066599
Total [baseline] (8.838 s) : 0, 8837949
Agent [candidate] (1.059 s) : 0, 1058569
Total [candidate] (8.824 s) : 0, 8824144
section iast
Agent [baseline] (1.232 s) : 0, 1231785
Total [baseline] (9.569 s) : 0, 9569488
Agent [candidate] (1.233 s) : 0, 1233156
Total [candidate] (9.581 s) : 0, 9580586
gantt
title insecure-bank - break down per module: candidate=1.62.0-SNAPSHOT~21a57776c3, baseline=1.62.0-SNAPSHOT~081af53226
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.25 ms) : 0, 1250
crashtracking [candidate] (1.224 ms) : 0, 1224
BytebuddyAgent [baseline] (639.16 ms) : 0, 639160
BytebuddyAgent [candidate] (634.13 ms) : 0, 634130
AgentMeter [baseline] (29.757 ms) : 0, 29757
AgentMeter [candidate] (29.522 ms) : 0, 29522
GlobalTracer [baseline] (250.81 ms) : 0, 250810
GlobalTracer [candidate] (249.369 ms) : 0, 249369
AppSec [baseline] (32.69 ms) : 0, 32690
AppSec [candidate] (32.457 ms) : 0, 32457
Debugger [baseline] (59.59 ms) : 0, 59590
Debugger [candidate] (58.928 ms) : 0, 58928
Remote Config [baseline] (647.475 µs) : 0, 647
Remote Config [candidate] (591.153 µs) : 0, 591
Telemetry [baseline] (8.05 ms) : 0, 8050
Telemetry [candidate] (9.492 ms) : 0, 9492
Flare Poller [baseline] (8.304 ms) : 0, 8304
Flare Poller [candidate] (6.665 ms) : 0, 6665
section iast
crashtracking [baseline] (1.248 ms) : 0, 1248
crashtracking [candidate] (1.233 ms) : 0, 1233
BytebuddyAgent [baseline] (808.46 ms) : 0, 808460
BytebuddyAgent [candidate] (808.211 ms) : 0, 808211
AgentMeter [baseline] (11.719 ms) : 0, 11719
AgentMeter [candidate] (11.902 ms) : 0, 11902
GlobalTracer [baseline] (239.273 ms) : 0, 239273
GlobalTracer [candidate] (240.775 ms) : 0, 240775
IAST [baseline] (25.753 ms) : 0, 25753
IAST [candidate] (26.006 ms) : 0, 26006
AppSec [baseline] (31.115 ms) : 0, 31115
AppSec [candidate] (32.084 ms) : 0, 32084
Debugger [baseline] (64.3 ms) : 0, 64300
Debugger [candidate] (63.422 ms) : 0, 63422
Remote Config [baseline] (532.958 µs) : 0, 533
Remote Config [candidate] (526.65 µs) : 0, 527
Telemetry [baseline] (9.357 ms) : 0, 9357
Telemetry [candidate] (9.194 ms) : 0, 9194
Flare Poller [baseline] (3.621 ms) : 0, 3621
Flare Poller [candidate] (3.558 ms) : 0, 3558
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 3 performance regressions! Performance is the same for 17 metrics, 16 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.62.0-SNAPSHOT~21a57776c3, baseline=1.62.0-SNAPSHOT~081af53226
dateFormat X
axisFormat %s
section baseline
no_agent (19.088 ms) : 18895, 19281
. : milestone, 19088,
appsec (18.728 ms) : 18538, 18917
. : milestone, 18728,
code_origins (17.974 ms) : 17796, 18152
. : milestone, 17974,
iast (17.97 ms) : 17795, 18145
. : milestone, 17970,
profiling (18.23 ms) : 18049, 18411
. : milestone, 18230,
tracing (18.316 ms) : 18136, 18496
. : milestone, 18316,
section candidate
no_agent (19.343 ms) : 19143, 19543
. : milestone, 19343,
appsec (18.838 ms) : 18650, 19026
. : milestone, 18838,
code_origins (18.309 ms) : 18129, 18490
. : milestone, 18309,
iast (17.773 ms) : 17597, 17950
. : milestone, 17773,
profiling (19.262 ms) : 19066, 19458
. : milestone, 19262,
tracing (18.006 ms) : 17826, 18185
. : milestone, 18006,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.62.0-SNAPSHOT~21a57776c3, baseline=1.62.0-SNAPSHOT~081af53226
dateFormat X
axisFormat %s
section baseline
no_agent (1.28 ms) : 1269, 1292
. : milestone, 1280,
iast (3.318 ms) : 3274, 3363
. : milestone, 3318,
iast_FULL (5.978 ms) : 5917, 6038
. : milestone, 5978,
iast_GLOBAL (3.683 ms) : 3619, 3747
. : milestone, 3683,
profiling (2.182 ms) : 2162, 2202
. : milestone, 2182,
tracing (1.879 ms) : 1863, 1895
. : milestone, 1879,
section candidate
no_agent (1.244 ms) : 1233, 1255
. : milestone, 1244,
iast (3.365 ms) : 3316, 3415
. : milestone, 3365,
iast_FULL (5.961 ms) : 5902, 6020
. : milestone, 5961,
iast_GLOBAL (3.82 ms) : 3750, 3889
. : milestone, 3820,
profiling (2.2 ms) : 2178, 2221
. : milestone, 2200,
tracing (1.861 ms) : 1846, 1876
. : milestone, 1861,
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.62.0-SNAPSHOT~21a57776c3, baseline=1.62.0-SNAPSHOT~081af53226
dateFormat X
axisFormat %s
section baseline
no_agent (15.685 s) : 15685000, 15685000
. : milestone, 15685000,
appsec (14.763 s) : 14763000, 14763000
. : milestone, 14763000,
iast (18.421 s) : 18421000, 18421000
. : milestone, 18421000,
iast_GLOBAL (18.073 s) : 18073000, 18073000
. : milestone, 18073000,
profiling (14.954 s) : 14954000, 14954000
. : milestone, 14954000,
tracing (14.979 s) : 14979000, 14979000
. : milestone, 14979000,
section candidate
no_agent (15.319 s) : 15319000, 15319000
. : milestone, 15319000,
appsec (14.823 s) : 14823000, 14823000
. : milestone, 14823000,
iast (18.059 s) : 18059000, 18059000
. : milestone, 18059000,
iast_GLOBAL (17.868 s) : 17868000, 17868000
. : milestone, 17868000,
profiling (15.17 s) : 15170000, 15170000
. : milestone, 15170000,
tracing (14.906 s) : 14906000, 14906000
. : milestone, 14906000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.62.0-SNAPSHOT~21a57776c3, baseline=1.62.0-SNAPSHOT~081af53226
dateFormat X
axisFormat %s
section baseline
no_agent (1.482 ms) : 1470, 1493
. : milestone, 1482,
appsec (3.803 ms) : 3581, 4025
. : milestone, 3803,
iast (2.265 ms) : 2196, 2335
. : milestone, 2265,
iast_GLOBAL (2.305 ms) : 2236, 2375
. : milestone, 2305,
profiling (2.102 ms) : 2047, 2158
. : milestone, 2102,
tracing (2.068 ms) : 2014, 2121
. : milestone, 2068,
section candidate
no_agent (1.486 ms) : 1474, 1498
. : milestone, 1486,
appsec (3.825 ms) : 3602, 4047
. : milestone, 3825,
iast (2.265 ms) : 2196, 2334
. : milestone, 2265,
iast_GLOBAL (2.308 ms) : 2239, 2377
. : milestone, 2308,
profiling (2.103 ms) : 2047, 2158
. : milestone, 2103,
tracing (2.075 ms) : 2021, 2128
. : milestone, 2075,
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 510fca6013
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
510fca6 to
8bec00f
Compare
635a97f to
21a5777
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21a57776c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| continue; | ||
| } | ||
| String cd = cdHeaders.get(0); | ||
| for (String token : cd.split(";")) { |
There was a problem hiding this comment.
Parse quoted Content-Disposition filenames
For RESTEasy uploads where the client sends a valid quoted filename containing a semicolon, for example filename="report;.php", this split treats the semicolon inside the quoted string as a parameter separator and reports only "report to server.request.body.filenames. That corrupts the filename signal and can make filename-based AppSec rules miss the actual uploaded name; parse the Content-Disposition parameters while respecting quoted strings instead of splitting the raw header on every semicolon.
Useful? React with 👍 / 👎.
What Does This Do
Instruments Jersey 2.x, Jersey 3.x, and RESTEasy 3.x multipart request handling to fire the
requestFilesFilenamesAppSec gateway event, enabling WAF rules that act on uploaded file names.jersey-appsec-2.0MultiPartReaderServerSide.readMultiPart()to iterateFormDataBodyPartinstances and extract filenames viaFormDataContentDisposition.getFileName()jersey-appsec-3.0jakarta.*importsresteasy-appsec-3.0readFrom()advice; parsesContent-Dispositionheader manually (split on;, looks forfilename=) since RESTEasy'sInputPartAPI does not expose filenames directlyMotivation
Part of APPSEC-61873 —
server.request.body.filenamesimplementation across server frameworks.Additional Notes
Depends on #10949 and #10973 (both merged).
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 issue