CVE-2012-1854

Microsoft VBA — DLL Hijacking via Untrusted Search Path in Office Applications
⚠️ CVSS 3.1  7.8 / 10 — HIGH 🔴 CISA Known Exploited Vulnerability

What is Visual Basic for Applications (VBA)?

Visual Basic for Applications (VBA) is Microsoft's embedded scripting and macro language, integrated into Office applications including Word, Excel, PowerPoint, Access, and Project. VBA enables automation through macros — small programs embedded in Office documents. It is ubiquitous in enterprise environments, heavily used for financial models, data processing automation, and document workflows. Because VBA macros execute with the privileges of the user running the Office application, VBA-related vulnerabilities are consistently high-value targets for attackers.

Overview

Actively Exploited. Microsoft acknowledged limited, targeted attacks exploiting this vulnerability at the time of the July 2012 patch release. CISA added it to the Known Exploited Vulnerabilities catalog on April 13, 2026 — confirming continued or renewed exploitation activity more than a decade after the original patch.

CVE-2012-1854 is an insecure library loading (DLL hijacking) vulnerability in the Microsoft Visual Basic for Applications runtime. When a user opens a legitimate Office document from a directory that also contains a maliciously named DLL, the VBA runtime searches that local directory before secured system paths — loading the attacker's DLL and executing arbitrary code with the victim's privileges.

Affected Versions

Product Affected
Microsoft Office 2003 SP3 Yes
Microsoft Office 2007 SP2 / SP3 Yes
Microsoft Office 2010 (32-bit and 64-bit) Yes
Microsoft Visual Basic for Applications runtime (standalone) Yes
Any third-party application hosting the VBA SDK Yes

Technical Details

Root cause: Untrusted Search Path (CWE-426)

The VBA runtime resolves DLL dependencies using an insecure search order. When a document triggers VBA execution, the runtime attempts to load required libraries by searching the directory containing the Office document before searching %SystemRoot%\system32 or other secured paths. This means an attacker can place a rogue DLL named to match a dependency expected by VBA in the same directory as a legitimate document.

Attack characteristics:

  • Authentication required: None — attacker needs only to trick the victim into opening a file
  • Complexity: Low — the entire attack is delivered via a single malicious directory
  • User interaction: Required — victim must open the Office document
  • Scope: Local execution context (no network component after initial delivery)

Practical attack flow:

  1. Attacker places a malicious DLL (e.g., vbe7.dll or other VBA dependency) in a directory they control
  2. Attacker places or links a legitimate-looking Office document in the same directory
  3. Victim opens the document (via email attachment, file share, USB drive, or downloaded archive)
  4. VBA runtime searches the document's directory first and loads the rogue DLL
  5. Attacker's code executes with the victim's privileges

Network share exploitation is particularly effective: if an attacker can write files to a UNC share path that a victim regularly opens documents from, no additional social engineering is needed beyond having the victim open any document from that location.

Discovery

Discovered by Bai Haowen of Huawei Security Labs, credited in MS12-046. The vulnerability class — insecure DLL search order — was first broadly described in Microsoft Security Advisory 2269637 (August 2010), which documented how applications across the Windows ecosystem were susceptible to this loading behavior. CVE-2012-1854 is one of many specific instances of that generic problem identified in the years following that advisory.

Exploitation Context

Microsoft confirmed limited, targeted attacks at the time of the July 2012 disclosure. The threat model for this vulnerability fits targeted campaigns: it requires either file-system co-location or tricking a user into opening a document from an attacker-controlled path — a delivery mechanism frequently used in spear-phishing and watering-hole attacks.

The CISA KEV listing in April 2026 indicates continued or renewed exploitation interest — consistent with the pattern of threat actors revisiting older, known-good techniques against organizations that have not maintained patch discipline on legacy Office installations or third-party applications still embedding the vulnerable VBA SDK.

Remediation

  1. Apply MS12-046 (KB2707960) — the patch hardens the VBA DLL search order to prevent loading from untrusted directories. This is the primary fix.
  2. Apply all subsequent Office cumulative updates — organizations running Office 2003/2007/2010 are well past Microsoft's end-of-life dates; upgrade to a supported Office version.
  3. Restrict macro execution — configure Group Policy to disable or restrict VBA macros from running in documents from untrusted locations (e.g., network shares, downloads). Use the Office macro security settings: File → Options → Trust Center → Macro Settings → Disable all macros with notification.
  4. Audit third-party software — any application embedding the VBA SDK (e.g., AutoCAD, CorelDRAW, or in-house tools using the VBA SDK) should be updated by their respective vendors.
  5. File share permissions — audit write permissions on network shares containing Office documents to prevent attacker DLL co-location.

Key Details

PropertyValue
CVE ID CVE-2012-1854
Vendor / Product Microsoft — Visual Basic for Applications (VBA)
NVD Published2012-07-10
NVD Last Modified2026-04-13
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-426 — Untrusted Search Path
CISA KEV Added2026-04-13
CISA KEV Deadline2026-04-27
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: 2026-04-27. Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.

Timeline

DateEvent
2012-07-10MS12-046 released; CVE-2012-1854 published on July 2012 Patch Tuesday
2012-07-10Microsoft acknowledges limited, targeted in-the-wild exploitation at time of disclosure
2026-04-13Added to CISA Known Exploited Vulnerabilities catalog (14 years after original patch)
2026-04-27CISA BOD 22-01 remediation deadline

References

ResourceType
NVD — CVE-2012-1854 Vulnerability Database
CISA KEV Catalog Entry US Government
Microsoft Security Bulletin MS12-046 Vendor Advisory / Patch
MS12-046 KB Article (KB2707960) Vendor Advisory
CWE-426 — Untrusted Search Path Weakness Classification