Skip to content

Commit 2bc89e2

Browse files
authored
Fix security vulnerabilities 2(#2105)
1 parent 583c3a7 commit 2bc89e2

7 files changed

Lines changed: 86 additions & 41 deletions

File tree

test/smoke/automation/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"mkdirp": "^1.0.4",
2727
"ncp": "^2.0.0",
2828
"npm-run-all": "^4.1.5",
29+
"playwright": "^1.41.2",
2930
"tmp": "0.1.0",
3031
"tree-kill": "1.2.2",
3132
"typescript": "^4.3.2",

test/smoke/automation/src/code.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export function setPollRetryParameters(retryCount: number = 2000, retryInterval:
222222

223223
async function poll<T>(
224224
fn: () => Thenable<T>,
225-
acceptFn: (result: T) => boolean,
225+
acceptFn: (result: any) => boolean,
226226
timeoutMessage: string,
227227
retryCount: number = pollRetryCount,
228228
retryInterval: number = pollRetryInterval // millis
@@ -324,7 +324,7 @@ export class Code {
324324
accept = accept || (result => textContent !== undefined ? textContent === result : !!result);
325325

326326
return await poll(
327-
() => this.driver.getElements(windowId, selector).then(els => els.length > 0 ? Promise.resolve(els[0].textContent) : Promise.reject(new Error("Element not found for textContent"))),
327+
() => this.driver.getElements(windowId, selector).then((els: string | any[]) => els.length > 0 ? Promise.resolve(els[0].textContent) : Promise.reject(new Error("Element not found for textContent"))),
328328
s => accept!(typeof s === "string" ? s : ""),
329329
`get text content '${selector}'`,
330330
retryCount
@@ -353,7 +353,7 @@ export class Code {
353353

354354
async waitForElement(selector: string, accept: (result: IElement | undefined) => boolean = result => !!result, retryCount?: number): Promise<IElement> {
355355
const windowId = await this.getActiveWindowId();
356-
return await poll<IElement>(() => this.driver.getElements(windowId, selector).then(els => els[0]), accept, `get element '${selector}'`, retryCount);
356+
return await poll<IElement>(() => this.driver.getElements(windowId, selector).then((els: any[]) => els[0]), accept, `get element '${selector}'`, retryCount);
357357
}
358358

359359
async waitForActiveElement(selector: string, retryCount?: number): Promise<void> {
@@ -395,7 +395,7 @@ export class Code {
395395
this.client.dispose();
396396
}
397397

398-
private async getActiveWindowId(): Promise<number> {
398+
private async getActiveWindowId(): Promise<number | undefined> {
399399
if (typeof this._activeWindowId !== "number") {
400400
const windows = await this.driver.getWindowIds();
401401
this._activeWindowId = windows[0];

test/smoke/automation/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"outDir": "out",
99
"sourceMap": true,
1010
"declaration": true,
11+
"skipLibCheck": true,
1112
"lib": [
1213
"es2016",
1314
"dom"

test/smoke/automation/yarn.lock

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ fs.realpath@^1.0.0:
219219
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
220220
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
221221

222+
fsevents@2.3.2:
223+
version "2.3.2"
224+
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
225+
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
226+
222227
function-bind@^1.1.1:
223228
version "1.1.1"
224229
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
@@ -513,6 +518,20 @@ pify@^3.0.0:
513518
resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
514519
integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=
515520

521+
playwright-core@1.41.2:
522+
version "1.41.2"
523+
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.41.2.tgz#db22372c708926c697acc261f0ef8406606802d9"
524+
integrity sha512-VaTvwCA4Y8kxEe+kfm2+uUUw5Lubf38RxF7FpBxLPmGe5sdNkSg5e3ChEigaGrX7qdqT3pt2m/98LiyvU2x6CA==
525+
526+
playwright@^1.41.2:
527+
version "1.41.2"
528+
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.41.2.tgz#4e760b1c79f33d9129a8c65cc27953be6dd35042"
529+
integrity sha512-v0bOa6H2GJChDL8pAeLa/LZC4feoAMbSQm1/jF/ySsWWoaNItvrMP7GEkvEEFyCTUYKMxjQKaTSg5up7nR6/8A==
530+
dependencies:
531+
playwright-core "1.41.2"
532+
optionalDependencies:
533+
fsevents "2.3.2"
534+
516535
read-pkg@^3.0.0:
517536
version "3.0.0"
518537
resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389"
@@ -567,7 +586,7 @@ shebang-regex@^1.0.0:
567586
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
568587
integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=
569588

570-
shell-quote@^1.7.3:
589+
shell-quote@^1.6.1, shell-quote@^1.7.1:
571590
version "1.8.1"
572591
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.1.tgz#6dbf4db75515ad5bac63b4f1894c3a154c766680"
573592
integrity sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==

test/smoke/package/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"node-fetch": "2.6.7",
3737
"portastic": "^1.0.1",
3838
"rimraf": "^2.6.1",
39+
"tar": "4.4.18",
3940
"tree-kill": "^1.2.2",
4041
"ts-node": "10.9.1",
4142
"typescript": "4.5.5",

test/smoke/package/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"noUnusedLocals": true,
1111
"outDir": "out",
1212
"sourceMap": true,
13+
"skipLibCheck": true,
1314
"lib": [
1415
"es2017",
1516
"dom"

test/smoke/package/yarn.lock

Lines changed: 58 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,13 +1638,6 @@ bl@^4.0.3:
16381638
inherits "^2.0.4"
16391639
readable-stream "^3.4.0"
16401640

1641-
block-stream@*:
1642-
version "0.0.9"
1643-
resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a"
1644-
integrity sha512-OorbnJVPII4DuUKbjARAe8u8EfqOmkEEaSFIyoQ7OjTHn6kafxWl0wLgoZ2rXaYd7MyLcDaU4TmhfxtwgcccMQ==
1645-
dependencies:
1646-
inherits "~2.0.0"
1647-
16481641
bluebird@^2.9.34:
16491642
version "2.11.0"
16501643
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1"
@@ -1940,7 +1933,7 @@ chokidar@3.5.3, chokidar@^3.5.3:
19401933
optionalDependencies:
19411934
fsevents "~2.3.2"
19421935

1943-
chownr@^1.1.1:
1936+
chownr@^1.1.1, chownr@^1.1.4:
19441937
version "1.1.4"
19451938
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b"
19461939
integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==
@@ -3332,6 +3325,13 @@ fs-extra@^10.0.0:
33323325
jsonfile "^6.0.1"
33333326
universalify "^2.0.0"
33343327

3328+
fs-minipass@^1.2.7:
3329+
version "1.2.7"
3330+
resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7"
3331+
integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==
3332+
dependencies:
3333+
minipass "^2.6.0"
3334+
33353335
fs-minipass@^2.0.0:
33363336
version "2.1.0"
33373337
resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb"
@@ -3362,16 +3362,6 @@ fsevents@~2.3.2:
33623362
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
33633363
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
33643364

3365-
fstream@^1.0.12:
3366-
version "1.0.12"
3367-
resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.12.tgz#4e8ba8ee2d48be4f7d0de505455548eae5932045"
3368-
integrity sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==
3369-
dependencies:
3370-
graceful-fs "^4.1.2"
3371-
inherits "~2.0.0"
3372-
mkdirp ">=0.5 0"
3373-
rimraf "2"
3374-
33753365
fsu@^1.1.1:
33763366
version "1.1.1"
33773367
resolved "https://registry.yarnpkg.com/fsu/-/fsu-1.1.1.tgz#bd36d3579907c59d85b257a75b836aa9e0c31834"
@@ -4821,6 +4811,14 @@ minimist@^1.2.0, minimist@^1.2.6:
48214811
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
48224812
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
48234813

4814+
minipass@^2.6.0, minipass@^2.9.0:
4815+
version "2.9.0"
4816+
resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6"
4817+
integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==
4818+
dependencies:
4819+
safe-buffer "^5.1.2"
4820+
yallist "^3.0.0"
4821+
48244822
minipass@^3.0.0:
48254823
version "3.3.6"
48264824
resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a"
@@ -4838,6 +4836,13 @@ minipass@^5.0.0:
48384836
resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.0.4.tgz#dbce03740f50a4786ba994c1fb908844d27b038c"
48394837
integrity sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==
48404838

4839+
minizlib@^1.3.3:
4840+
version "1.3.3"
4841+
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d"
4842+
integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==
4843+
dependencies:
4844+
minipass "^2.9.0"
4845+
48414846
minizlib@^2.1.1:
48424847
version "2.1.2"
48434848
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931"
@@ -4851,7 +4856,7 @@ mkdirp-classic@^0.5.2:
48514856
resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113"
48524857
integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==
48534858

4854-
"mkdirp@>=0.5 0", mkdirp@^0.5.1, mkdirp@~0.5.1:
4859+
mkdirp@^0.5.1, mkdirp@^0.5.5, mkdirp@~0.5.1:
48554860
version "0.5.6"
48564861
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6"
48574862
integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==
@@ -6337,20 +6342,20 @@ rgb2hex@0.2.5:
63376342
resolved "https://registry.yarnpkg.com/rgb2hex/-/rgb2hex-0.2.5.tgz#f82230cd3ab1364fa73c99be3a691ed688f8dbdc"
63386343
integrity sha512-22MOP1Rh7sAo1BZpDG6R5RFYzR2lYEgwq7HEmyW2qcsOqR2lQKmn+O//xV3YG/0rrhMC6KVX2hU+ZXuaw9a5bw==
63396344

6340-
rimraf@2, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3:
6341-
version "2.7.1"
6342-
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
6343-
integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==
6344-
dependencies:
6345-
glob "^7.1.3"
6346-
63476345
rimraf@3.0.2, rimraf@^3.0.2:
63486346
version "3.0.2"
63496347
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
63506348
integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==
63516349
dependencies:
63526350
glob "^7.1.3"
63536351

6352+
rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3:
6353+
version "2.7.1"
6354+
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
6355+
integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==
6356+
dependencies:
6357+
glob "^7.1.3"
6358+
63546359
rimraf@~2.4.0:
63556360
version "2.4.5"
63566361
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.4.5.tgz#ee710ce5d93a8fdb856fb5ea8ff0e2d75934b2da"
@@ -6375,7 +6380,7 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
63756380
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
63766381
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
63776382

6378-
safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@~5.2.0:
6383+
safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@^5.2.1, safe-buffer@~5.2.0:
63796384
version "5.2.1"
63806385
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
63816386
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
@@ -7016,14 +7021,31 @@ tar-stream@^2.1.4, tar-stream@^2.2.0:
70167021
inherits "^2.0.3"
70177022
readable-stream "^3.1.1"
70187023

7019-
tar@^2.2.1:
7020-
version "2.2.2"
7021-
resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.2.tgz#0ca8848562c7299b8b446ff6a4d60cdbb23edc40"
7022-
integrity sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==
7023-
dependencies:
7024-
block-stream "*"
7025-
fstream "^1.0.12"
7026-
inherits "2"
7024+
tar@4.4.18:
7025+
version "4.4.18"
7026+
resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.18.tgz#a565090fdcf786ee08ed14b1739179451b3cc476"
7027+
integrity sha512-ZuOtqqmkV9RE1+4odd+MhBpibmCxNP6PJhH/h2OqNuotTX7/XHPZQJv2pKvWMplFH9SIZZhitehh6vBH6LO8Pg==
7028+
dependencies:
7029+
chownr "^1.1.4"
7030+
fs-minipass "^1.2.7"
7031+
minipass "^2.9.0"
7032+
minizlib "^1.3.3"
7033+
mkdirp "^0.5.5"
7034+
safe-buffer "^5.2.1"
7035+
yallist "^3.1.1"
7036+
7037+
tar@^4.4.18:
7038+
version "4.4.19"
7039+
resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3"
7040+
integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==
7041+
dependencies:
7042+
chownr "^1.1.4"
7043+
fs-minipass "^1.2.7"
7044+
minipass "^2.9.0"
7045+
minizlib "^1.3.3"
7046+
mkdirp "^0.5.5"
7047+
safe-buffer "^5.2.1"
7048+
yallist "^3.1.1"
70277049

70287050
tar@^6.0.5:
70297051
version "6.2.0"
@@ -7922,7 +7944,7 @@ y18n@^5.0.5:
79227944
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
79237945
integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==
79247946

7925-
yallist@^3.0.2:
7947+
yallist@^3.0.0, yallist@^3.0.2, yallist@^3.1.1:
79267948
version "3.1.1"
79277949
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
79287950
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==

0 commit comments

Comments
 (0)