@salesforce/lwc-adapters-uiapi 1.454.0 → 1.455.0

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.
Files changed (2) hide show
  1. package/dist/main.js +25 -1
  2. package/package.json +3 -3
package/dist/main.js CHANGED
@@ -7813,7 +7813,7 @@ function buildAdapterValidationConfig(displayName, paramsMeta) {
7813
7813
  }
7814
7814
  const keyPrefix = 'UiApi';
7815
7815
 
7816
- const { assign, create, freeze, isFrozen, keys } = Object;
7816
+ const { assign, create, freeze, getPrototypeOf, isFrozen, keys } = Object;
7817
7817
  const { hasOwnProperty } = Object.prototype;
7818
7818
  const { split, endsWith } = String.prototype;
7819
7819
  const { isArray } = Array;
@@ -11075,6 +11075,24 @@ function isFieldValueRepresentation(unknown) {
11075
11075
  }
11076
11076
  return 'value' in unknown && 'displayValue' in unknown;
11077
11077
  }
11078
+ /**
11079
+ * Whether `value` is a plain data object safe to index into as a record's
11080
+ * `fields` map. getField runs as trusted (system-mode) code walking a caller-
11081
+ * supplied dot-path, so indexing into a host/exotic object (e.g. `window`) or
11082
+ * reading a prototype-chain property (e.g. `__proto__`) would let it read host
11083
+ * state on the caller's behalf -- the same class of confused-deputy sandbox
11084
+ * escape fixed for `getSObjectValue` (W-23862210). Record field maps are
11085
+ * JSON-derived plain objects, so we accept only a prototype chain that ends
11086
+ * immediately at an `Object.prototype` (or `null`), which also keeps
11087
+ * cross-realm/membrane records (LWS) valid.
11088
+ */
11089
+ function isTraversableFieldsMap(value) {
11090
+ if (typeof value !== 'object' || value === null) {
11091
+ return false;
11092
+ }
11093
+ const proto = getPrototypeOf(value);
11094
+ return proto === null || getPrototypeOf(proto) === null;
11095
+ }
11078
11096
  function getField(record, field) {
11079
11097
  const fieldApiName = getFieldApiName(field);
11080
11098
  if (fieldApiName === undefined) {
@@ -11084,7 +11102,13 @@ function getField(record, field) {
11084
11102
  const fields = unqualifiedField.split('.');
11085
11103
  let r = record;
11086
11104
  while (r && r.fields) {
11105
+ if (isTraversableFieldsMap(r.fields) === false) {
11106
+ return undefined;
11107
+ }
11087
11108
  const f = fields.shift();
11109
+ if (!hasOwnProperty.call(r.fields, f)) {
11110
+ return undefined;
11111
+ }
11088
11112
  const fvr = r.fields[f];
11089
11113
  if (fvr === undefined) {
11090
11114
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lwc-adapters-uiapi",
3
- "version": "1.454.0",
3
+ "version": "1.455.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "UIAPI adapters with LWC bindings",
6
6
  "module": "dist/main.js",
@@ -31,10 +31,10 @@
31
31
  "clean": "rm -rf dist src/generated"
32
32
  },
33
33
  "devDependencies": {
34
- "@salesforce/lds-adapters-uiapi": "^1.454.0"
34
+ "@salesforce/lds-adapters-uiapi": "^1.455.0"
35
35
  },
36
36
  "dependencies": {
37
37
  "@luvio/lwc-luvio": "0.161.2",
38
- "@salesforce/lds-default-luvio": "^1.454.0"
38
+ "@salesforce/lds-default-luvio": "^1.455.0"
39
39
  }
40
40
  }