{"id":"CVE-2026-103503","published":"2026-10-12T15:17:45Z","modified":"2026-11-19T08:21:17Z","title":"Hex trusts its bundled CA certificates when cacerts_path is set","vendor":"hexpm","product":"hex","tier":"tail","description":{"text":"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.\n\ncacerts_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.\n\nThis issue affects hex: from 0.20.2 before 2.5.2.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.9,"severity":"MEDIUM","version":"4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:A/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00303,"percentile":0.15451,"provenance":"source"},"cwes":[{"id":"CWE-295","name":"Improper Certificate Validation"}],"references":[{"url":"https://github.com/hexpm/hex/security/advisories/GHSA-rw8q-hg7m-cxgr","tags":["related","vendor-advisory"]},{"url":"https://cna.erlef.org/cves/CVE-2026-103503.html","tags":["related"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-103503","tags":["related"]},{"url":"https://github.com/hexpm/hex/commit/c9b26a46928bfcd546773571e09c1d05f4cd9fb7","tags":["related"]},{"url":"https://github.com/hexpm/hex/commit/5f5a2136c7cf5991b6e8a30d645ca9f8e74b0785","tags":["patch"]},{"url":"https://github.com/hexpm/hex/commit/6232a6498015e559743bec4f4fbec9138837cec8","tags":["patch"]}],"priority":{"score":7.2,"factors":[{"name":"EPSS percentile","points":3.09},{"name":"CVSS severity","points":4.13}]},"vendorSlug":"hexpm","affectedVersions":[{"vendor":"hexpm","product":"hex","versions":[">= 0.20.2, < 2.5.2"]},{"vendor":"hexpm","product":"hex","versions":[">= c9b26a46928bfcd546773571e09c1d05f4cd9fb7"]}],"fixedVersions":[{"vendor":"hexpm","product":"hex","versions":["5f5a2136c7cf5991b6e8a30d645ca9f8e74b0785","6232a6498015e559743bec4f4fbec9138837cec8"]}],"solutions":{"items":["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."],"from":"CVE.org CNA","provenance":"source"},"workarounds":{"items":["There's no Hex configuration that stops the bundled CAs from being trusted."],"from":"CVE.org CNA","provenance":"source"},"capec":[{"id":"CAPEC-94","name":"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."}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-10-16T17:30:53.768172Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2026-97497","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-hexpm-hex-cve-2026-103503","children":[{"from":"CVE-2026-103503","to":"CVE-2026-105668","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["lib/hex/state.ex","lib/mix/tasks/hex.config.ex"],"commits":["https://github.com/hexpm/hex/commit/c9b26a46928bfcd546773571e09c1d05f4cd9fb7","https://github.com/hexpm/hex/commit/5f5a2136c7cf5991b6e8a30d645ca9f8e74b0785","https://github.com/hexpm/hex/commit/b4e665d46be8a5f81e8cbbe4c3a67058a19cf133","https://github.com/hexpm/hex/commit/1b6fddfeadd98ed26a143f60356efade0494e2ae"],"basis":"rarely changed file"}]}]}}