Commit 086b19d
committed
fix: do not allow setting __proto__ in Message constructor (#2126)
When a properties object passed to Message constructor contains
__proto__, such as in
const properties = JSON.parse('{"__proto__": {"polluted": "yes"}}');
const message = new protobuf.Message(properties);
the resulting message object will have message.polluted defined
which is not intended.
Filter out __proto__ when iterating over the keys of the properties.1 parent 827ff8e commit 086b19d
1 file changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
136 | 140 | | |
137 | 141 | | |
138 | 142 | | |
139 | | - | |
| 143 | + | |
0 commit comments