CVE-2012-0151 — Microsoft Windows Authenticode Signature Verification Remote Code Execution Vulnerability

CVE-2012-0151

Microsoft Windows — WinVerifyTrust Digest Validation Flaw Allows Code Execution via Tampered Signed PE Files

What is Windows Authenticode?

Windows Authenticode is the code signing framework used to verify the authenticity and integrity of executable files (PE files: .exe, .dll, .sys, .cab). When a publisher signs a file, a cryptographic hash (digest) of the file contents is embedded in the signature. WinVerifyTrust is the Windows API function that validates this signature — it checks that the certificate chain is trusted and that the file's actual content matches the signed digest. A flaw in this verification process can allow attackers to modify a signed file without invalidating the signature, effectively defeating one of Windows' core trust mechanisms.

Overview

CVE-2012-0151 is an improper input validation vulnerability (CWE-20) in the WinVerifyTrust function in Microsoft Windows. The function fails to correctly validate the digest of a signed portable executable (PE) file, allowing an attacker to append arbitrary data or code to a legitimately signed PE file while the Authenticode signature remains valid. This means malware can masquerade as a trusted, digitally signed binary.

Microsoft patched this in Security Bulletin MS12-024 on April 10, 2012.

Affected Versions

Operating System Affected
Windows XP SP3 Yes
Windows XP x64 Edition SP2 Yes
Windows Server 2003 SP2 (all editions) Yes
Windows Vista SP2 Yes
Windows Server 2008 SP2 Yes
Windows 7 (all service packs) Yes
Windows Server 2008 R2 (all service packs) Yes

Technical Details

Authenticode PE signature verification works by hashing specific sections of a PE file according to a defined algorithm, then verifying that hash matches the signed digest. CVE-2012-0151 arises because WinVerifyTrust did not properly account for data appended after the end of the PE file's last section — data outside the measured portions of the file.

An attacker can:

  1. Obtain a legitimately signed PE file from a trusted publisher
  2. Append arbitrary code or data after the verified portion
  3. Craft a PE that executes the appended malicious code
  4. The resulting file passes WinVerifyTrust and appears fully trusted to Windows security checks

This bypasses User Account Control (UAC) prompts, application allowlisting based on signed publisher trust, and security software that relies on Authenticode validity as a trust signal.

Attack vector: Local/UI:Required — the victim must execute the crafted file. The attack is typically delivered via social engineering (email attachment, download link) and relies on the apparent legitimacy of the Authenticode signature to convince the user to run it.

Discovery

The vulnerability was discovered through security research into the Authenticode signing verification process and coordinated with Microsoft before the MS12-024 patch release.

Exploitation Context

CISA confirmed exploitation in the wild. This vulnerability is particularly effective for social engineering campaigns targeting organizations with "run only signed applications" policies — the apparent Authenticode trust can bypass both technical controls and user suspicion. Malware authors used this technique to trojanize otherwise legitimate signed installers or system utilities.

Remediation

  1. Apply MS12-024 on all affected Windows systems immediately
  2. Modern Windows versions (8.1+) include stricter Authenticode validation that addresses this class of issue — prioritize upgrading end-of-life Windows versions
  3. Supplement Authenticode trust with additional controls: application allowlisting based on file hash rather than certificate alone, endpoint detection that analyzes PE structure, and sandboxing
  4. Do not treat Authenticode signature presence as a sufficient trust signal for allowing execution — validate against known-good hashes from authoritative sources

Key Details

PropertyValue
CVE ID CVE-2012-0151
Vendor / Product Microsoft — Windows
NVD Published2012-04-10
NVD Last Modified2025-10-22
CVSS 3.1 Score7.8
CVSS 3.1 VectorCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
SeverityHIGH
CWE CWE-20 find similar ↗
CISA KEV Added2022-06-08
CISA KEV Deadline2022-06-22
Known Ransomware Use No

CVSS 3.1 Breakdown

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Required Action

CISA BOD 22-01 Deadline: 2022-06-22. Apply updates per vendor instructions.

Timeline

DateEvent
2012-04-10Microsoft releases MS12-024 patching the WinVerifyTrust digest validation flaw
2012-04-10CVE-2012-0151 published
2022-06-08Added to CISA Known Exploited Vulnerabilities catalog
2022-06-22CISA BOD 22-01 remediation deadline

References

ResourceType
NVD — CVE-2012-0151 Vulnerability Database
CISA KEV Catalog Entry US Government
Microsoft Security Bulletin MS12-024 Vendor Advisory