@locker/cli 0.28.5 → 0.28.7

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/dist/index.cjs.js CHANGED
@@ -2,4 +2,4 @@
2
2
  * Copyright (C) 2026 salesforce.com, inc.
3
3
  */
4
4
  'use strict';
5
- /*! version: 0.28.5 */
5
+ /*! version: 0.28.7 */
package/dist/index.mjs.js CHANGED
@@ -2,4 +2,4 @@
2
2
  * Copyright (C) 2026 salesforce.com, inc.
3
3
  */
4
4
 
5
- /*! version: 0.28.5 */
5
+ /*! version: 0.28.7 */
@@ -1539,7 +1539,7 @@
1539
1539
  const PromiseResolve$LWS = PromiseCtor$LWS.resolve.bind(PromiseCtor$LWS);
1540
1540
  const PromiseReject$LWS = PromiseCtor$LWS.reject.bind(PromiseCtor$LWS);
1541
1541
  toSafeSet$LWS(new SetCtor$LWS$1());
1542
- /*! version: 0.28.5 */
1542
+ /*! version: 0.28.7 */
1543
1543
 
1544
1544
  /*!
1545
1545
  * Copyright (C) 2019 salesforce.com, inc.
@@ -1998,15 +1998,43 @@
1998
1998
  const lowerCasedInput$LWS = ReflectApply$LWS$1(StringProtoToLowerCase$LWS, toSafeStringValue$LWS(input$LWS), []);
1999
1999
  return ReflectApply$LWS$1(StringProtoReplace$LWS, lowerCasedInput$LWS, [INVISIBLE_CHARS_REGEX$LWS, replacement$LWS]);
2000
2000
  }
2001
- // Regex to detect DOCTYPE with internal DTD subset containing entity definitions.
2002
- // Matches: <!DOCTYPE root [...anything...]>
2003
- // The internal subset can contain ENTITY, ELEMENT, ATTLIST, NOTATION declarations.
2004
- // This is an XXE attack vector where entities can contain malicious script content.
2005
- const DOCTYPE_WITH_INTERNAL_SUBSET_REGEX$LWS = /<!doctype\s+\S+\s*\[/;
2006
- // Regex to detect DOCTYPE with SYSTEM or PUBLIC external entity references.
2007
- // Matches: <!DOCTYPE root SYSTEM "..."> or <!DOCTYPE root PUBLIC "..." "...">
2008
- // External DTDs can define entities that get expanded with malicious content.
2009
- const DOCTYPE_EXTERNAL_ENTITY_REGEX$LWS = /<!doctype\s+\S+\s+(?:system|public)\s/;
2001
+ // Regexes to detect a dangerous DOCTYPE — one carrying an internal DTD subset
2002
+ // (e.g. <!DOCTYPE root [...]>, which can hold ENTITY/ELEMENT/ATTLIST/NOTATION
2003
+ // declarations) or a SYSTEM/PUBLIC external-entity reference. Both are XXE
2004
+ // vectors: entities can be expanded with malicious content when the markup is
2005
+ // parsed as XML/SVG.
2006
+ //
2007
+ // These UNANCHORED forms are used only by the legacy whole-input fallback (when
2008
+ // the prolog-scan gate is off). They must match a DOCTYPE anywhere in the input,
2009
+ // so they cannot be anchored. The root-name token is [^>\s]+ (not \S+) so it
2010
+ // cannot span a DOCTYPE's own closing `>`, which trims — but does not eliminate —
2011
+ // bridging across unrelated downstream text in the broad scan. The prolog-scan
2012
+ // path below uses the anchored forms instead, which is the accurate check.
2013
+ const DOCTYPE_WITH_INTERNAL_SUBSET_REGEX$LWS = /<!doctype\s+[^>\s]+\s*\[/;
2014
+ const DOCTYPE_EXTERNAL_ENTITY_REGEX$LWS = /<!doctype\s+[^>\s]+\s+(?:system|public)\s/;
2015
+ // Anchored forms of the two DOCTYPE checks, used by the prolog-scan path.
2016
+ // findPrologDoctype() returns a slice that begins EXACTLY at the document's
2017
+ // prolog DOCTYPE — the only DOCTYPE a parser treats as a DTD. Anchoring with `^`
2018
+ // classifies that leading DOCTYPE and nothing else, so the regex cannot scan
2019
+ // downstream and re-match a later, inert `<!DOCTYPE ...` that is merely source
2020
+ // text — e.g. a string literal inside a minified XML-serializer bundle that
2021
+ // builds `"<!DOCTYPE "+rootName+" PUBLIC ..."`. Such a literal has no `>` between
2022
+ // `<!doctype` and `public`, so the unanchored [^>\s]+ bound alone does not stop
2023
+ // it; anchoring to the prolog slice does. (W-23591510-r1: the print-iframe fix
2024
+ // bounded the token but left the regex free to roam the whole 30 KB–2 MB slice.)
2025
+ const PROLOG_DOCTYPE_INTERNAL_SUBSET_REGEX$LWS = /^<!doctype\s+[^>\s]+\s*\[/;
2026
+ const PROLOG_DOCTYPE_EXTERNAL_ENTITY_REGEX$LWS = /^<!doctype\s+[^>\s]+\s+(?:system|public)\s/;
2027
+ // Regex to detect a namespaced <script> whose start tag carries an xmlns
2028
+ // declaration. Matches <script or <prefix:script (the leading [<:]), then a
2029
+ // whitespace or `/` separator so decoy tags like <scripting> or <scriptx> are
2030
+ // not matched, then scans the start tag up to xmlns. The gap alternation treats
2031
+ // quoted attribute values as opaque ("[^"]*" and '[^']*') so a `>` inside an
2032
+ // attribute value (e.g. title=">") cannot prematurely end the start tag and let
2033
+ // the real xmlns escape the scan. Requiring xmlns inside the script start tag —
2034
+ // rather than anywhere in the body — is what distinguishes the executable XML
2035
+ // namespaced-script vector from benign HTML that merely mentions "xmlns"
2036
+ // elsewhere (e.g. a sanitizer's attribute allowlist).
2037
+ const NAMESPACED_SCRIPT_XMLNS_REGEX$LWS = /[<:]script[\s/](?:[^>"']|"[^"]*"|'[^']*')*xmlns/;
2010
2038
  const DOCTYPE_OPENER$LWS = '<!doctype';
2011
2039
  const PI_OPENER$LWS = '<?';
2012
2040
  const PI_CLOSER$LWS = '?>';
@@ -2106,7 +2134,7 @@
2106
2134
  if (prologDoctype$LWS === null) {
2107
2135
  return false;
2108
2136
  }
2109
- return ReflectApply$LWS$1(RegExpProtoTest$LWS$1, DOCTYPE_WITH_INTERNAL_SUBSET_REGEX$LWS, [prologDoctype$LWS]) || ReflectApply$LWS$1(RegExpProtoTest$LWS$1, DOCTYPE_EXTERNAL_ENTITY_REGEX$LWS, [prologDoctype$LWS]);
2137
+ return ReflectApply$LWS$1(RegExpProtoTest$LWS$1, PROLOG_DOCTYPE_INTERNAL_SUBSET_REGEX$LWS, [prologDoctype$LWS]) || ReflectApply$LWS$1(RegExpProtoTest$LWS$1, PROLOG_DOCTYPE_EXTERNAL_ENTITY_REGEX$LWS, [prologDoctype$LWS]);
2110
2138
  }
2111
2139
  return ReflectApply$LWS$1(RegExpProtoTest$LWS$1, DOCTYPE_WITH_INTERNAL_SUBSET_REGEX$LWS, [normalizedInput$LWS]) || ReflectApply$LWS$1(RegExpProtoTest$LWS$1, DOCTYPE_EXTERNAL_ENTITY_REGEX$LWS, [normalizedInput$LWS]);
2112
2140
  };
@@ -2116,10 +2144,18 @@
2116
2144
  // when the namespace is XHTML or SVG. The namespace URL itself can be
2117
2145
  // obfuscated with XML character entities in attribute values, but the
2118
2146
  // xmlns attribute name cannot, so checking for "xmlns" is reliable.
2147
+ //
2148
+ // The xmlns must appear inside the script start tag for the namespace to
2149
+ // apply to that script. An earlier form only checked for a <script> tag and
2150
+ // the substring "xmlns" anywhere in the body; that false-positived on benign
2151
+ // HTML that carries a plain <script> and also mentions "xmlns" in an
2152
+ // unrelated place (a sanitizer's attribute allowlist, an SVG child element,
2153
+ // a string literal). NAMESPACED_SCRIPT_XMLNS_REGEX ties the two together by
2154
+ // scanning from the script start tag to xmlns within the same tag.
2119
2155
  // eslint-disable-next-line class-methods-use-this
2120
2156
  this.isXMLNamespacedScriptAttack = input$LWS => {
2121
- const normalizedInput$LWS = normalizeInput$LWS(input$LWS);
2122
- return hasTag$LWS(normalizedInput$LWS, 'script') && ReflectApply$LWS$1(StringProtoIncludes$LWS, normalizedInput$LWS, ['xmlns']);
2157
+ const normalizedInput$LWS = ReflectApply$LWS$1(StringProtoReplace$LWS, normalizeInput$LWS(input$LWS), [/\s+/g, ' ']);
2158
+ return ReflectApply$LWS$1(RegExpProtoTest$LWS$1, NAMESPACED_SCRIPT_XMLNS_REGEX$LWS, [normalizedInput$LWS]);
2123
2159
  };
2124
2160
  // Detects the iframe+srcdoc substring combination in raw input.
2125
2161
  // Any HTML or XML containing both <iframe> and the substring
@@ -2619,7 +2655,7 @@
2619
2655
  const XhrProtoResponseTextGetter$LWS = ObjectLookupOwnGetter$LWS$1(XhrProto$LWS, 'responseText');
2620
2656
  const XhrProtoStatusGetter$LWS = ObjectLookupOwnGetter$LWS$1(XhrProto$LWS, 'status');
2621
2657
  ObjectLookupOwnSetter$LWS(XhrProto$LWS, 'withCredentials');
2622
- /*! version: 0.28.5 */
2658
+ /*! version: 0.28.7 */
2623
2659
 
2624
2660
  /*!
2625
2661
  * Copyright (C) 2019 salesforce.com, inc.
@@ -2787,7 +2823,7 @@
2787
2823
  }
2788
2824
  return sanitized$LWS;
2789
2825
  }
2790
- /*! version: 0.28.5 */
2826
+ /*! version: 0.28.7 */
2791
2827
 
2792
2828
  /*!
2793
2829
  * Copyright (C) 2023 salesforce.com, inc.
@@ -2863,7 +2899,7 @@
2863
2899
  // swallow
2864
2900
  }
2865
2901
  const trusted = createPolicy('trusted', policyOptions);
2866
- /*! version: 0.28.5 */
2902
+ /*! version: 0.28.7 */
2867
2903
 
2868
2904
  /*!
2869
2905
  * Copyright (C) 2019 salesforce.com, inc.
@@ -3172,7 +3208,7 @@
3172
3208
  }
3173
3209
  return getSanitizerForConfig$LWS(sandboxKey$LWS, 'STRING_BLOB_HTML');
3174
3210
  }
3175
- /*! version: 0.28.5 */
3211
+ /*! version: 0.28.7 */
3176
3212
 
3177
3213
  /*!
3178
3214
  * Copyright (C) 2023 salesforce.com, inc.
@@ -3381,7 +3417,7 @@
3381
3417
  ReflectApply$LWS$1(ElementProtoSetAttributeNS$LWS, targetElement$LWS, [attributeNamespaceURI$LWS, attributeName$LWS, src$LWS]);
3382
3418
  };
3383
3419
  }
3384
- /*! version: 0.28.5 */
3420
+ /*! version: 0.28.7 */
3385
3421
 
3386
3422
  /*!
3387
3423
  * Copyright (C) 2019 salesforce.com, inc.
@@ -9437,7 +9473,13 @@
9437
9473
  }) {
9438
9474
  const distortionEntry$LWS = [originalGetRootNode$LWS, function getRootNode$LWS(...args$LWS) {
9439
9475
  const realRoot$LWS = ReflectApply$LWS$1(originalGetRootNode$LWS, this, args$LWS);
9440
- if (isGaterEnabledFeature$LWS('changesSince.264') && realRoot$LWS instanceof ShadowRoot$LWS && !isShadowRootAccessibleInThisSandbox$LWS(key$LWS, realRoot$LWS)) {
9476
+ // Gated OFF by default (restrictCrossSandboxNodeTraversal, not in
9477
+ // LWS_DEFAULT_GATER_FEATURES). The cross-sandbox traversal restriction
9478
+ // returns the sandbox document for a foreign ShadowRoot, which breaks a
9479
+ // legitimate getRootNode() within a single app that spans multiple sandbox
9480
+ // keys (e.g. OmniStudio). Re-enable per-org via the gate once the ownership
9481
+ // model can represent multi-namespace apps.
9482
+ if (isGaterEnabledFeature$LWS('restrictCrossSandboxNodeTraversal') && realRoot$LWS instanceof ShadowRoot$LWS && !isShadowRootAccessibleInThisSandbox$LWS(key$LWS, realRoot$LWS)) {
9441
9483
  return document$LWS;
9442
9484
  }
9443
9485
  return realRoot$LWS;
@@ -9526,7 +9568,12 @@
9526
9568
  }) {
9527
9569
  const distortionEntry$LWS = [originalParentElementGetter$LWS, function parentElement$LWS() {
9528
9570
  const parent$LWS = ReflectApply$LWS$1(originalParentElementGetter$LWS, this, []);
9529
- if (parent$LWS === null || !isGaterEnabledFeature$LWS('changesSince.264')) {
9571
+ // Gated OFF by default (restrictCrossSandboxNodeTraversal, not in
9572
+ // LWS_DEFAULT_GATER_FEATURES). The cross-sandbox traversal restriction
9573
+ // nulls a legitimate upward walk within a single app that spans multiple
9574
+ // sandbox keys (e.g. OmniStudio). Re-enable per-org via the gate once the
9575
+ // ownership model can represent multi-namespace apps.
9576
+ if (parent$LWS === null || !isGaterEnabledFeature$LWS('restrictCrossSandboxNodeTraversal')) {
9530
9577
  return parent$LWS;
9531
9578
  }
9532
9579
  const parentRoot$LWS = ReflectApply$LWS$1(originalGetRootNode$LWS, parent$LWS, []);
@@ -9551,7 +9598,12 @@
9551
9598
  }) {
9552
9599
  const distortionEntry$LWS = [originalParentNodeGetter$LWS, function parentNode$LWS() {
9553
9600
  const parent$LWS = ReflectApply$LWS$1(originalParentNodeGetter$LWS, this, []);
9554
- if (parent$LWS === null || !isGaterEnabledFeature$LWS('changesSince.264')) {
9601
+ // Gated OFF by default (restrictCrossSandboxNodeTraversal, not in
9602
+ // LWS_DEFAULT_GATER_FEATURES). The cross-sandbox traversal restriction
9603
+ // nulls a legitimate upward walk within a single app that spans multiple
9604
+ // sandbox keys (e.g. OmniStudio). Re-enable per-org via the gate once the
9605
+ // ownership model can represent multi-namespace apps.
9606
+ if (parent$LWS === null || !isGaterEnabledFeature$LWS('restrictCrossSandboxNodeTraversal')) {
9555
9607
  return parent$LWS;
9556
9608
  }
9557
9609
  const parentRoot$LWS = ReflectApply$LWS$1(originalGetRootNode$LWS, parent$LWS, []);
@@ -12769,7 +12821,7 @@
12769
12821
  const UIEventProtoBlockedProperties$LWS = ['rangeParent'];
12770
12822
  const WindowBlockedProperties$LWS = ['find', 'requestFileSystem', 'webkitRequestFileSystem'];
12771
12823
  const XSLTProcessorProtoBlockedProperties$LWS = ['transformToDocument', 'transformToFragment'];
12772
- /*! version: 0.28.5 */
12824
+ /*! version: 0.28.7 */
12773
12825
 
12774
12826
  /*!
12775
12827
  * Copyright (C) 2021 salesforce.com, inc.
@@ -12778,7 +12830,7 @@
12778
12830
  function getPdpSchema$LWS() {
12779
12831
  return pdpSchema$LWS;
12780
12832
  }
12781
- /*! version: 0.28.5 */
12833
+ /*! version: 0.28.7 */
12782
12834
 
12783
12835
  /*!
12784
12836
  * Copyright (C) 2019 salesforce.com, inc.
@@ -18170,7 +18222,7 @@
18170
18222
  // tools from mistaking the regexp or the replacement string for an
18171
18223
  // actual source mapping URL.
18172
18224
  /\/\/# sandbox(?=MappingURL=.*?\s*$)/, '//# source']);
18173
- sourceText$LWS = `\n//# LWS Version = "0.28.5"\n${sourceText$LWS}`;
18225
+ sourceText$LWS = `\n//# LWS Version = "0.28.7"\n${sourceText$LWS}`;
18174
18226
  return sourceType$LWS === 1 /* SourceType.Module */ && indexOfPragma$LWS(sourceText$LWS, 'use strict') === -1 ?
18175
18227
  // Append "'use strict'" to the extracted function body so it is
18176
18228
  // evaluated in strict mode.
@@ -18850,7 +18902,7 @@
18850
18902
  }
18851
18903
  toSafeMap$LWS$1(new MapCtor$LWS$1());
18852
18904
  toSafeSet$LWS(new SetCtor$LWS$1(['lightning/platformResourceLoader', 'lightning:platformResourceLoader', 'lightningmobileruntime/platformResourceLoader', 'lightningmobileruntime:platformResourceLoader']));
18853
- /*! version: 0.28.5 */
18905
+ /*! version: 0.28.7 */
18854
18906
 
18855
18907
  // Expose evaluateInSandbox on the window global so the browser harness page
18856
18908
  // (eval.html / component.html) can invoke it against source delivered by the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@locker/cli",
3
- "version": "0.28.5",
3
+ "version": "0.28.7",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "author": "Salesforce UI Security Team",
6
6
  "description": "Lightning Web Security CLI",
@@ -27,9 +27,9 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@babel/parser": "7.28.0",
30
- "@locker/rollup-plugin": "0.28.5",
31
- "@locker/sandbox": "0.28.5",
32
- "@locker/shared": "0.28.5",
30
+ "@locker/rollup-plugin": "0.28.7",
31
+ "@locker/sandbox": "0.28.7",
32
+ "@locker/shared": "0.28.7",
33
33
  "@lwc/engine-dom": "8.21.1",
34
34
  "@lwc/rollup-plugin": "8.21.1",
35
35
  "@rollup/plugin-commonjs": "21.1.0",
@@ -43,5 +43,5 @@
43
43
  "rollup-plugin-ts": "3.4.5",
44
44
  "yargs": "17.7.2"
45
45
  },
46
- "gitHead": "16f7eebf99a3b13eeb1831518cbb1de79a7aff15"
46
+ "gitHead": "6c7b7db5dce155e5deb1c00b83bfe2c084bbc5d2"
47
47
  }