From fca65dcba56ce9a342bce7ddd3607a19e5036fae Mon Sep 17 00:00:00 2001 From: Nishant Srivastava Date: Wed, 21 Aug 2024 00:05:26 +0200 Subject: [PATCH] get rid of html minifier - REDoS vulnerability - https://github.com/advisories/GHSA-pfq8-rq6v-vf5m --- .github/workflows/firebase-hosting-merge.yml | 4 ++-- .github/workflows/firebase-hosting-pull-request.yml | 4 ++-- render.sh | 6 ------ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml index b216996..502b32f 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/firebase-hosting-merge.yml @@ -18,10 +18,10 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 # has to be - cache: 'npm' + cache: 'npx' - name: Install all CLI tools - run: npm install -g @tokilabs/pug3-cli sass js-yaml firebase-tools svgo png-minify uglifycss uglify-js html-minifier purgecss + run: npx install -g @tokilabs/pug3-cli sass js-yaml firebase-tools svgo png-minify uglifycss uglify-js purgecss - name: Render the website from templates run: | diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml index 564959d..fb77632 100644 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -16,10 +16,10 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 # has to be LTS - cache: 'npm' + cache: 'npx' - name: Install all CLI tools - run: npm install -g @tokilabs/pug3-cli sass js-yaml firebase-tools svgo png-minify uglifycss uglify-js html-minifier purgecss + run: npx install -g @tokilabs/pug3-cli sass js-yaml firebase-tools svgo png-minify uglifycss uglify-js purgecss - name: Render the website from templates run: | diff --git a/render.sh b/render.sh index 097c9e9..476ed98 100755 --- a/render.sh +++ b/render.sh @@ -84,9 +84,3 @@ uglifyjs src/js/main.js --output public/js/main.min.js uglifyjs src/js/utils.js --output public/js/utils.min.js uglifyjs src/js/flycricket.js --output public/js/flycricket.min.js echo " ✅ STEP 6: Minify JS" - -echo "" -html-minifier public/index.html \ ---collapse-whitespace --keep-closing-slash --remove-comments \ ---output public/index.html -echo " ✅ STEP 7: Minify HTML" \ No newline at end of file