Gathering detailed insights and metrics for @isomorphic-git/cors-proxy
Gathering detailed insights and metrics for @isomorphic-git/cors-proxy
Gathering detailed insights and metrics for @isomorphic-git/cors-proxy
Gathering detailed insights and metrics for @isomorphic-git/cors-proxy
Proxy clone and push requests for the browser
npm install @isomorphic-git/cors-proxy
Typescript
Module System
Node Version
NPM Version
JavaScript (98.45%)
Dockerfile (1.55%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
97 Stars
55 Commits
40 Forks
3 Watchers
2 Branches
7 Contributors
Updated on May 25, 2025
Latest Version
2.7.1
Package Id
@isomorphic-git/cors-proxy@2.7.1
Unpacked Size
15.20 kB
Size
6.06 kB
File Count
11
NPM Version
6.14.5
Node Version
10.24.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
This is the software running on https://cors.isomorphic-git.org/ - a free service (generously sponsored by Clever Cloud) for users of isomorphic-git that enables cloning and pushing repos in the browser.
It is derived from https://github.com/wmhilton/cors-buster with added restrictions to reduce the opportunity to abuse the proxy. Namely, it blocks requests that don't look like valid git requests.
1npm install @isomorphic-git/cors-proxy
Start proxy on default port 9999:
1cors-proxy start
Start proxy on a custom port:
1cors-proxy start -p 9889
Start proxy in daemon mode. It will write the PID of the daemon process to $PWD/cors-proxy.pid
:
1cors-proxy start -d
Kill the process with the PID specified in $PWD/cors-proxy.pid
:
1cors-proxy stop
Environment variables:
PORT
the port to listen to (if run with npm start
)ALLOW_ORIGIN
the value for the 'Access-Control-Allow-Origin' CORS headerINSECURE_HTTP_ORIGINS
comma separated list of origins for which HTTP should be used instead of HTTPS (added to make developing against locally running git servers easier)You can also use the cors-proxy
as a middleware in your own server.
1const express = require('express') 2const corsProxy = require('@isomorphic-git/cors-proxy/middleware.js') 3 4const app = express() 5const options = {} 6 7app.use(corsProxy(options)) 8
The middleware doesn't use the environment variables. The options object supports the following properties:
origin
: string. The value for the 'Access-Control-Allow-Origin' CORS headerinsecure_origins
: string[]. Array of origins for which HTTP should be used instead of HTTPS (added to make developing against locally running git servers easier)authorization
: (req, res, next) => void. A middleware function you can use to handle custom authorization. Is run after filtering for git-like requests and handling CORS but before the request is proxied.Example:
1app.use( 2 corsProxy({ 3 authorization: (req: Request, res: Response, next: NextFunction) => { 4 // proxied git HTTP requests already use the Authorization header for git credentials, 5 // so their [Company] credentials are inserted in the X-Authorization header instead. 6 if (getAuthorizedUser(req, 'X-Authorization')) { 7 return next(); 8 } else { 9 return res.status(401).send("Unable to authenticate you with [Company]'s git proxy"); 10 } 11 }, 12 }) 13); 14 15// Only requests with a valid JSON Web Token will be proxied 16function getAuthorizedUser(req: Request, header: string = 'Authorization') { 17 const Authorization = req.get(header); 18 19 if (Authorization) { 20 const token = Authorization.replace('Bearer ', ''); 21 try { 22 const verifiedToken = verify(token, env.APP_SECRET) as IToken; 23 if (verifiedToken) { 24 return { 25 id: verifiedToken.userId, 26 }; 27 } 28 } catch (e) { 29 // noop 30 } 31 } 32}
This work is released under The MIT License
8.6/10
Summary
Server side request forgery in @isomorphic-git/cors-proxy
Affected Versions
< 2.7.1
Patched Versions
2.7.1
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 4/23 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
70 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More