Commit 9595740
committed
fix: do not percent-decode query parameter names in match
RFC 6570 expansion never percent-encodes variable names, so a
legitimate match will always have the parameter name in literal form.
Decoding names before the duplicate-key check let an attacker shadow a
real parameter by prepending a percent-encoded duplicate:
api://x?%74oken=evil&token=real -> {token: evil}
With this change the encoded form is treated as an unrecognized
parameter and ignored, so the literal form wins.1 parent 7629f62 commit 9595740
File tree
2 files changed
+11
-1
lines changed2 files changed
+11
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
563 | 569 | | |
564 | 570 | | |
565 | 571 | | |
566 | 572 | | |
567 | 573 | | |
568 | 574 | | |
569 | | - | |
570 | 575 | | |
571 | 576 | | |
572 | 577 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
453 | 458 | | |
454 | 459 | | |
455 | 460 | | |
| |||
0 commit comments