Skip to content

Commit 33e9a12

Browse files
jasnellBethGriggs
authored andcommittedJun 2, 2020
deps: update nghttp2 to 1.41.0
Fixes: https://hackerone.com/reports/446662 CVE-ID: CVE-2020-11080 PR-URL: nodejs-private/node-private#204 Backport-PR-URL: nodejs-private/node-private#207 Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
1 parent cd9827f commit 33e9a12

15 files changed

+4512
-4556
lines changed
 

Diff for: ‎deps/nghttp2/lib/CMakeLists.txt

-76
This file was deleted.

Diff for: ‎deps/nghttp2/lib/includes/nghttp2/nghttp2.h

+36
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,13 @@ typedef struct {
228228
*/
229229
#define NGHTTP2_CLIENT_MAGIC_LEN 24
230230

231+
/**
232+
* @macro
233+
*
234+
* The default max number of settings per SETTINGS frame
235+
*/
236+
#define NGHTTP2_DEFAULT_MAX_SETTINGS 32
237+
231238
/**
232239
* @enum
233240
*
@@ -398,6 +405,11 @@ typedef enum {
398405
* receives an other type of frame.
399406
*/
400407
NGHTTP2_ERR_SETTINGS_EXPECTED = -536,
408+
/**
409+
* When a local endpoint receives too many settings entries
410+
* in a single SETTINGS frame.
411+
*/
412+
NGHTTP2_ERR_TOO_MANY_SETTINGS = -537,
401413
/**
402414
* The errors < :enum:`NGHTTP2_ERR_FATAL` mean that the library is
403415
* under unexpected condition and processing was terminated (e.g.,
@@ -2659,6 +2671,17 @@ NGHTTP2_EXTERN void nghttp2_option_set_no_closed_streams(nghttp2_option *option,
26592671
NGHTTP2_EXTERN void nghttp2_option_set_max_outbound_ack(nghttp2_option *option,
26602672
size_t val);
26612673

2674+
/**
2675+
* @function
2676+
*
2677+
* This function sets the maximum number of SETTINGS entries per
2678+
* SETTINGS frame that will be accepted. If more than those entries
2679+
* are received, the peer is considered to be misbehaving and session
2680+
* will be closed. The default value is 32.
2681+
*/
2682+
NGHTTP2_EXTERN void nghttp2_option_set_max_settings(nghttp2_option *option,
2683+
size_t val);
2684+
26622685
/**
26632686
* @function
26642687
*
@@ -4769,6 +4792,19 @@ NGHTTP2_EXTERN int nghttp2_check_header_name(const uint8_t *name, size_t len);
47694792
*/
47704793
NGHTTP2_EXTERN int nghttp2_check_header_value(const uint8_t *value, size_t len);
47714794

4795+
/**
4796+
* @function
4797+
*
4798+
* Returns nonzero if the |value| which is supposed to the value of
4799+
* :authority or host header field is valid according to
4800+
* https://tools.ietf.org/html/rfc3986#section-3.2
4801+
*
4802+
* |value| is valid if it merely consists of the allowed characters.
4803+
* In particular, it does not check whether |value| follows the syntax
4804+
* of authority.
4805+
*/
4806+
NGHTTP2_EXTERN int nghttp2_check_authority(const uint8_t *value, size_t len);
4807+
47724808
/* HPACK API */
47734809

47744810
struct nghttp2_hd_deflater;

Diff for: ‎deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
* @macro
3030
* Version number of the nghttp2 library release
3131
*/
32-
#define NGHTTP2_VERSION "1.39.2"
32+
#define NGHTTP2_VERSION "1.41.0"
3333

3434
/**
3535
* @macro
3636
* Numerical representation of the version number of the nghttp2 library
3737
* release. This is a 24 bit number with 8 bits for major number, 8 bits
3838
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
3939
*/
40-
#define NGHTTP2_VERSION_NUM 0x012702
40+
#define NGHTTP2_VERSION_NUM 0x012900
4141

4242
#endif /* NGHTTP2VER_H */

Diff for: ‎deps/nghttp2/lib/nghttp2_hd.c

+5
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,11 @@ static ssize_t hd_inflate_read_huff(nghttp2_hd_inflater *inflater,
16941694
DEBUGF("inflatehd: huffman decoding failed\n");
16951695
return readlen;
16961696
}
1697+
if (nghttp2_hd_huff_decode_failure_state(&inflater->huff_decode_ctx)) {
1698+
DEBUGF("inflatehd: huffman decoding failed\n");
1699+
return NGHTTP2_ERR_HEADER_COMP;
1700+
}
1701+
16971702
inflater->left -= (size_t)readlen;
16981703
return readlen;
16991704
}

Diff for: ‎deps/nghttp2/lib/nghttp2_hd.h

+6
Original file line numberDiff line numberDiff line change
@@ -430,4 +430,10 @@ ssize_t nghttp2_hd_huff_decode(nghttp2_hd_huff_decode_context *ctx,
430430
nghttp2_buf *buf, const uint8_t *src,
431431
size_t srclen, int fin);
432432

433+
/*
434+
* nghttp2_hd_huff_decode_failure_state returns nonzero if |ctx|
435+
* indicates that huffman decoding context is in failure state.
436+
*/
437+
int nghttp2_hd_huff_decode_failure_state(nghttp2_hd_huff_decode_context *ctx);
438+
433439
#endif /* NGHTTP2_HD_H */

0 commit comments

Comments
 (0)
Please sign in to comment.