@bigbinary/neeto-playwright-commons 1.26.36 → 1.27.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.
package/index.cjs.js CHANGED
@@ -29096,9 +29096,10 @@ function requireAddressparser () {
29096
29096
  * Converts tokens for a single address into an address object
29097
29097
  *
29098
29098
  * @param {Array} tokens Tokens object
29099
+ * @param {Number} depth Current recursion depth for nested group protection
29099
29100
  * @return {Object} Address object
29100
29101
  */
29101
- function _handleAddress(tokens) {
29102
+ function _handleAddress(tokens, depth) {
29102
29103
  let isGroup = false;
29103
29104
  let state = 'text';
29104
29105
  let address;
@@ -29179,7 +29180,7 @@ function requireAddressparser () {
29179
29180
  // Parse group members, but flatten any nested groups (RFC 5322 doesn't allow nesting)
29180
29181
  let groupMembers = [];
29181
29182
  if (data.group.length) {
29182
- let parsedGroup = addressparser(data.group.join(','));
29183
+ let parsedGroup = addressparser(data.group.join(','), { _depth: depth + 1 });
29183
29184
  // Flatten: if any member is itself a group, extract its members into the sequence
29184
29185
  parsedGroup.forEach(member => {
29185
29186
  if (member.group) {
@@ -29389,6 +29390,13 @@ function requireAddressparser () {
29389
29390
  }
29390
29391
  }
29391
29392
 
29393
+ /**
29394
+ * Maximum recursion depth for parsing nested groups.
29395
+ * RFC 5322 doesn't allow nested groups, so this is a safeguard against
29396
+ * malicious input that could cause stack overflow.
29397
+ */
29398
+ const MAX_NESTED_GROUP_DEPTH = 50;
29399
+
29392
29400
  /**
29393
29401
  * Parses structured e-mail addresses from an address field
29394
29402
  *
@@ -29401,10 +29409,18 @@ function requireAddressparser () {
29401
29409
  * [{name: 'Name', address: 'address@domain'}]
29402
29410
  *
29403
29411
  * @param {String} str Address field
29412
+ * @param {Object} options Optional options object
29413
+ * @param {Number} options._depth Internal recursion depth counter (do not set manually)
29404
29414
  * @return {Array} An array of address objects
29405
29415
  */
29406
29416
  function addressparser(str, options) {
29407
29417
  options = options || {};
29418
+ let depth = options._depth || 0;
29419
+
29420
+ // Prevent stack overflow from deeply nested groups (DoS protection)
29421
+ if (depth > MAX_NESTED_GROUP_DEPTH) {
29422
+ return [];
29423
+ }
29408
29424
 
29409
29425
  let tokenizer = new Tokenizer(str);
29410
29426
  let tokens = tokenizer.tokenize();
@@ -29429,7 +29445,7 @@ function requireAddressparser () {
29429
29445
  }
29430
29446
 
29431
29447
  addresses.forEach(address => {
29432
- address = _handleAddress(address);
29448
+ address = _handleAddress(address, depth);
29433
29449
  if (address.length) {
29434
29450
  parsedAddresses = parsedAddresses.concat(address);
29435
29451
  }
@@ -40941,6 +40957,8 @@ function requireStreams () {
40941
40957
  return streams;
40942
40958
  }
40943
40959
 
40960
+ lib$a.exports;
40961
+
40944
40962
  var hasRequiredLib$a;
40945
40963
 
40946
40964
  function requireLib$a () {
@@ -40952,22 +40970,21 @@ function requireLib$a () {
40952
40970
 
40953
40971
  var bomHandling = requireBomHandling();
40954
40972
  var mergeModules = requireMergeExports();
40955
- var iconv = module.exports;
40956
40973
 
40957
40974
  // All codecs and aliases are kept here, keyed by encoding name/alias.
40958
40975
  // They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.
40959
40976
  // Cannot initialize with { __proto__: null } because Boolean({ __proto__: null }) === true
40960
- iconv.encodings = null;
40977
+ module.exports.encodings = null;
40961
40978
 
40962
40979
  // Characters emitted in case of error.
40963
- iconv.defaultCharUnicode = "�";
40964
- iconv.defaultCharSingleByte = "?";
40980
+ module.exports.defaultCharUnicode = "�";
40981
+ module.exports.defaultCharSingleByte = "?";
40965
40982
 
40966
40983
  // Public API.
40967
- iconv.encode = function encode (str, encoding, options) {
40984
+ module.exports.encode = function encode (str, encoding, options) {
40968
40985
  str = "" + (str || ""); // Ensure string.
40969
40986
 
40970
- var encoder = iconv.getEncoder(encoding, options);
40987
+ var encoder = module.exports.getEncoder(encoding, options);
40971
40988
 
40972
40989
  var res = encoder.write(str);
40973
40990
  var trail = encoder.end();
@@ -40975,17 +40992,17 @@ function requireLib$a () {
40975
40992
  return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res
40976
40993
  };
40977
40994
 
40978
- iconv.decode = function decode (buf, encoding, options) {
40995
+ module.exports.decode = function decode (buf, encoding, options) {
40979
40996
  if (typeof buf === "string") {
40980
- if (!iconv.skipDecodeWarning) {
40997
+ if (!module.exports.skipDecodeWarning) {
40981
40998
  console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");
40982
- iconv.skipDecodeWarning = true;
40999
+ module.exports.skipDecodeWarning = true;
40983
41000
  }
40984
41001
 
40985
41002
  buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer.
40986
41003
  }
40987
41004
 
40988
- var decoder = iconv.getDecoder(encoding, options);
41005
+ var decoder = module.exports.getDecoder(encoding, options);
40989
41006
 
40990
41007
  var res = decoder.write(buf);
40991
41008
  var trail = decoder.end();
@@ -40993,9 +41010,9 @@ function requireLib$a () {
40993
41010
  return trail ? (res + trail) : res
40994
41011
  };
40995
41012
 
40996
- iconv.encodingExists = function encodingExists (enc) {
41013
+ module.exports.encodingExists = function encodingExists (enc) {
40997
41014
  try {
40998
- iconv.getCodec(enc);
41015
+ module.exports.getCodec(enc);
40999
41016
  return true
41000
41017
  } catch (e) {
41001
41018
  return false
@@ -41003,31 +41020,31 @@ function requireLib$a () {
41003
41020
  };
41004
41021
 
41005
41022
  // Legacy aliases to convert functions
41006
- iconv.toEncoding = iconv.encode;
41007
- iconv.fromEncoding = iconv.decode;
41023
+ module.exports.toEncoding = module.exports.encode;
41024
+ module.exports.fromEncoding = module.exports.decode;
41008
41025
 
41009
41026
  // Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.
41010
- iconv._codecDataCache = { __proto__: null };
41027
+ module.exports._codecDataCache = { __proto__: null };
41011
41028
 
41012
- iconv.getCodec = function getCodec (encoding) {
41013
- if (!iconv.encodings) {
41029
+ module.exports.getCodec = function getCodec (encoding) {
41030
+ if (!module.exports.encodings) {
41014
41031
  var raw = requireEncodings();
41015
41032
  // TODO: In future versions when old nodejs support is removed can use object.assign
41016
- iconv.encodings = { __proto__: null }; // Initialize as empty object.
41017
- mergeModules(iconv.encodings, raw);
41033
+ module.exports.encodings = { __proto__: null }; // Initialize as empty object.
41034
+ mergeModules(module.exports.encodings, raw);
41018
41035
  }
41019
41036
 
41020
41037
  // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
41021
- var enc = iconv._canonicalizeEncoding(encoding);
41038
+ var enc = module.exports._canonicalizeEncoding(encoding);
41022
41039
 
41023
41040
  // Traverse iconv.encodings to find actual codec.
41024
41041
  var codecOptions = {};
41025
41042
  while (true) {
41026
- var codec = iconv._codecDataCache[enc];
41043
+ var codec = module.exports._codecDataCache[enc];
41027
41044
 
41028
41045
  if (codec) { return codec }
41029
41046
 
41030
- var codecDef = iconv.encodings[enc];
41047
+ var codecDef = module.exports.encodings[enc];
41031
41048
 
41032
41049
  switch (typeof codecDef) {
41033
41050
  case "string": // Direct alias to other encoding.
@@ -41048,9 +41065,9 @@ function requireLib$a () {
41048
41065
  // The codec function must load all tables and return object with .encoder and .decoder methods.
41049
41066
  // It'll be called only once (for each different options object).
41050
41067
  //
41051
- codec = new codecDef(codecOptions, iconv);
41068
+ codec = new codecDef(codecOptions, module.exports);
41052
41069
 
41053
- iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later.
41070
+ module.exports._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later.
41054
41071
  return codec
41055
41072
 
41056
41073
  default:
@@ -41059,13 +41076,13 @@ function requireLib$a () {
41059
41076
  }
41060
41077
  };
41061
41078
 
41062
- iconv._canonicalizeEncoding = function (encoding) {
41079
+ module.exports._canonicalizeEncoding = function (encoding) {
41063
41080
  // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
41064
41081
  return ("" + encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "")
41065
41082
  };
41066
41083
 
41067
- iconv.getEncoder = function getEncoder (encoding, options) {
41068
- var codec = iconv.getCodec(encoding);
41084
+ module.exports.getEncoder = function getEncoder (encoding, options) {
41085
+ var codec = module.exports.getCodec(encoding);
41069
41086
  var encoder = new codec.encoder(options, codec);
41070
41087
 
41071
41088
  if (codec.bomAware && options && options.addBOM) { encoder = new bomHandling.PrependBOM(encoder, options); }
@@ -41073,8 +41090,8 @@ function requireLib$a () {
41073
41090
  return encoder
41074
41091
  };
41075
41092
 
41076
- iconv.getDecoder = function getDecoder (encoding, options) {
41077
- var codec = iconv.getCodec(encoding);
41093
+ module.exports.getDecoder = function getDecoder (encoding, options) {
41094
+ var codec = module.exports.getCodec(encoding);
41078
41095
  var decoder = new codec.decoder(options, codec);
41079
41096
 
41080
41097
  if (codec.bomAware && !(options && options.stripBOM === false)) { decoder = new bomHandling.StripBOM(decoder, options); }
@@ -41087,26 +41104,26 @@ function requireLib$a () {
41087
41104
  // up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default.
41088
41105
  // If you would like to enable it explicitly, please add the following code to your app:
41089
41106
  // > iconv.enableStreamingAPI(require('stream'));
41090
- iconv.enableStreamingAPI = function enableStreamingAPI (streamModule) {
41091
- if (iconv.supportsStreams) { return }
41107
+ module.exports.enableStreamingAPI = function enableStreamingAPI (streamModule) {
41108
+ if (module.exports.supportsStreams) { return }
41092
41109
 
41093
41110
  // Dependency-inject stream module to create IconvLite stream classes.
41094
41111
  var streams = requireStreams()(streamModule);
41095
41112
 
41096
41113
  // Not public API yet, but expose the stream classes.
41097
- iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream;
41098
- iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream;
41114
+ module.exports.IconvLiteEncoderStream = streams.IconvLiteEncoderStream;
41115
+ module.exports.IconvLiteDecoderStream = streams.IconvLiteDecoderStream;
41099
41116
 
41100
41117
  // Streaming API.
41101
- iconv.encodeStream = function encodeStream (encoding, options) {
41102
- return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options)
41118
+ module.exports.encodeStream = function encodeStream (encoding, options) {
41119
+ return new module.exports.IconvLiteEncoderStream(module.exports.getEncoder(encoding, options), options)
41103
41120
  };
41104
41121
 
41105
- iconv.decodeStream = function decodeStream (encoding, options) {
41106
- return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options)
41122
+ module.exports.decodeStream = function decodeStream (encoding, options) {
41123
+ return new module.exports.IconvLiteDecoderStream(module.exports.getDecoder(encoding, options), options)
41107
41124
  };
41108
41125
 
41109
- iconv.supportsStreams = true;
41126
+ module.exports.supportsStreams = true;
41110
41127
  };
41111
41128
 
41112
41129
  // Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments).
@@ -41116,10 +41133,10 @@ function requireLib$a () {
41116
41133
  } catch (e) {}
41117
41134
 
41118
41135
  if (streamModule && streamModule.Transform) {
41119
- iconv.enableStreamingAPI(streamModule);
41136
+ module.exports.enableStreamingAPI(streamModule);
41120
41137
  } else {
41121
41138
  // In rare cases where 'stream' module is not available by default, throw a helpful exception.
41122
- iconv.encodeStream = iconv.decodeStream = function () {
41139
+ module.exports.encodeStream = module.exports.decodeStream = function () {
41123
41140
  throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.")
41124
41141
  };
41125
41142
  }
@@ -51196,7 +51213,6 @@ var require$$11 = [
51196
51213
  "drive",
51197
51214
  "dtv",
51198
51215
  "dubai",
51199
- "dunlop",
51200
51216
  "dupont",
51201
51217
  "durban",
51202
51218
  "dvag",
@@ -53428,7 +53444,11 @@ function requireMailParser () {
53428
53444
  result.push(textPart);
53429
53445
  }
53430
53446
 
53431
- result.push(`<a href="${link.url}">${link.text}</a>`);
53447
+ // Escape quotes in URL to prevent XSS
53448
+ let safeUrl = link.url.replace(/"/g, '&quot;');
53449
+ // Escape HTML entities in link text
53450
+ let safeText = he.encode(link.text, { useNamedReferences: true });
53451
+ result.push(`<a href="${safeUrl}">${safeText}</a>`);
53432
53452
 
53433
53453
  last = link.lastIndex;
53434
53454
  });