Knowledge is Power

Sitewide Search

Search Bare Metal Cyber

Search courses, individual lessons, wiki entries, books, podcasts, magazine articles, Daily Cyber News, and Darwin.

MITRE D3FEND™ Learning Center

D3-CP — Certificate Pinning

Persisting either a server's X.509 certificate or their public key and comparing that to server's presented identity to allow for greater client confidence in the remote server's identity for SSL connections.

1Mitigation mapping
1Enterprise inferred
1Parent technique
2Related artifacts

Harden · D3FEND ontology 1.6.0 · Active

Open official technique ↗
Official D3FEND definition

Definition

Persisting either a server's X.509 certificate or their public key and comparing that to server's presented identity to allow for greater client confidence in the remote server's identity for SSL connections.

Official D3FEND knowledge-base content

How it works

Pinning allows for a trusted copy of a certificate or public key to be associated with a server and thus reducing the likelihood of frequently visited sites being subjected to man-in-the-middle attacks. Certificates or public keys can be pinned after a trusted connection has been established or the pinning can be preloaded in an application, which is the preferred method for mobile applications.

Pinning can take the form of certificate pinning or public key pinning.

Forms of Pinning

An extension of PKP is Subject Public Key Information Pinning (SPKI) includes public key pinning plus additional information for SSL connections. The additional information can include preferred algorithms.

  • Certificate Pinning (CP) allows for the client to verify the X.509 certificate with a preloaded certificate. Typically, this is involves storing a hash of the certificate and using the stored hash for comparison to the hash of the certificate submitted during the SSL handshake.
  • Public Key Pinning (PKP) requires the extraction of a public key from server's certificate. The stored public key is compared to the server's presented public key. A public key is expected to rotate less frequently than an X.509 certificate and is generally favored over certificate pinning.

Considerations

  • With pinned certificates whenever a server updates its certificate, the pinned certificates will also need to be updated
  • With pinned public keys the extracted key may be subject to key refresh policies but much less frequently
  • Servers can become unavailable if pinned objects are set and not updated with the rotated identities. This may require a pinning strategy to be developed.
  • The application of this technique within web browser applications has been [deprecated](https://developer.mozilla.org/en-US/docs/Web/HTTP/Public_Key_Pinning) by popular web browser developers. They now favor certificate analysis via public certificate transparency logs, and the EXPECT-CT HTTP header.
Bare Metal Cyber interpretation

Implementation perspective

Certificate Pinning should be treated as a technical defensive capability rather than a product checkbox. In practice, teams should define the protected scope, the conditions under which the technique acts, and the observable evidence that demonstrates the intended behavior. For this technique, likely engineering context includes Certificate.

Use the technique to increase the effort, prerequisites, or constraints an adversary must overcome before exploitation or misuse succeeds.

Questions to ask

  • Which component, configuration, credential, interface, or behavior is being hardened?
  • What secure baseline or policy defines the intended state?
  • How are exceptions approved, time-limited, and reviewed?
  • How is the hardened state verified after deployment and significant change?

Evidence and validation

  • Approved hardening standards and configuration baselines
  • Automated configuration or integrity assessment results
  • Exception records with owners, rationale, and expiration dates
  • Test results demonstrating that the intended restriction is enforced

Common failure patterns

  • A secure setting is documented but not enforced consistently across the environment.
  • Hardening breaks required functions and is permanently weakened through undocumented exceptions.
  • Teams measure deployment of a product rather than verification of the hardened condition.

This implementation perspective is original Bare Metal Cyber educational content. It does not replace the official D3FEND definition or establish that a specific product implements the technique.

Ontology hierarchy

Technique hierarchy

Direct child techniques

None listed at this level.

D3FEND graph relationships

Artifacts and ontology entities

These relationships describe how D3FEND connects a defensive technique to artifacts or other ontology entities. They describe graph semantics, not a product certification.

Explicit technique relationships

authenticatesPublic Key
hardensCertificate
Show inferred artifact relationship paths (1)
Certificate PinninghardensCertificate
Curated D3FEND mapping

ATT&CK Enterprise mitigation relationships

These links come from the D3FEND ontology’s ATT&CK mitigation mapping. They help users navigate between the knowledge bases and do not guarantee mitigation effectiveness.

Inferred and experimental

Offensive-technique relationships

These relationships are generated from D3FEND graph paths and are explicitly experimental. They should be treated as hypotheses for defensive analysis—not as proof that the technique prevents, detects, or removes an offensive behavior.

ATT&CK Enterprise (1)
Source record

Authoritative sources