{"id":48908654,"url":"https://github.com/busybee3333/cors-audit","last_synced_at":"2026-04-16T22:03:52.327Z","repository":{"id":349636518,"uuid":"1203221904","full_name":"BusyBee3333/cors-audit","owner":"BusyBee3333","description":"Scan any domain for CORS misconfigurations. Get copy-paste fix configs for 22 platforms. Zero dependencies.","archived":false,"fork":false,"pushed_at":"2026-04-06T22:01:55.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-06T23:08:30.369Z","etag":null,"topics":["cli","cors","cors-audit","devtools","nodejs","penetration-testing","security","web-security"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BusyBee3333.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-06T20:56:35.000Z","updated_at":"2026-04-06T22:01:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/BusyBee3333/cors-audit","commit_stats":null,"previous_names":["busybee3333/cors-audit"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/BusyBee3333/cors-audit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BusyBee3333%2Fcors-audit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BusyBee3333%2Fcors-audit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BusyBee3333%2Fcors-audit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BusyBee3333%2Fcors-audit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BusyBee3333","download_url":"https://codeload.github.com/BusyBee3333/cors-audit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BusyBee3333%2Fcors-audit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31905895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"ssl_error","status_checked_at":"2026-04-16T18:21:47.142Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","cors","cors-audit","devtools","nodejs","penetration-testing","security","web-security"],"created_at":"2026-04-16T22:03:31.325Z","updated_at":"2026-04-16T22:03:52.312Z","avatar_url":"https://github.com/BusyBee3333.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cors-audit\n\nScan any domain for CORS misconfigurations and get copy-paste fix configs for **22 platforms**. Zero dependencies — just Node.js.\n\n```bash\nnpx cors-audit your-site.com\n```\n\n\u003cp align=\"center\"\u003e\n\u003cstrong\u003e9 security tests\u003c/strong\u003e \u0026middot; \u003cstrong\u003e22 platform fixes\u003c/strong\u003e \u0026middot; \u003cstrong\u003eJSON output for CI/CD\u003c/strong\u003e \u0026middot; \u003cstrong\u003ezero dependencies\u003c/strong\u003e\n\u003c/p\u003e\n\n---\n\n## Why\n\n`Access-Control-Allow-Origin: *` is one of the most common security misconfigurations on the web. It ships by default in many starter templates and hosting platforms. Most teams don't realize it's a problem until a pentest catches it.\n\n**cors-audit** finds the issue in seconds and gives you the exact config to fix it for your stack.\n\n## Quick Start\n\n```bash\n# Scan a domain\nnpx cors-audit example.com\n\n# Scan + tell it which origins SHOULD be allowed\nnpx cors-audit example.com --origins example.com,app.example.com\n\n# Scan + get the fix for your platform\nnpx cors-audit example.com --origins example.com --fix vercel\n\n# Get fixes for ALL 22 platforms at once\nnpx cors-audit example.com --origins example.com --fix-all\n\n# JSON output (for CI/CD pipelines)\nnpx cors-audit example.com --json\n\n# List all supported platforms\nnpx cors-audit --platforms\n```\n\n## What It Tests\n\n| # | Test | Severity | What it means |\n|---|------|----------|---------------|\n| 1 | Wildcard `Access-Control-Allow-Origin: *` | HIGH/CRITICAL | Any website can read your responses |\n| 2 | Origin reflection (echoes any origin) | CRITICAL | Server mirrors whatever Origin is sent — full bypass |\n| 3 | `null` origin accepted | HIGH | Attackers can exploit via sandboxed iframes |\n| 4 | Subdomain/suffix bypass | HIGH | Naive string matching (e.g. `evil-example.com` passes) |\n| 5 | Credentials with wildcard | CRITICAL | Authenticated data theft possible |\n| 6 | Missing `Vary: Origin` | MEDIUM | CDN cache poisoning risk |\n| 7 | Permissive preflight (OPTIONS) | HIGH | Non-simple requests from attacker sites succeed |\n| 8 | Legitimate origin validation | INFO | Checks your own origins aren't accidentally blocked |\n| 9 | Missing security headers | MEDIUM | X-Frame-Options, CSP, etc. |\n\n## Supported Platforms (22)\n\nDon't see your stack? Use `--fix generic` for language-agnostic pseudocode + a common mistakes guide that works with any server.\n\n### Hosting \u0026 Cloud\n\n| Platform | Flag |\n|----------|------|\n| Any server (pseudocode) | `--fix generic` |\n| Vercel | `--fix vercel` |\n| Netlify | `--fix netlify` |\n| Firebase | `--fix firebase` |\n| AWS (API Gateway / Lambda / S3) | `--fix aws` |\n| Cloudflare Workers | `--fix cloudflare` |\n| Supabase | `--fix supabase` |\n| Deno Deploy | `--fix deno` |\n\n### Web Servers\n\n| Platform | Flag |\n|----------|------|\n| Nginx | `--fix nginx` |\n| Apache | `--fix apache` |\n| Caddy | `--fix caddy` |\n\n### Frameworks \u0026 Languages\n\n| Platform | Flag |\n|----------|------|\n| Express (Node.js) | `--fix express` |\n| Next.js | `--fix nextjs` |\n| Fastify | `--fix fastify` |\n| Hono | `--fix hono` |\n| Flask (Python) | `--fix flask` |\n| Django (Python) | `--fix django` |\n| Laravel (PHP) | `--fix laravel` |\n| Rails (Ruby) | `--fix rails` |\n| Spring Boot (Java/Kotlin) | `--fix spring` |\n| Go (net/http) | `--fix go` |\n| ASP.NET Core (C#) | `--fix dotnet` |\n\n## CI/CD Integration\n\n### GitHub Actions\n\n```yaml\n- name: CORS Audit\n  run: npx cors-audit ${{ vars.PROD_URL }} --json \u003e cors-report.json\n\n- name: Check CORS Score\n  run: |\n    score=$(npx cors-audit ${{ vars.PROD_URL }} --json | jq '.score')\n    if [ \"$score\" -lt 80 ]; then\n      echo \"CORS score $score/100 — failing build\"\n      exit 1\n    fi\n```\n\n### GitLab CI\n\n```yaml\ncors-audit:\n  script:\n    - npx cors-audit $PROD_URL --json \u003e cors-report.json\n    - score=$(cat cors-report.json | jq '.score')\n    - if [ \"$score\" -lt 80 ]; then exit 1; fi\n  artifacts:\n    paths:\n      - cors-report.json\n```\n\n## How It Works\n\n1. Sends targeted probes to your domain with different `Origin` headers\n2. Analyzes the `Access-Control-*` response headers for misconfigurations\n3. Scores your CORS setup 0–100\n4. Generates copy-paste fix configs for your platform\n\nNo API keys, no accounts, no dependencies. Just `node` and `fetch`.\n\n## Contributing\n\nPRs welcome — especially for new platform fix generators. Each platform is a single function in `src/fixes.js` that takes an array of allowed origins and returns a config string.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusybee3333%2Fcors-audit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbusybee3333%2Fcors-audit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusybee3333%2Fcors-audit/lists"}