PKI Well Revised: Common Mistakes Which Lead to Huge Compromise of Identity
Security researchers examine technical aspects of PKI Well Revised: Common Mistakes Which Lead to Huge Compromise of Identity.
Summary
### Overview In this presentation, Dr. Mike Jankowski Lorek, Director of Consulting and cybersecurity expert at CQURE, examines how misconfigurations in Public Key Infrastructure (PKI) can allow attackers to escalate privileges and fully compromise identity across an organization. Using an opening analogy about an abandoned mine in Joshua Tree, he emphasizes that PKI is intended to boost security but can become an attack vector if improperly configured. The session covers fundamental cryptographic mechanisms, the function of certificates, and an end-to-end live demonstration showing how an Active Directory environment can be compromised using a flawed certificate template.
### Key Topics - **Cryptographic Fundamentals**: Distinction between encoding (data transformation for systems without secrecy, e.g., Base64, URL encoding), encryption (confidentiality via symmetric ciphers like AES or asymmetric pairs like RSA), hashing (one-way message integrity via MD5, SHA-1, SHA-256), and digital signatures (author verification using private keys and algorithms such as SHA-256 RSA). - **Certificates and PKI Architecture**: Role of X.509 certificates in binding public keys to identities; Certificate Signing Requests (CSRs); Certificate Authorities (CAs) as trusted third parties; Certification Practice Statements (CPS); revocation methods (CRLs and OCSP); Certificate Transparency logs; and operating system/browser trust lists (e.g., Windows vs. Mozilla Firefox). - **Cross-Certification Risks**: Dangers of blindly adding third-party root CAs into trusted stores versus utilizing constrained cross-certification (name constraints restricting DNS suffixes or email domains). - **PKI Exploitation Vectors**: Risks arising from client authentication Extended Key Usage (EKU), user-supplied Subject Alternative Names (SAN), automatic CSR approval, and permissive certificate template permissions.
### Technical Details During the live demonstration, the speaker logged into a Windows Server member machine as a local administrator account (`CQURE\Bob`). He demonstrated that properly secured templates (such as the default user template) automatically populate identity attributes from Active Directory and ignore arbitrary subject inputs. However, inspecting computer certificate templates using `certlm.msc` revealed a misconfigured template named `CQWeb_bad`.
This vulnerable template exhibited two critical flaws: 1. It allowed the enrollee to supply the subject and Subject Alternative Name (SAN) in the request. 2. In addition to Server Authentication, it included Client Authentication in its Extended Key Usage (EKU) and lacked manager approval requirements.
The speaker submitted a certificate request using `site3.cqure.lab` as the common name and DNS name, while injecting an alternative name of `admin@cqure.lab`. Upon automatic issuance, the certificate and private key were exported to a password-protected PFX file (`FC5.pfx`), which bypassed default export protections using the Data Protection API (DPAPI).
To leverage this certificate for identity impersonation without native smart card hardware, the speaker created a virtual smart card tied to the machine's TPM chip. Utilizing `certutil` with the Microsoft Base Smart Card Crypto Provider, the exported PFX was imported into the virtual smart card using the default PIN (`12345678`). With the client-authentication certificate loaded: - A connection to the domain controller's hidden administrative share (`net use Z: \\dc01\c$ /smartcard`) succeeded, exposing Active Directory database files in `Windows\NTDS`. - Executing `runas /user:admin@cqure.lab /smartcard cmd` spawned an elevated command prompt. Checking `whoami /all` confirmed the session had Domain Admin privileges, and `klist` showed active Kerberos tickets that could be captured and reused for pass-the-ticket attacks.
### Takeaways The speaker outlined essential practices to avoid PKI-driven identity compromise: - **Restrict Subject Name Supply**: Do not allow requesters to define arbitrary SAN values in templates that also permit client authentication. - **Limit Extended Key Usage (EKU)**: Avoid issuing multipurpose certificates or granting client authentication capabilities when only server authentication is required. - **Enforce Approval Workflows**: High-value or sensitive certificate requests should require manual review and approval by certificate managers rather than automatic issuance. - **Lock Down Template ACLs**: Restrict template editing and enrollment permissions strictly to domain administrators to prevent unauthorized modifications. - **Use Constrained Cross-Certification**: Restrict external CA trust using specific naming and domain constraints to avoid domain-wide impersonation. - **Secure Key Storage**: Be mindful that software-based key storage providers can often be exported despite administrative export flags.
Related talks
RSAC Cybersecurity·20 min
Paul Simmonds
Paul Simmonds explores Sorry? Who Did You Say You Were? - Exploiting Identity for Fun and Profit.
Videos·40 min
Uncovering A Critical Vulnerability And Taking Over Decentralized Identity Networks by Shaked Reiner
Security researchers examine technical aspects of Uncovering A Critical Vulnerability And Taking Over Decentralized Identity Networks by Shaked Reiner.
Black Hat·24 min
Engineers explore architecture and security mechanisms for Off-Path Attacks Against PKI.


