Forbid fragments on many schema endpoints#948
Conversation
🤖 Augment PR SummarySummary: This PR tightens schema-handling endpoints by rejecting schema URIs/paths that contain a fragment (directly via Changes:
Technical Notes: REST validation checks both 🤖 Was this summary useful? React with 👍 or 👎 |
| const std::string_view request_schema, Perform perform) | ||
| -> void { | ||
| const auto &path{matches.front()}; | ||
| if (path.find('#') != std::string_view::npos || |
There was a problem hiding this comment.
serve_post rejects fragment-like paths before the OPTIONS preflight branch, so a browser CORS preflight to an invalid schema path (e.g. containing %23) will likely fail and surface as a CORS error instead of returning the intended problem response. This also affects the trace endpoint since it reuses ActionJSONSchemaEvaluate_v1::serve_post.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
There was a problem hiding this comment.
1 issue found across 18 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
Benchmark Index (community)
Details
| Benchmark suite | Current: 2c51935 | Previous: 90f0040 | Ratio |
|---|---|---|---|
Add one schema (0 existing) |
288 ms |
285 ms |
1.01 |
Add one schema (100 existing) |
26 ms |
26 ms |
1 |
Add one schema (1000 existing) |
84 ms |
84 ms |
1 |
Add one schema (10000 existing) |
715 ms |
819 ms |
0.87 |
Update one schema (1 existing) |
19 ms |
18 ms |
1.06 |
Update one schema (101 existing) |
27 ms |
27 ms |
1 |
Update one schema (1001 existing) |
85 ms |
85 ms |
1 |
Update one schema (10001 existing) |
882 ms |
709 ms |
1.24 |
Cached rebuild (1 existing) |
6 ms |
6 ms |
1 |
Cached rebuild (101 existing) |
8 ms |
8 ms |
1 |
Cached rebuild (1001 existing) |
30 ms |
30 ms |
1 |
Cached rebuild (10001 existing) |
305 ms |
311 ms |
0.98 |
Index 100 schemas |
111 ms |
111 ms |
1 |
Index 1000 schemas |
877 ms |
875 ms |
1.00 |
Index 10000 schemas |
12765 ms |
13189 ms |
0.97 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Benchmark Index (enterprise)
Details
| Benchmark suite | Current: 2c51935 | Previous: 90f0040 | Ratio |
|---|---|---|---|
Add one schema (0 existing) |
297 ms |
289 ms |
1.03 |
Add one schema (100 existing) |
29 ms |
28 ms |
1.04 |
Add one schema (1000 existing) |
83 ms |
81 ms |
1.02 |
Add one schema (10000 existing) |
678 ms |
676 ms |
1.00 |
Update one schema (1 existing) |
22 ms |
21 ms |
1.05 |
Update one schema (101 existing) |
29 ms |
28 ms |
1.04 |
Update one schema (1001 existing) |
86 ms |
83 ms |
1.04 |
Update one schema (10001 existing) |
698 ms |
696 ms |
1.00 |
Cached rebuild (1 existing) |
7 ms |
6 ms |
1.17 |
Cached rebuild (101 existing) |
9 ms |
9 ms |
1 |
Cached rebuild (1001 existing) |
30 ms |
29 ms |
1.03 |
Cached rebuild (10001 existing) |
256 ms |
254 ms |
1.01 |
Index 100 schemas |
131 ms |
119 ms |
1.10 |
Index 1000 schemas |
1053 ms |
1152 ms |
0.91 |
Index 10000 schemas |
14420 ms |
14015 ms |
1.03 |
This comment was automatically generated by workflow using github-action-benchmark.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti jv@jviotti.com