http2: avoid uaf while receiving and sending rst_stream · nodejs/node@46de80d · GitHub
Skip to content

Commit 46de80d

Browse files
authored
http2: avoid uaf while receiving and sending rst_stream
Mark the session as receiving around nghttp2_session_mem_recv() and defer RST_STREAM handling while receive is in progress. This prevents closing a stream while nghttp2 still processes it and avoids heap-use-after-free in nghttp2_session_mem_recv2(). Fixes: #64113 Signed-off-by: Evgeniy Gorbanev <gorbanev.es@gmail.com> PR-URL: #64166 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
1 parent 5520388 commit 46de80d

2 files changed

Lines changed: 120 additions & 6 deletions

File tree

‎src/node_http2.cc‎

Lines changed: 102 additions & 6 deletions

‎src/node_http2.h‎

Lines changed: 18 additions & 0 deletions

0 commit comments

Comments
 (0)