@tstdl/base 0.93.53 → 0.93.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.93.53",
3
+ "version": "0.93.54",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -50,7 +50,7 @@ export class ObjectSchema extends Schema {
50
50
  let inputKeys = null;
51
51
  let inputKeyCount = 0;
52
52
  if (requiresInputKeyScan) {
53
- inputKeys = Object.keys(value);
53
+ inputKeys = Object.keys(value); // manual check of __proto__ below
54
54
  inputKeyCount = inputKeys.length;
55
55
  }
56
56
  if (isNotNull(this.minimumPropertiesCount) && (inputKeyCount < this.minimumPropertiesCount)) {
@@ -82,6 +82,9 @@ export class ObjectSchema extends Schema {
82
82
  const keyLength = inputKeys.length;
83
83
  for (let i = 0; i < keyLength; i++) {
84
84
  const key = inputKeys[i];
85
+ if (key == '__proto__') {
86
+ return { valid: false, error: new SchemaError('Property key "__proto__" is not allowed.', { path: path.add(key), fast: options.fastErrors }) };
87
+ }
85
88
  if (this.knownPropertyKeys.has(key)) {
86
89
  continue;
87
90
  }