Katalog CWE

CWE-297 · Słabość

Improper Validation of Certificate with Host Mismatch

Abstrakcja
Wariant
Status
Niekompletny
Ryzyko wykorzystania
wysokie
Dodano
19 lipca 2006
Ostatnia zmiana
30 kwietnia 2026

Podatności CVE z tą słabościąPełny wpis na cwe.mitre.org ↗

Opis

The product communicates with a host that provides a certificate, but the product does not properly ensure that the certificate is actually associated with that host.

Even if a certificate is well-formed, signed, and follows the chain of trust, it may simply be a valid certificate for a different site than the site that the product is interacting with. In order to ensure data integrity, the certificate must be valid, and it must pertain to the site that is being accessed.

Even if the product attempts to check the hostname, it is still possible to incorrectly check the hostname. For example, attackers could create a certificate with a name that begins with a trusted name followed by a NUL byte, which could cause some string-based comparisons to only examine the portion that contains the trusted name.

Skutki

  • Access Control

    Gain Privileges or Assume Identity

    The data read from the system vouched for by the certificate may not be from the expected system.

  • Authentication, Other

    Other

    Trust afforded to the system in question - based on the malicious certificate - may allow for spoofing or redirection attacks.

  • Access Control, Other

    Gain Privileges or Assume Identity; Other

    If the certificate's host-specific data is not properly checked - such as the Common Name (CN) in the Subject or the Subject Alternative Name (SAN) extension of an X.509 certificate - it may be possible for a redirection or spoofing attack to allow a malicious host with a valid certificate to provide data, impersonating a trusted host.

Zapobieganie

  • Architecture and Design

    Fully check the hostname of the certificate and provide the user with adequate information about the nature of the problem and how to proceed.

  • Implementation

    If certificate pinning is being used, ensure that all relevant properties of the certificate are fully validated before the certificate is pinned, including the hostname.

Przykłady podatności

Słabość nadrzędna

Kiedy powstaje

Dotyczy

Not Language-Specific, Not Technology-Specific, Mobile, Web Based

Źródła

  1. The CLASP Application Security Process — Secure Software, Inc., 2005
  2. The Most Dangerous Code in the World: Validating SSL Certificates in Non-Browser Software — Martin Georgiev, Subodh Iyengar, Suman Jana, Rishita Anubhai, Dan Boneh, Vitaly Shmatikov, 2012
  3. Why Eve and Mallory Love Android: An Analysis of Android SSL (In)Security — Sascha Fahl, Marian Harbach, Thomas Muders, Matthew Smith, Lars Baumgärtner, Bernd Freisleben, 2012
  4. Secure programming with the OpenSSL API, Part 2: Secure handshake — Kenneth Ballard, 2005
  5. An Introduction to OpenSSL Programming (Part I) — Eric Rescorla, 2001
  6. 24 Deadly Sins of Software Security — Michael Howard, David LeBlanc, John Viega, "Sin 23: Improper Use of PKI, Especially SSL." Page 347, McGraw-Hill, 2010
  7. Spinner: Semi-Automatic Detection of Pinning without Hostname Verification — Chris McMahon Stone, Tom Chothia, Flavio D. Garcia

Wpis z katalogu CWE 4.20.