Commit 0c089b7
authored
fix(server): reject non-GET sub-requests in GET batch requests (#1813)
GET batch requests now execute only sub-requests that explicitly use the
GET method. A hand-crafted `data` query parameter could previously
smuggle POST sub-requests through a plain GET request, executing
mutations past defenses that treat GET as safe (CSRF protections,
caches, method-based rules).
## Fixes
- `BatchHandlerPlugin` rejects a GET batch with `400 GET batch requests
only accept GET sub-requests` before any sub-request executes if any
request message carries a non-GET method.
- A sub-request with the method omitted defaults to POST at execution
time, so it is rejected too; only an explicit `GET` passes.
- Legitimate clients are unaffected: `BatchLinkPlugin` only places GET
calls into GET batches and always serializes their method explicitly.
## Testing
- New tests cover a POST sub-request and an omitted-method sub-request
inside a GET batch; both return 400 and the handler never runs.
- All batch plugin, client, and e2e batch tests pass; lint and type
checks are clean.1 parent 29a900b commit 0c089b7
2 files changed
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
310 | 345 | | |
311 | 346 | | |
312 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
151 | 163 | | |
152 | 164 | | |
153 | 165 | | |
| |||
0 commit comments