Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-103503 Overview
CVE-2026-103503 is an improper certificate validation vulnerability [CWE-295] in the hexpm/hex package manager for Elixir and Erlang. The flaw affects Hex versions from 0.20.2 up to (but not including) 2.5.2. When a user configures cacerts_path (or the HEX_CACERTS_PATH environment variable) to use a custom CA certificate store, Hex still consults its bundled CA store during partial chain verification. An attacker who can intercept HTTPS connections and holds a certificate issued by any CA in Hex's bundled store can impersonate a Hex host, even if that CA was intentionally excluded from the user-supplied store.
Critical Impact
Attackers capable of intercepting HTTPS traffic can impersonate Hex package repositories to clients that rely on a restricted custom CA store, undermining supply chain integrity for Elixir and Erlang dependencies.
Affected Products
- hexpm/hex versions from 0.20.2 up to but excluding 2.5.2
- Elixir and Erlang build environments using cacerts_path or HEX_CACERTS_PATH
- CI/CD pipelines pulling Hex packages over HTTPS with restricted CA bundles
Discovery Timeline
- 2026-10-12 - CVE-2026-103503 published to NVD
- 2026-10-16 - Last updated in NVD database
Technical Details for CVE-2026-103503
Vulnerability Analysis
The vulnerability resides in Hex.HTTP.SSL.ssl_opts/1, which configures TLS options for outbound HTTPS requests to Hex repositories. When cacerts_path is set, Hex correctly passes the user-supplied CA store as the cacerts option to the Erlang TLS stack. However, the partial_chain callback is always constructed from the bundled CA store, regardless of whether cacerts_path is configured.
The Hex.HTTP.SSL.partial_chain/2 function accepts any server certificate chain in which any intermediate or root certificate shares a public key with a bundled CA certificate. As a result, a chain anchored by a bundled CA bypasses the restrictions implied by the user-configured store. Hostname verification still runs, so the attacker must present a certificate whose Subject Alternative Name matches the target Hex host.
Root Cause
The root cause is a mismatch between the trust store passed to the TLS layer and the trust store used by the partial_chain validation callback. Users explicitly reducing the trust surface by configuring a smaller CA bundle still inherit implicit trust in every CA shipped with Hex, defeating the purpose of the configuration option.
Attack Vector
Exploitation requires a network-adjacent position capable of intercepting TLS connections, such as a compromised router, hostile Wi-Fi, or malicious transparent proxy. The attacker must also obtain or control a valid certificate for the target Hex host issued by a CA included in Hex's bundled store but excluded from the victim's cacerts_path. User interaction is required because the victim must initiate a Hex operation such as mix deps.get or mix hex.publish.
check?
end
+ def get_ca_certs do
+ case Hex.State.fetch!(:cacerts_path) do
+ nil -> Certs.cacerts()
+ path -> Certs.decode_runtime(path)
+ end
+ end
+
def ssl_opts(url) do
hostname = Hex.string_to_charlist(URI.parse(url).host)
ciphers = filter_ciphers(@default_ciphers)
Source: GitHub Commit c9b26a46 — the patch introduces get_ca_certs/0, which returns the runtime-decoded CA store from cacerts_path when set, instead of defaulting to the bundled store.
Detection Methods for CVE-2026-103503
Indicators of Compromise
- Unexpected TLS certificates presented by repo.hex.pm or configured private Hex mirrors where the issuer is a CA in Hex's bundled store but not in the organization's declared cacerts_path.
- Successful Hex HTTPS requests originating from hosts whose outbound traffic traverses untrusted intermediaries.
- Package fetches resolving to IP addresses outside the known Hex content delivery infrastructure.
Detection Strategies
- Audit Elixir and Erlang build hosts for the HEX_CACERTS_PATH environment variable and compare the referenced CA store against Hex's bundled store in lib/hex/http/certs.ex.
- Capture and inspect TLS session metadata from CI/CD runners performing mix deps.get, flagging certificates issued by CAs not present in the configured trust store.
- Pin hex to version 2.5.2 or later in dependency manifests and alert on build images that resolve to earlier versions.
Monitoring Recommendations
- Log the full certificate chain presented during Hex HTTPS fetches for retrospective analysis.
- Monitor outbound connections from build systems for TLS downgrade or interception indicators such as unexpected SNI or ALPN values.
- Review Hex client version strings in build logs across the fleet to identify hosts still running vulnerable versions.
How to Mitigate CVE-2026-103503
Immediate Actions Required
- Upgrade hex to version 2.5.2 or later across all developer workstations, build servers, and CI/CD pipelines.
- Inventory every environment setting cacerts_path or HEX_CACERTS_PATH and prioritize those hosts for patching.
- Restrict outbound traffic from build systems to known Hex endpoints to reduce the opportunity for TLS interception.
Patch Information
The fix is distributed in Hex 2.5.2. The relevant commits are 5f5a2136, 6232a649, and c9b26a46. The patches rework Hex.HTTP.SSL so that when cacerts_path is set, Hex trusts only the CA certificates decoded from that path, and the partial_chain callback is built from the same store. See the GitHub Security Advisory GHSA-rw8q-hg7m-cxgr and the CNA advisory for full details.
Workarounds
- If upgrading is not immediately possible, unset cacerts_path and rely on Hex's bundled CA store, accepting the broader trust surface rather than a bypassable restricted one.
- Route Hex traffic through a controlled egress proxy that enforces strict certificate pinning for Hex hosts.
- Isolate build environments on networks where TLS interception by untrusted parties is not feasible.
# Verify installed Hex version and upgrade to the patched release
mix hex.info
mix local.hex --force
# Confirm Hex 2.5.2 or later is now active
mix hex.info | grep -i version
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

