VBA macro rewrites its own project code

OLE_VBA_SELF_MODIFYING_PROJECT

← All detection heuristics · Office

info OLE_VBA_SELF_MODIFYING_PROJECT

What it means

VBA macro edits its own VBA project code, with no external template or workbook target.

Why it fires

The macro edits VBA project code through the VBE object model (CodeModule/VBComponents with InsertLines, DeleteLines or AddFromString), but every write targets the running document itself — no global template (Normal.dot), startup folder or other open workbook is referenced. That is self-modification rather than the self-replication of the W97M macro-virus family, and it is the shape of template-migration and code-generation tooling that round-trips sheet code through an external file. Shown for visibility only: it carries no score on its own, and it also requires 'Trust access to the VBA project object model', which is disabled by default.

Other Office heuristics

OLE_VBA_AFFINE_MSI_DOWNLOADER OLE_VBA_AUTOEXEC_FRAGMENTED_SHELL OLE_VBA_DESTRUCTIVE_WORKBOOK_SHUTDOWN OLE_VBA_BIDIRECTIONAL_MACROCOPY_REPLICATION OOXML_BRAND_LINK_MISMATCH_LURE CVE_2016_7262 POLYGLOT_OOXML_REL_COMMAND OLE_RAW_PCODE_CROSS_DOCUMENT_REPLICATION OLE_VBA_CROSS_WORKBOOK_REPLICATION OOXML_XLM_DANGEROUS_FN OFFICE_DEFAULT_PASSWORD_VBA_DROP_EXEC OFFICE_EMBEDDED_SWF EMBEDDED_OFFICE_CHILD_STATIC_TRIAGE OFFICE_EMBEDDED_MACRO_OBJECT OLE_EMBEDDED_EXE OLE_VBA_EMBEDDED_PE_DROPPER OLE_ENCRYPTED_AND_MALFORMED CVE_2017_11882_EQUATION_NATIVE_CMD_RELATED CVE_2017_11882 OLE_EQUATION_OLE10NATIVE_DOWNLOADER OLE_MTEF_NATIVE_CODE_STUB OLE_EQUATION_OLE10NATIVE_SHELLCODE OOXML_XLM_MACRO_IN_WORKSHEET OLE_XLS5_LAROUX_MACRO_VIRUS