From 79f15cac120a9b0c408c0763dc8216b4c791ad32 Mon Sep 17 00:00:00 2001 From: Rodrigo Argumedo <7613139+rodrigoargumedo@users.noreply.github.com> Date: Thu, 9 Apr 2026 14:11:59 +0000 Subject: [PATCH 1/2] Remove Google Analytics scripts and validate URL fields in test.js for security Co-Authored-By: Claude Opus 4.6 --- 404.html | 10 ---------- index.html | 12 +----------- test.js | 10 +++++++++- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/404.html b/404.html index 41b779d9..86cc6d3c 100644 --- a/404.html +++ b/404.html @@ -7,16 +7,6 @@ - - diff --git a/index.html b/index.html index 421445ff..fbff5f9c 100644 --- a/index.html +++ b/index.html @@ -7,16 +7,6 @@ - - @@ -217,6 +207,6 @@

{{hackathon.title}}

- + diff --git a/test.js b/test.js index 4e440f9b..0f780a83 100644 --- a/test.js +++ b/test.js @@ -44,8 +44,16 @@ for (const year of years) { let lastHackathon; for (const hackathon of obj[monthName]) { + // Validate URL fields don't use dangerous schemes (e.g. javascript:) + for (const field of ['url', 'facebookURL', 'twitterURL']) { + const val = (hackathon[field] || '').trim(); + if (val && /^[a-z][a-z0-9+.-]*:/i.test(val) && !/^https?:/i.test(val)) { + bail(`${hackathon.title} has unsafe ${field}: ${val}`); + } + } + let startDate = Date.parse(hackathon.startDate); - if (startDate !== undefined) { + if (!isNaN(startDate)) { if (lastStartDate > startDate) { bail(`${hackathon.title} should be before ${lastHackathon.title}`); } From d5e7c42b3b3a6a06b6dfec9728b3423a80828999 Mon Sep 17 00:00:00 2001 From: Rodrigo Argumedo <7613139+rodrigoargumedo@users.noreply.github.com> Date: Thu, 9 Apr 2026 14:24:17 +0000 Subject: [PATCH 2/2] Update Node.js CI workflow to use newer Node.js versions and action versions Co-Authored-By: Claude Opus 4.6 --- .github/workflows/node.js.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 88cdbf32..db86c07d 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -16,12 +16,12 @@ jobs: strategy: matrix: - node-version: [10.x, 12.x, 14.x] + node-version: [18.x, 20.x, 22.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: node test.js