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.
Published: 2026-10-12
Score: 5.9 Medium
EPSS: n/a
KEV: No
Impact: Impersonation of trusted HTTPS servers via missing TLS certificate verification
Action: Patch
AI Analysis

Impact

The vulnerability arises because hex_core’s default HTTP adapter does not verify TLS certificates when running on OTP 24 or OTP 25 if the operating system’s CA store cannot be accessed. In these cases, the adapter falls back to the Erlang ssl defaults, which prior to OTP 26 do not enforce certificate validation. An attacker who can observe or modify HTTPS traffic can therefore pose as the hex.pm registry, any user‑supplied repository, or arbitrary API servers and supply malicious packages or data. This impersonation can result in the execution of code that originates from a trusted source but has been tampered with, compromising confidentiality, integrity, and availability of the affected systems.

Affected Systems

The issue affects hexpm’s hex_core library in all releases from 0.1.0 up to, but not including, 0.20.0. Users running OTP 24 or OTP 25 with a missing or inaccessible OS CA certificate store are especially vulnerable, as hex_core never sets ssl verification options for HTTPS requests in these environments. Systems that use the default hex_http_httpc adapter without explicitly configuring ssl options inherit the insecure behavior of older OTP releases.

Risk and Exploitability

The CVSS score of 5.9 indicates medium severity, and the vulnerability is not listed in the CISA KEV catalog. The EPSS score is not available, so the historical exploitation probability is unknown. The most likely attack vector is a network or local MITM that can intercept traffic to the registry or API endpoint; an attacker only needs to present an forged certificate that will be accepted by the vulnerable client. In environments where hex_core is used without additional verification, an exploitation can lead to tampered packages being installed or malicious data being communicated to an application.

Generated by OpenCVE AI on October 12, 2026 at 15:27 UTC.

Remediation

Vendor Solution

Upgrade hex_core to 0.20.0 or later. On OTP 24, or on OTP 25 without the operating system's CA certificates, HTTPS requests through hex_http_httpc then fail with {error, {cacerts_unavailable, Reason}} unless the adapter config has ssl options.


Vendor Workaround

Pass ssl options that verify the server certificate in the adapter config, for example {hex_http_httpc, #{http_options => [{ssl, SslOpts}]}}, use another HTTP adapter, or run on OTP 26 or later.


OpenCVE Recommended Actions

  • Upgrade hex_core to version 0.20.0 or newer
  • If an upgrade is not immediately possible, configure the adapter with explicit ssl options that enable certificate verification, e.g., {hex_http_httpc, #{http_options => [{ssl, SslOpts}]}}
  • Consider switching to a different HTTP adapter such as HTTPoison or running the application on OTP 26 or later, where the default ssl configuration requires certificate verification

Generated by OpenCVE AI on October 12, 2026 at 15:27 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 12 Oct 2026 14:00:00 +0000

Type Values Removed Values Added
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.
Title hex_core's default HTTP adapter doesn't verify TLS certificates on OTP 24 and 25
First Time appeared Hexpm
Hexpm hex Core
Weaknesses CWE-295
CWE-636
CPEs cpe:2.3:a:hexpm:hex_core:*:*:*:*:*:*:*:*
Vendors & Products Hexpm
Hexpm hex Core
References
Metrics cvssV4_0

{'score': 5.9, 'vector': '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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: EEF

Published:

Updated: 2026-10-12T13:15:29.040Z

Reserved: 2026-10-09T16:45:02.344Z

Link: CVE-2026-103502

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-12T14:17:08.610

Modified: 2026-10-12T14:17:08.610

Link: CVE-2026-103502

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-12T15:30:14Z

Weaknesses
  • CWE-295

    Improper Certificate Validation

  • CWE-636

    Not Failing Securely ('Failing Open')