@locker/cli 0.28.5 → 0.28.6
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 +1 -1
- package/dist/index.mjs.js +1 -1
- package/dist/lws-sandbox.js +58 -22
- package/package.json +5 -5
package/dist/index.cjs.js
CHANGED
package/dist/index.mjs.js
CHANGED
package/dist/lws-sandbox.js
CHANGED
|
@@ -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.
|
|
1542
|
+
/*! version: 0.28.6 */
|
|
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
|
-
//
|
|
2002
|
-
//
|
|
2003
|
-
//
|
|
2004
|
-
//
|
|
2005
|
-
|
|
2006
|
-
//
|
|
2007
|
-
//
|
|
2008
|
-
//
|
|
2009
|
-
|
|
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,
|
|
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
|
|
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.
|
|
2658
|
+
/*! version: 0.28.6 */
|
|
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.
|
|
2826
|
+
/*! version: 0.28.6 */
|
|
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.
|
|
2902
|
+
/*! version: 0.28.6 */
|
|
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.
|
|
3211
|
+
/*! version: 0.28.6 */
|
|
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.
|
|
3420
|
+
/*! version: 0.28.6 */
|
|
3385
3421
|
|
|
3386
3422
|
/*!
|
|
3387
3423
|
* Copyright (C) 2019 salesforce.com, inc.
|
|
@@ -12769,7 +12805,7 @@
|
|
|
12769
12805
|
const UIEventProtoBlockedProperties$LWS = ['rangeParent'];
|
|
12770
12806
|
const WindowBlockedProperties$LWS = ['find', 'requestFileSystem', 'webkitRequestFileSystem'];
|
|
12771
12807
|
const XSLTProcessorProtoBlockedProperties$LWS = ['transformToDocument', 'transformToFragment'];
|
|
12772
|
-
/*! version: 0.28.
|
|
12808
|
+
/*! version: 0.28.6 */
|
|
12773
12809
|
|
|
12774
12810
|
/*!
|
|
12775
12811
|
* Copyright (C) 2021 salesforce.com, inc.
|
|
@@ -12778,7 +12814,7 @@
|
|
|
12778
12814
|
function getPdpSchema$LWS() {
|
|
12779
12815
|
return pdpSchema$LWS;
|
|
12780
12816
|
}
|
|
12781
|
-
/*! version: 0.28.
|
|
12817
|
+
/*! version: 0.28.6 */
|
|
12782
12818
|
|
|
12783
12819
|
/*!
|
|
12784
12820
|
* Copyright (C) 2019 salesforce.com, inc.
|
|
@@ -18170,7 +18206,7 @@
|
|
|
18170
18206
|
// tools from mistaking the regexp or the replacement string for an
|
|
18171
18207
|
// actual source mapping URL.
|
|
18172
18208
|
/\/\/# sandbox(?=MappingURL=.*?\s*$)/, '//# source']);
|
|
18173
|
-
sourceText$LWS = `\n//# LWS Version = "0.28.
|
|
18209
|
+
sourceText$LWS = `\n//# LWS Version = "0.28.6"\n${sourceText$LWS}`;
|
|
18174
18210
|
return sourceType$LWS === 1 /* SourceType.Module */ && indexOfPragma$LWS(sourceText$LWS, 'use strict') === -1 ?
|
|
18175
18211
|
// Append "'use strict'" to the extracted function body so it is
|
|
18176
18212
|
// evaluated in strict mode.
|
|
@@ -18850,7 +18886,7 @@
|
|
|
18850
18886
|
}
|
|
18851
18887
|
toSafeMap$LWS$1(new MapCtor$LWS$1());
|
|
18852
18888
|
toSafeSet$LWS(new SetCtor$LWS$1(['lightning/platformResourceLoader', 'lightning:platformResourceLoader', 'lightningmobileruntime/platformResourceLoader', 'lightningmobileruntime:platformResourceLoader']));
|
|
18853
|
-
/*! version: 0.28.
|
|
18889
|
+
/*! version: 0.28.6 */
|
|
18854
18890
|
|
|
18855
18891
|
// Expose evaluateInSandbox on the window global so the browser harness page
|
|
18856
18892
|
// (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.
|
|
3
|
+
"version": "0.28.6",
|
|
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.
|
|
31
|
-
"@locker/sandbox": "0.28.
|
|
32
|
-
"@locker/shared": "0.28.
|
|
30
|
+
"@locker/rollup-plugin": "0.28.6",
|
|
31
|
+
"@locker/sandbox": "0.28.6",
|
|
32
|
+
"@locker/shared": "0.28.6",
|
|
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": "
|
|
46
|
+
"gitHead": "d55906f587fffdeffb3b57e011de6248a0f623b5"
|
|
47
47
|
}
|