CVE-2026-115693 in hackneyinfo

Summary

by MITRE • 10/26/2026

Improper Certificate Validation vulnerability in hackney_ssl in benoitc hackney allows an on-path attacker to impersonate a server pinned to a private certificate authority via a certificate chain that ends in a publicly trusted root. hackney adds {partial_chain, fun hackney_ssl:partial_chain/1} to every verify_peer configuration. The callback returns any certificate in the peer chain whose public key matches a root in the bundled certifi store as the trust anchor, and OTP honours that callback over the configured cacerts. hackney_ssl:merge_ssl_opts/3 kept the callback when the caller replaced the trust store with cacerts or cacertfile in ssl_options, so a connection pinned to a private CA still accepted any chain that carried a publicly trusted root.

The hostname check still applies, so the attacker needs a publicly trusted certificate for the pinned hostname.

This issue affects hackney: from 1.24.0 before 4.9.0.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 10/26/2026

The vulnerability identified in the hackney_ssl module of the benoitc/hackney HTTP client library represents a critical flaw in how TLS certificate chains are validated, specifically undermining the security guarantees provided by Certificate Pinning. This issue stems from an improper validation mechanism where the application fails to strictly enforce the intended trust anchor when connecting to servers that have been explicitly pinned to a private or internal Certificate Authority. The core of the problem lies in the interaction between hackney's custom verification callback and Erlang/OTP's underlying SSL implementation, which creates a bypass for attackers capable of performing on-path attacks such as man-in-the-middle scenarios.

Technically, the vulnerability arises because hackney_ssl automatically injects a specific function, partial_chain, into every verify_peer configuration option. This callback is designed to return any certificate within the peer's chain whose public key matches one found in the bundled certifi store, effectively treating that matching certificate as the trust anchor for validation purposes. While this behavior might be intended to support certain flexible connection scenarios, it becomes dangerous when combined with OTP's handling of verification callbacks. The Erlang/OTP runtime honors the result returned by this custom callback over the explicitly configured cacerts or cacertfile options provided by the caller. Consequently, even if a developer configures hackney to trust only a specific private CA for security pinning purposes, the presence of the partial_chain callback allows the SSL handshake to succeed as long as the server presents any certificate chain that terminates in a publicly trusted root found in the default bundle.

The operational impact of this flaw is significant because it effectively nullifies the protection offered by Certificate Pinning against on-path attackers who possess valid certificates for the target hostname from public authorities. An attacker positioned between the client and the intended server can intercept the connection and present their own certificate chain issued by a publicly trusted root, such as Let's Encrypt or DigiCert. Since the hackney_ssl module accepts this chain due to the partial_chain callback overriding the pinned private CA requirement, the client will establish an encrypted session with the attacker without raising any security warnings. This allows for complete eavesdropping and potential data manipulation of all traffic directed at the pinned hostname. It is important to note that because standard TLS hostname verification remains active during this process, the attacker must possess a valid certificate issued by a public CA specifically for the targeted domain name; they cannot simply use any arbitrary certificate.

This security deficiency affects versions of hackney ranging from 1.24.0 up to but not including version 4.9.0. The flaw is categorized under CWE-295, which describes Improper Certificate Validation, and aligns with MITRE ATT&CK techniques related to Man-in-the-Middle attacks where an adversary intercepts communication by bypassing certificate validation checks. To mitigate this risk, organizations relying on hackney for secure communications must upgrade immediately to version 4.9.0 or later, where the logic has been corrected to ensure that pinned private CAs are respected and not overridden by public trust anchors via custom callbacks. Until an upgrade is possible, developers should consider implementing additional application-layer validation checks or avoiding the use of hackney_ssl's default pinning mechanisms in favor of more rigid SSL configuration strategies that do not rely on the vulnerable partial_chain callback behavior.

Responsible

EEF

Reservation

10/25/2026

Disclosure

10/26/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

very low

Sources

Want to stay up to date on a daily basis?

Enable the mail alert feature now!