Skip to content

Revert "Reclaim one byte from HeaderString. (#6826)" - #6864

Merged
htuch merged 1 commit into
envoyproxy:masterfrom
htuch:fuzz-memcpy
May 9, 2019
Merged

htuch merged 1 commit into
envoyproxy:masterfrom
htuch:fuzz-memcpy

Conversation

@htuch

@htuch htuch commented May 8, 2019

Copy link
Copy Markdown
Member

This is failing header_map_impl_fuzz due to memcpy heap buffer overflow and should be considered a
serious security issue. Given this was only introduced in the last day and does not affect any
release, a revert and bump is the consensus of Envoy security team.

This reverts commit 977907d.

Fixes oss-fuzz issue https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14639.

Risk level: Low
Testing: Corpus entry added, bazel test //test/common/http:header_map_impl_fuzz_test --test_output=all -c dbg --config=clang-asan

Signed-off-by: Harvey Tuch [email protected]

This is failing header_map_impl_fuzz due to memcpy heap buffer overflow and should be considered a
serious security issue. Given this was only introduced in the last day and does not affect any
release, a revert and bump is the consensus of Envoy security team.

This reverts commit 977907d.

Fixes oss-fuzz issue https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14639.

Risk level: Low
Testing: Corpus entry added, bazel test //test/common/http:header_map_impl_fuzz_test --test_output=all -c dbg --config=clang-asan

Signed-off-by: Harvey Tuch <[email protected]>
@htuch
htuch requested review from dnoe and mattklein123 May 8, 2019 23:22
@htuch
htuch merged commit 3c76057 into envoyproxy:master May 9, 2019
@htuch
htuch deleted the fuzz-memcpy branch May 9, 2019 02:27
@htuch

htuch commented May 9, 2019

Copy link
Copy Markdown
Member Author

Tagging #6826 and #6580 for posterity.

@htuch

htuch commented May 9, 2019

Copy link
Copy Markdown
Member Author

I think the problematic line is

buffer_.dynamic_[size] = 0;
. We're essentially clobbering memory beyond the buffer; it's not memcpy but the line after. This limits the possible exploit, since you can only clobber adjacent memory with a NUL rather than header defined content, but this still should be considered serious enough to bump forward given that header content is under remote control and we're writing to unrelated heap.

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.

4 participants