fix use-after-free in extractHeader for multi-value headers#1017
fix use-after-free in extractHeader for multi-value headers#1017netliomax25-code wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: netliomax25-code The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @netliomax25-code. Thanks for your PR. I'm waiting for a GoogleCloudPlatform member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
extractHeader returns a string_view into the local GetAllOfHeaderAsStringResult. For a header sent with more than one value, getAllOfHeaderAsString joins the values into that result's backing string, so the returned view dangles once extractHeader returns and the result is destroyed. The callers in handler_impl.cc copy attacker-controlled headers like x-android-cert through it, reading freed heap memory. Return std::string so the bytes are copied while the backing string is still alive.