Skip to content

Commit 243b098

Browse files
murgatroid99dcodeIO
authored andcommitted
Port ReDoS vulnerability fix to Protobuf.js 5 (#1030)
1 parent 2028662 commit 243b098

11 files changed

+192
-204
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "protobuf",
33
"description": "Protocol Buffers for JavaScript. Finally.",
4-
"version": "5.0.2",
4+
"version": "5.0.3",
55
"main": "dist/protobuf.js",
66
"license": "Apache-2.0",
77
"homepage": "http://dcode.io/",

dist/protobuf-light.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
* @const
5858
* @expose
5959
*/
60-
ProtoBuf.VERSION = "5.0.2";
60+
ProtoBuf.VERSION = "5.0.3";
6161

6262
/**
6363
* Wire types.
@@ -429,10 +429,10 @@
429429
TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
430430

431431
// Type references
432-
TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
432+
TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,
433433

434434
// Fully qualified type references
435-
FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
435+
FQTYPEREF: /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,
436436

437437
// All numbers
438438
NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,

dist/protobuf-light.min.js

+80-86
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/protobuf-light.min.js.gz

-708 Bytes
Binary file not shown.

dist/protobuf-light.min.map

+3-3
Large diffs are not rendered by default.

dist/protobuf.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
* @const
5858
* @expose
5959
*/
60-
ProtoBuf.VERSION = "5.0.2";
60+
ProtoBuf.VERSION = "5.0.3";
6161

6262
/**
6363
* Wire types.
@@ -429,10 +429,10 @@
429429
TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
430430

431431
// Type references
432-
TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
432+
TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,
433433

434434
// Fully qualified type references
435-
FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
435+
FQTYPEREF: /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,
436436

437437
// All numbers
438438
NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,

dist/protobuf.min.js

+96-102
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/protobuf.min.js.gz

-685 Bytes
Binary file not shown.

dist/protobuf.min.map

+3-3
Large diffs are not rendered by default.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "protobufjs",
3-
"version": "5.0.2",
3+
"version": "5.0.3",
44
"description": "Protocol Buffers for JavaScript. Finally.",
55
"author": "Daniel Wirtz <[email protected]>",
66
"contributors": [

src/ProtoBuf/Lang.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ ProtoBuf.Lang = {
2121
TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
2222

2323
// Type references
24-
TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
24+
TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,
2525

2626
// Fully qualified type references
27-
FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
27+
FQTYPEREF: /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,
2828

2929
// All numbers
3030
NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,

0 commit comments

Comments
 (0)