Skip to content

Commit 3c46bf3

Browse files
authored
fix: patch dependency security vulnerabilities (#115)
Resolve all 57 advisories reported by `pnpm audit` (1 critical, 29 high, 24 moderate, 3 low) down to 0. Security-relevant direct dependency bumps: - middleware: axios ^1.15.0 -> ^1.16.1 (SSRF/DoS/prototype pollution + follow-redirects) - puppeteer-renderer: qs ^6.14.1 -> ^6.15.2, lodash ^4.17.21 -> ^4.18.1, express ^4.18.1 -> ^4.22.2 (path-to-regexp ReDoS), puppeteer ^24.32.0 -> ^24.43.1 (resolves basic-ftp critical, ws, ip-address in the dependency tree) - root: turbo ^2.3.3 -> ^2.9.16 Refresh the lockfile to pull patched transitive dependencies and add a qs override (>=6.15.2) plus an explicit vite ^7.3.2 dev dependency to clear the remaining advisories. puppeteer 24.43 changed page.screenshot() to return a plain Uint8Array instead of a Buffer, breaking pngjs parsing in wait-for-animations.ts. Convert it to a Buffer before reading (matching the pattern in renderer.ts). Bump puppeteer-renderer to 4.0.3 and puppeteer-renderer-middleware to 1.0.3.
1 parent 14412eb commit 3c46bf3

6 files changed

Lines changed: 1086 additions & 1405 deletions

File tree

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,20 @@
2525
]
2626
},
2727
"devDependencies": {
28-
"eslint": "^9.17.0",
28+
"eslint": "^9.39.4",
2929
"eslint-plugin-common": "workspace:*",
3030
"husky": "^9.1.7",
31-
"lint-staged": "^15.2.11",
32-
"prettier": "^3.4.2",
33-
"turbo": "^2.3.3"
31+
"lint-staged": "^15.5.2",
32+
"prettier": "^3.8.3",
33+
"turbo": "^2.9.16"
3434
},
3535
"engines": {
3636
"node": ">=22"
3737
},
3838
"packageManager": "pnpm@10.12.1",
3939
"pnpm": {
4040
"overrides": {
41-
"qs": ">=6.14.1"
41+
"qs": ">=6.15.2"
4242
}
4343
}
4444
}
45-

packages/eslint-plugin-common/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
".": "./index.js"
1010
},
1111
"dependencies": {
12-
"@eslint/js": "^9.17.0",
13-
"typescript-eslint": "^8.18.1",
14-
"eslint-config-prettier": "^9.1.0",
15-
"globals": "^15.14.0"
12+
"@eslint/js": "^9.39.4",
13+
"eslint-config-prettier": "^9.1.2",
14+
"globals": "^15.15.0",
15+
"typescript-eslint": "^8.60.0"
1616
},
1717
"devDependencies": {
18-
"eslint": "^9.17.0",
19-
"typescript": "^5.7.2"
18+
"eslint": "^9.39.4",
19+
"typescript": "^5.9.3"
2020
},
2121
"peerDependencies": {
2222
"eslint": "^9.0.0"

packages/middleware/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"url": "https://github.com/zenato/puppeteer-renderer"
1111
},
1212
"homepage": "https://github.com/zenato/puppeteer-renderer/tree/main/packages/middleware",
13-
"version": "1.0.2",
13+
"version": "1.0.3",
1414
"description": "An Express middleware for SSR using puppeteer-renderer",
1515
"main": "./dist/index.js",
1616
"module": "./dist/index.mjs",
@@ -37,13 +37,13 @@
3737
"prepublish": "npm run build"
3838
},
3939
"dependencies": {
40-
"axios": "^1.15.0"
40+
"axios": "^1.16.1"
4141
},
4242
"devDependencies": {
43-
"@types/express": "^4.17.17",
44-
"@types/lodash": "^4.14.197",
45-
"express": "^4.18.1",
46-
"rimraf": "^5.0.1",
43+
"@types/express": "^4.17.25",
44+
"@types/lodash": "^4.17.24",
45+
"express": "^4.22.2",
46+
"rimraf": "^6.1.3",
4747
"tsup": "^8.5.1"
4848
},
4949
"peerDependencies": {

packages/puppeteer-renderer/package.json

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "puppeteer-renderer",
33
"author": "yeongjinnn@gmail.com",
44
"private": true,
5-
"version": "4.0.1",
5+
"version": "4.0.3",
66
"description": "",
77
"main": "src/index.js",
88
"scripts": {
@@ -17,28 +17,29 @@
1717
"license": "MIT",
1818
"dependencies": {
1919
"content-disposition": "^0.5.4",
20-
"express": "^4.18.1",
21-
"lodash": "^4.17.21",
20+
"express": "^4.22.2",
21+
"lodash": "^4.18.1",
2222
"pixelmatch": "^5.3.0",
2323
"pngjs": "^7.0.0",
24-
"puppeteer": "^24.32.0",
25-
"qs": "^6.14.1",
26-
"zod": "^4.1.13"
24+
"puppeteer": "^24.43.1",
25+
"qs": "^6.15.2",
26+
"zod": "^4.4.3"
2727
},
2828
"devDependencies": {
29-
"@swc/core": "^1.10.1",
30-
"@types/content-disposition": "^0.5.8",
31-
"@types/express": "^5.0.0",
32-
"@types/lodash": "^4.17.13",
33-
"@types/node": "^22.10.2",
29+
"@swc/core": "^1.15.40",
30+
"@types/content-disposition": "^0.5.9",
31+
"@types/express": "^5.0.6",
32+
"@types/lodash": "^4.17.24",
33+
"@types/node": "^22.19.19",
3434
"@types/pixelmatch": "^5.2.6",
3535
"@types/pngjs": "^6.0.5",
36-
"@types/qs": "^6.9.17",
37-
"eslint": "^9.17.0",
38-
"rimraf": "^6.0.1",
36+
"@types/qs": "^6.15.1",
37+
"eslint": "^9.39.4",
38+
"rimraf": "^6.1.3",
3939
"tsconfig": "workspace:*",
4040
"tsup": "^8.5.1",
41-
"typescript": "^5.7.2",
42-
"vitest": "^4.0.15"
41+
"typescript": "^5.9.3",
42+
"vite": "^7.3.2",
43+
"vitest": "^4.1.7"
4344
}
4445
}

packages/puppeteer-renderer/src/lib/wait-for-animations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default async function waitForAnimations(
1818

1919
while (new Date().getTime() - t0 < timeout) {
2020
const buffer = await page.screenshot({ ...options, type: 'png' })
21-
const current = PNG.sync.read(buffer as Buffer)
21+
const current = PNG.sync.read(Buffer.isBuffer(buffer) ? buffer : Buffer.from(buffer))
2222

2323
if (previous !== null && previous.data.length === current.data.length) {
2424
const diff = pixelmatch(previous.data, current.data, null, previous.width, previous.height)

0 commit comments

Comments
 (0)