# CVE-2026-103502: hex_core's default HTTP adapter doesn't verify TLS certificates on OTP 24 and 25

> hex_core's default HTTP adapter fails to verify TLS certificates on older Erlang/OTP versions, allowing man-in-the-middle attacks against package repositories.

- **Severity:** Medium 5.9 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 12 Oct 2026
- **Updated:** 16 Oct 2026
- **Also known as:** DEBIAN-CVE-2026-103502, EEF-CVE-2026-103502, GHSA-5rf8-f3v4-rg98, GHSA-p26c-h8c2-rwqj, UBUNTU-CVE-2026-103502

## What is CVE-2026-103502?

CVE-2026-103502 is a medium-severity vulnerability in hexpm hex_core, published on 12 Oct 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Improper Certificate Validation vulnerability in hexpm hex_core allows an attacker who can intercept HTTPS connections to impersonate hex.pm, repo.hex.pm or any other repository or API server to programs that use hex_core's default HTTP adapter on Erlang/OTP 24, or on OTP 25 when the operating system's CA certificates can't be loaded.

hex_core:default_config/0 selects the built-in hex_http_httpc adapter. For an HTTPS request whose adapter config has no ssl option, hex_http_httpc:http_options/2 builds options that verify the server certificate against public_key:cacerts_get/0. When that call raises, the adapter prints a warning and sends the request without ssl options, so httpc uses the defaults of the ssl application, which before OTP 26 don't verify the server certificate. public_key:cacerts_get/0 doesn't exist on OTP 24, so every HTTPS request falls back there, and on OTP 25 it raises when no CA store is found. hex_core versions before 0.11.0 never set ssl options, so they don't verify the server certificate on OTP 25 and earlier whether or not a CA store is found.

The fallback was intended and documented, but the documentation didn't make clear that it meant no certificate verification. Since hex_core 0.8.2 the README has warned that the built-in httpc adapter "has insecure default settings" and recommended other HTTP clients, and the adapter prints "using default ssl options which are insecure" on every request that falls back. hex_core 0.11.0 added certificate verification with the changelog entry "Use secure SSL defaults for OTP 25+". Neither the README nor the warning says that the server certificate isn't verified, the README doesn't say which OTP versions the warning applies to, and on OTP 25 without CA certificates the warning tells users to upgrade to OTP 25 or later, which they already run. This advisory is published so that users who took those notices as general advice know their HTTPS requests weren't authenticated.

This issue affects hex_core: from 0.1.0 before 0.20.0.

Weakness: CWE-636 (Not Failing Securely), CWE-295 (Improper Certificate Validation)

## Which versions are affected by CVE-2026-103502?

1 open source package ship an affected version, including hex_core.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `hex_core` | Hex | From 0.1.0 | 0.20.0 |

## How do I fix CVE-2026-103502?

Upgrade hex_core to 0.20.0 or later.

## Is CVE-2026-103502 being exploited?

There is no known exploitation of CVE-2026-103502 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-103502 and fix it if it is affected.

What it is: CVE-2026-103502 is a medium-severity vulnerability in hexpm hex_core, published on 12 Oct 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-103502 in the wild and no public exploit code.

Affected packages and fixed versions:
- hex_core (Hex): affected from 0.1.0; fixed in 0.20.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-103502/ (Markdown: https://insights.sbomify.com/CVE-2026-103502/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-103502
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-103502
- OSV: https://osv.dev/vulnerability/CVE-2026-103502

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-103502/
Summaries are generated and may contain mistakes; the official description above is the record.
