Commit 03ef74b
authored
fix: sanitize mime_type and filename to prevent HTTP header injection in resumable upload
Sanitize user-supplied mime_type and filename values before they are
interpolated into HTTP request headers in prepare_resumable_upload().
CR and LF characters in these values are stripped to prevent potential
HTTP header injection. Added a _sanitize_header_value() helper that
is applied to both the X-Goog-Upload-Header-Content-Type and
X-Goog-Upload-File-Name headers.1 parent cce5398 commit 03ef74b
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
| |||
659 | 664 | | |
660 | 665 | | |
661 | 666 | | |
662 | | - | |
| 667 | + | |
663 | 668 | | |
664 | 669 | | |
665 | 670 | | |
| |||
669 | 674 | | |
670 | 675 | | |
671 | 676 | | |
672 | | - | |
| 677 | + | |
673 | 678 | | |
674 | 679 | | |
675 | 680 | | |
676 | 681 | | |
677 | 682 | | |
678 | | - | |
| 683 | + | |
679 | 684 | | |
0 commit comments