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.
| Field | What it tells you |
|---|---|
| FileNameBuffer | Full path to the file with invalid hash |
| ProcessNameBuffer | Process that loaded the file |
| RequestedPolicy | Code integrity policy requested |
| ValidatedPolicy | Code integrity policy validated |
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).
Decode a real event
Paste the XML and every value gets explained. Nothing leaves your browser.
Open decoderCode 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.