Open-Source Security Intelligence

Know every vulnerability
before it knows you.

DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.

Search

EEF-CVE-2026-103503

MediumCVSS 5.9 / 10
Published Oct 12, 2026·Last modified Oct 12, 2026
Affected Components(27)
hexpm/hex
0.20.5
hexpm/hex
2.0.3
hexpm/hex
2.5.1
1 / 9
Description

Summary

Improper Certificate Validation vulnerability in hexpm hex allows an attacker who can intercept HTTPS connections, and holds a certificate for a Hex host issued by a CA in Hex's bundled CA store, to impersonate that host to users who set cacerts_path to a CA store that leaves that CA out.

cacerts_path (HEX_CACERTS_PATH) is documented as the path to the CA certificate store, used instead of the CA bundle that ships with Hex. Hex.HTTP.SSL.ssl_opts/1 passes the configured store as the cacerts option, but builds the partial_chain callback from the bundled store whether cacerts_path is set or not. Hex.HTTP.SSL.partial_chain/2 accepts a server chain when any certificate in it has the same public key as a bundled CA certificate, so a chain that leads to a bundled CA passes verification although the configured store doesn't contain that CA. Hostname verification still applies.

This issue affects hex: from 0.20.2 before 2.5.2.

Details

  1. Hex.HTTP.SSL.get_ca_certs/0 returns the certificates from cacerts_path when it's set, and ssl_opts/1 passes them as cacerts.
  2. ssl_opts/1 sets partial_chain to &partial_chain(Certs.cacerts(), &1), which always uses the bundled store.
  3. When the server's chain doesn't lead to a certificate in cacerts, OTP calls partial_chain with the chain. partial_chain/2 returns {:trusted_ca, der} for the first certificate whose public key matches a bundled CA certificate, and OTP validates the chain with that certificate as the trust anchor.
  4. Chain validation and the hostname check from customize_hostname_check/1 still run, so the attacker needs a certificate for the requested host that chains to a bundled CA.

Proof of concept

  1. Create a PEM file that contains only an unrelated test CA certificate and set cacerts_path to it.
  2. Open a TLS connection to hex.pm with the options from Hex.HTTP.SSL.ssl_opts("https://hex.pm"). The handshake succeeds, and the accepted chain leads to ISRG Root X2 cross-signed by ISRG Root X1, neither of which is in the PEM file.
  3. Remove the partial_chain option and connect again. The handshake fails with unknown_ca.

Impact

Users set cacerts_path to limit which CAs can authenticate Hex's servers, for example to their organization's internal CA. Every CA in Hex's bundled store can still authenticate those servers, so a certificate mis-issued by one of those CAs, or obtained through compromised domain validation, lets an attacker on the network path impersonate hex.pm, repo.hex.pm, a self-hosted repository or a mirror. The attacker receives the API keys, OAuth tokens and repository keys Hex sends, and can alter API responses. Registry signatures and package checksums still prevent changes to registry contents and packages.

Workarounds

There's no Hex configuration that stops the bundled CAs from being trusted.

Configurations

Affects users who set cacerts_path or HEX_CACERTS_PATH to a CA store that leaves out some of the CAs bundled with Hex. Users who don't set it trust the bundled store already and aren't affected.

Solutions

Upgrade Hex to 2.5.2 or later, for example with mix local.hex. With cacerts_path (HEX_CACERTS_PATH) set, Hex then only accepts server certificates that chain to a CA in that file, and it doesn't trust copies of CA certificates sent by the server.

Upload your SBOM

Upload your own SBOM in CycloneDX 1.6 or higher (JSON) directly here to check your vulnerabilities.

Risk Scores
Base Score
5.9

The vulnerability can be exploited over the network without needing physical access. It is difficult for an attacker to exploit this vulnerability and may require special conditions. An attacker does not need any special privileges or access rights.

Threat Intelligence
2.1

Limited exploitation activity has been observed. Close monitoring and planned remediation are recommended.

EPSS
N/A

Probability that this vulnerability will be exploited in the wild within the next 30 days.

Exploit
Not available

We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.

Related Vulnerabilities
  • CVE-2026-103503
    Alias
  • EUVD-2026-97497
    Alias

Browse More

Scan your project

Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.

Checkout DevGuard