{"id":"CVE-2023-49799","aliases":["CVE-2023-49799","GHSA-3wfp-253j-5jxv"],"related":[],"kind":"vulnerability","state":"published","title":"Server-Side Request Forgery in nuxt-api-party","summary":"`nuxt-api-party` is an open source module to proxy API requests. nuxt-api-party attempts to check if the user has passed an absolute URL to prevent the aforementioned attack. This has been recently changed to use the regular expression `^https?://`, however this regular expression can be bypassed by an absolute URL with leading whitespace. For example `\\nhttps://whatever.com` which has a leading newline. According to the fetch specification, before a fetch is made the URL is normalized. \"To normalize a byte sequence potentialValue, remove any leading and trailing HTTP whitespace bytes from potentialValue.\". This means the final request will be normalized to `https://whatever.com` bypassing the check and nuxt-api-party will send a request outside of the whitelist. This could allow us to leak credentials or perform Server-Side Request Forgery (SSRF). This vulnerability has been addressed in version 0.22.1. Users are advised to upgrade. Users unable to upgrade should revert to the previous method of detecting absolute URLs.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"`nuxt-api-party` is an open source module to proxy API requests. nuxt-api-party attempts to check if the user has passed an absolute URL to prevent the aforementioned attack. This has been recently changed to use the regular expression `^https?://`, however this regular expression can be bypassed by an absolute URL with leading whitespace. For example `\\nhttps://whatever.com` which has a leading newline. According to the fetch specification, before a fetch is made the URL is normalized. \"To normalize a byte sequence potentialValue, remove any leading and trailing HTTP whitespace bytes from potentialValue.\". This means the final request will be normalized to `https://whatever.com` bypassing the check and nuxt-api-party will send a request outside of the whitelist. This could allow us to leak credentials or perform Server-Side Request Forgery (SSRF). This vulnerability has been addressed in version 0.22.1. Users are advised to upgrade. Users unable to upgrade should revert to the previous method of detecting absolute URLs.","source":"cvelist"},{"lang":"en","text":"### Summary\n`nuxt-api-party` allows developers to proxy requests to an API without exposing credentials to the client. [A previous vulnerability](https://huntr.dev/bounties/4c57a3f6-0d0e-4431-9494-4a1e7b062fbf/) allowed an attacker to change the baseURL of the request, potentially leading to credentials being leaked or SSRF. \n\nThis vulnerability is similar, and was caused by a recent change to the detection of absolute URLs, which is no longer sufficient to prevent SSRF. \n\n### Details\n`nuxt-api-party` attempts to check if the user has passed an absolute URL to prevent the aforementioned attack. This has been recently changed to [use a regular expression](https://github.com/johannschopplich/nuxt-api-party/blob/777462e1e3af1d9f8938aa33f230cd8cb6e0cc9a/src/runtime/server/handler.ts#L31) `^https?://`.\n\nThis regular expression can be bypassed by an absolute URL with leading whitespace. For example `\\nhttps://whatever.com` has a leading newline. \n\nAccording to the fetch specification, before a fetch is made the URL is normalized. \"To normalize a [byte sequence](https://infra.spec.whatwg.org/#byte-sequence) potentialValue, remove any leading and trailing [HTTP whitespace bytes](https://fetch.spec.whatwg.org/#http-whitespace-byte) from potentialValue.\" ([source](https://fetch.spec.whatwg.org/))\n\nThis means the final request will be normalized to `https://whatever.com`. We have bypassed the check and `nuxt-api-party` will send a request outside of the whitelist. \n\nThis could allow us to leak credentials or perform SSRF.\n\n### PoC\nPOC using Node.\n\n```js\nawait fetch(\"/api/__api_party/MyEndpoint\", {\n    method: \"POST\",\n    body: JSON.stringify({ path: \"\\nhttps://google.com\" }),\n    headers: { \"Content-Type\": \"application/json\" }\n})\n```\n\nWe can use `__proto__` as a substitute for the endpoint if it is not known. This will not leak any credentials as all attributes on `endpoint` will be undefined.\n```js\nawait fetch(\"/api/__api_party/__proto__\", {\n    method: \"POST\",\n    body: JSON.stringify({ path: \"\\nhttps://google.com\" }),\n    headers: { \"Content-Type\": \"application/json\" }\n})\n```\n\n### Impact\nLeak of sensitive API credentials. SSRF.\n\n\n### Fix\nRevert to the previous method of detecting absolute URLs.\n```js\n  if (new URL(path, 'http://localhost').origin !== 'http://localhost') {\n      // ...\n  }\n```","format":"markdown","source":"ghsa"},{"lang":"es","text":"`nuxt-api-party` es un módulo de código abierto para enviar solicitudes de API. nuxt-api-party intenta comprobar si el usuario ha pasado una URL absoluta para evitar el ataque antes mencionado. Esto se cambió recientemente para usar la expresión regular `^https?://`; sin embargo, esta expresión regular se puede omitir mediante una URL absoluta con espacios en blanco al principio. Por ejemplo `\\nhttps://whatever.com` que tiene una nueva línea inicial. Según la especificación de recuperación, antes de realizar una recuperación, la URL se normaliza. \"Para normalizar una secuencia de bytes de valor potencial, elimine los bytes de espacio en blanco HTTP iniciales y finales de valor potencial\". Esto significa que la solicitud final se normalizará en `https://whatever.com` sin pasar por la verificación y nuxt-api-party enviará una solicitud fuera de la lista blanca. Esto podría permitirnos filtrar credenciales o realizar Server-Side Request Forgery (SSRF). Esta vulnerabilidad se ha solucionado en la versión 0.22.1. Se recomienda a los usuarios que actualicen. Los usuarios que no puedan actualizar deben volver al método anterior para detectar URL absolutas.","source":"nvd"}],"published":"2023-12-08T23:45:18.581Z","modified":"2026-09-10T03:49:59.222Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-918"],"affected":[{"ranges":[{"version":"< 0.22.1","status":"affected"}],"vendor":"johannschopplich","product":"nuxt-api-party","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.22.0"}],"ecosystem":"npm","package":"nuxt-api-party","purl":"pkg:npm/nuxt-api-party","source":"ghsa"},{"ranges":[{"status":"affected","lastAffected":"0.21.3"}],"vendor":"johannschopplich","product":"nuxt_api_party","cpe":"cpe:2.3:a:johannschopplich:nuxt_api_party:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/johannschopplich/nuxt-api-party/security/advisories/GHSA-3wfp-253j-5jxv","tags":["exploit","mitigation","vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://fetch.spec.whatwg.org/","tags":["not-applicable","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://fetch.spec.whatwg.org/#http-whitespace-byte","tags":["not-applicable","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/johannschopplich/nuxt-api-party/blob/777462e1e3af1d9f8938aa33f230cd8cb6e0cc9a/src/runtime/server/handler.ts#L31","tags":["issue-tracking","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://infra.spec.whatwg.org/#byte-sequence","tags":["not-applicable","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-49799","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/johannschopplich/nuxt-api-party/commit/72762a200fc19d997a0f84bce578c28698dc5270","tags":["web"],"sources":["ghsa"]},{"url":"https://fetch.spec.whatwg.org","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/johannschopplich/nuxt-api-party","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2023-12-19T15:52:56.008Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-49799","url":"https://www.cve.org/CVERecord?id=CVE-2023-49799","licence":"CVE Terms of Use","modified":"2024-11-27T15:52:46.493Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3wfp-253j-5jxv","url":"https://github.com/advisories/GHSA-3wfp-253j-5jxv","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:59.222Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-49799","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-49799","licence":"Public domain","modified":"2026-06-17T06:36:29.377Z"}],"updatedAt":"2026-11-25T22:58:31.171Z","epss":{"score":0.00819,"percentile":0.58352,"date":"2026-12-01T12:00:22.000Z"}}