Skip to content

fix: sanitize mime_type and filename to prevent HTTP header injection in resumable upload#2371

Open
uchia6861-tech wants to merge 1 commit intogoogleapis:mainfrom
uchia6861-tech:main
Open

fix: sanitize mime_type and filename to prevent HTTP header injection in resumable upload#2371
uchia6861-tech wants to merge 1 commit intogoogleapis:mainfrom
uchia6861-tech:main

Conversation

@uchia6861-tech
Copy link
Copy Markdown

… 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.

… 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.
@uchia6861-tech
Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant