Skip to content

Commit 511c755

Browse files
CopilotesoadamoCopilot
authored
Fix GHSA-r5fr-rjxr-66jc and high-severity code vulnerabilities; add test suite (#20)
* Add comprehensive test suite for unit and integration testing Agent-Logs-Url: https://github.com/esoadamo/cloudflare-oidc-proxy/sessions/098e5a23-1790-47f9-9c1b-7ab07d73f537 Co-authored-by: esoadamo <15877754+esoadamo@users.noreply.github.com> * Fix security vulnerabilities: lodash GHSA-r5fr-rjxr-66jc, XSS, open redirect, JWT crash Agent-Logs-Url: https://github.com/esoadamo/cloudflare-oidc-proxy/sessions/098e5a23-1790-47f9-9c1b-7ab07d73f537 Co-authored-by: esoadamo <15877754+esoadamo@users.noreply.github.com> * Update package.json Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add test job to docker publish workflow (gates push on passing tests) Agent-Logs-Url: https://github.com/esoadamo/cloudflare-oidc-proxy/sessions/e1ad75fd-7427-48d5-8174-bc84fef60870 Co-authored-by: esoadamo <15877754+esoadamo@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: esoadamo <15877754+esoadamo@users.noreply.github.com> Co-authored-by: Adam Hlaváček <git@adamhlavacek.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent cfebdb4 commit 511c755

16 files changed

Lines changed: 3682 additions & 111 deletions

.github/workflows/build-docker.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,28 @@ on:
66
- main
77

88
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Check out the repository
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '22'
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Run tests
26+
run: npm test
27+
928
build_and_push:
1029
runs-on: ubuntu-latest
30+
needs: test
1131

1232
steps:
1333
- name: Check out the repository, including submodules

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async function main() {
5959
} else if (req.method === 'GET' || req.method === 'HEAD') {
6060
res.redirect(url.format({
6161
protocol: 'https',
62-
host: req.get('host'),
62+
host: req.hostname,
6363
pathname: req.originalUrl,
6464
}));
6565
} else {

0 commit comments

Comments
 (0)