GHSA-h74c-q9j7-mpcm
Fix: elixir-tesla/tesla@4699c3cGHSA-h74c-q9j7-mpcm is a CWE-770 vulnerability in tesla. O3 Security confirms whether GHSA-h74c-q9j7-mpcm is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
Tesla vulnerable to atom exhaustion via untrusted URL scheme
Real-World Exposure
teslaReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Hex packages — download data is not available via public APIs for these ecosystems.
Description
Summary
In the Mint adapter for the Tesla HTTP client library, Tesla.Adapter.Mint.open_conn/2 passes the URL scheme of every outgoing request through String.to_atom/1 with no allow-list validation. Because BEAM atoms are permanent (never garbage-collected) and the atom table is bounded at roughly 1,048,576 entries, an attacker who can vary the URL scheme across requests can mint one fresh atom per request and eventually exhaust the table, crashing the VM.
Details
Vulnerable call (lib/tesla/adapter/mint.ex, open_conn/2): the scheme field parsed from the request URI is passed directly to String.to_atom/1 before being forwarded to Mint.HTTP.connect/4. Even though Mint raises for unrecognised schemes, the atom is already interned by that point. The function's HTTPS-branch guard confirms that no scheme normalisation occurs beforehand.
The attack surface has two entry points. First, any application-level URL-forwarding feature (webhook relay, link preview, SSRF-style proxy) where untrusted input reaches Tesla.get/2 or equivalent. Second, any pipeline that includes Tesla.Middleware.FollowRedirects: a server under the attacker's control can return a Location header with a novel scheme, triggering the atom creation on the redirect follow.
PoC
- Stand up any application that accepts a user-supplied URL and forwards it through
Tesla.Adapter.Mint. - Send requests to the application, each with a distinct, previously unseen URL scheme (e.g.
atk1://,atk2://, ...). - Each request interns one new permanent atom;
Mintrejects the connection but the atom persists. - After approximately 1,000,000 requests the BEAM atom table is exhausted and the VM crashes.
Impact
High severity (CVSS v4.0: 8.2). Any application using tesla 1.3.0 through 1.18.2 with Tesla.Adapter.Mint that allows untrusted input to influence request URLs is vulnerable to remote denial of service. No authentication or special privileges are required beyond access to the application's HTTP endpoint. Fixed in tesla 1.18.3.
Configurations
The application must use Tesla.Adapter.Mint and either expose a feature that forwards attacker-controlled URLs to Tesla, or include Tesla.Middleware.FollowRedirects in the middleware pipeline.
References
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 💧Hex | tesla | ≥ 1.3.0&&< 1.18.3 | 1.18.3 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for tesla. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update tesla to 1.18.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-h74c-q9j7-mpcm is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-h74c-q9j7-mpcm is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-h74c-q9j7-mpcm. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-h74c-q9j7-mpcm in your dependencies?
O3 detects GHSA-h74c-q9j7-mpcm across Hex dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.