{"id":51587703,"url":"https://github.com/bymehul/nullspace","last_synced_at":"2026-07-11T12:02:02.634Z","repository":{"id":369074435,"uuid":"1125940106","full_name":"bymehul/nullspace","owner":"bymehul","description":"SSRF prevention library","archived":false,"fork":false,"pushed_at":"2026-07-03T12:21:08.000Z","size":88,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-03T14:20:38.255Z","etag":null,"topics":["nodejs","security","ssrf","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/nullspace","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bymehul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2025-12-31T17:29:47.000Z","updated_at":"2026-07-03T12:21:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bymehul/nullspace","commit_stats":null,"previous_names":["bymehul/nullspace"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/bymehul/nullspace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bymehul%2Fnullspace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bymehul%2Fnullspace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bymehul%2Fnullspace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bymehul%2Fnullspace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bymehul","download_url":"https://codeload.github.com/bymehul/nullspace/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bymehul%2Fnullspace/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35361644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["nodejs","security","ssrf","typescript"],"created_at":"2026-07-11T12:02:00.946Z","updated_at":"2026-07-11T12:02:02.629Z","avatar_url":"https://github.com/bymehul.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nullspace\n\nSecurity-first SSRF protection for Node.js outbound HTTP requests.\n\n`nullspace` validates URLs, blocks private/internal ranges, defends against DNS rebinding, and pins connections to validated IPs.\n\n## Installation\n\n```bash\nnpm install nullspace\n```\n\n## Quick Start\n\n```typescript\nimport { safeFetch, validateURL, isIPAllowed } from 'nullspace';\n\nconst response = await safeFetch('https://api.example.com/data');\n\nconst check = await validateURL('https://api.example.com/data');\nif (!check.valid) {\n  console.error(check.errorCode, check.error);\n}\n\nisIPAllowed('8.8.8.8');         // true\nisIPAllowed('127.0.0.1');       // false\nisIPAllowed('169.254.169.254'); // false\n```\n\n## Key Protections\n\n- Restricts protocols to `http` and `https`.\n- Blocks loopback, private, link-local, metadata, multicast, and reserved ranges.\n- Handles IPv4 encoding tricks (decimal, octal, hex, short forms).\n- Handles IPv6 edge cases (`::1`, mapped IPv4, NAT64 embeddings).\n- Rejects hostnames when any resolved record is internal.\n- Resolves CNAME chains with loop and recursion-depth protection.\n- Uses DNS cache floor plus socket pinning for rebinding resistance.\n- Enforces response size, response header size, redirect count, and total timeout limits.\n\n## Example Options\n\n```typescript\nawait safeFetch('https://api.example.com', {\n  method: 'POST',\n  headers: { 'Content-Type': 'application/json' },\n  body: JSON.stringify({ ok: true }),\n  followRedirects: true,\n  maxRedirects: 5,\n  connectTimeout: 5000,\n  responseTimeout: 30000,\n  totalTimeout: 60000,\n  maxResponseSize: 10 * 1024 * 1024,\n  maxResponseHeadersSize: 32 * 1024,\n  allowedHostnames: ['api.example.com'],\n});\n```\n\n## Documentation\n\n- Usage examples: [how-to-use.md](./how-to-use.md)\n- Technical reference: [docs.md](./docs.md)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbymehul%2Fnullspace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbymehul%2Fnullspace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbymehul%2Fnullspace/lists"}