Skip to content
WETNav
SecuritySystem

Event ID 5038: Code integrity determined that the image hash of a file is not valid

Code integrity determined that the image hash of a file is not valid. The file could be corrupt due to unauthorized modification or the invalid hash could indicate a potential disk device error.

Channel
Security
Logged by default
Yes
Written on
Any host
Volume
Low
Audit subcategory
System Integrity
Needs a SACL
No

To have this event

  • Enable System Integrity: auditpol /set /subcategory:"System Integrity" /success:enable /failure:enable

Key fields

Exact XML field names, as they appear in <Data Name="…"> and in SIEM field extractions.

FileNameBufferFull path to the file with invalid hash
ProcessNameBufferProcess that loaded the file
RequestedPolicyCode integrity policy requested
ValidatedPolicyCode integrity policy validated
Have one of these events? Paste it into the decoder

Pull this event

Retrieval queries for a live host, a collected .evtx file and common SIEMs. Filter further on the key fields above.

Get-WinEvent -LogName 'Security' -FilterXPath "*[System[(EventID=5038)]]" -MaxEvents 50 |
  Select-Object TimeCreated, Id, MachineName, Message

-FilterXPath supports exact matches only. For substring matching, filter in Where-Object.

ATT&CK mapping

Techniques this event can help detect. Most of these depend on specific field values; the event alone does not mean the technique happened.

Common questions

What does Windows event ID 5038 mean?
Code integrity determined that the image hash of a file is not valid. The file could be corrupt due to unauthorized modification or the invalid hash could indicate a potential disk device error. It is written to the Windows Security log (Security).
Is event 5038 logged by default?
Yes, a default Windows installation records it. It is controlled by the "System Integrity" Advanced Audit Policy subcategory (System).

Code integrity determined that the image hash of a file is not valid. The file could be corrupt due to unauthorized modification or the invalid hash could indicate a potential disk device error. Needs the "System Integrity" audit subcategory.