Skip to content

v0.15.0

Choose a tag to compare

@github-actions github-actions released this 01 Nov 07:18
· 210 commits to master since this release
6e6a095

Records now render as Windows renders them in many more ways, and all the
breaking changes of this round are in this one release. Breaking changes says
what to change when upgrading; the sections after it give the details.

Breaking changes

Output, in XML and JSON, from every API and from evtx_dump:

  • Timestamps have seven fractional digits (2016-07-08T18:12:51.6816408Z).
    Code that parses them with exactly six needs to accept seven.
  • GUIDs are lowercase and in braces ({54849625-5478-4994-a5ba-3e3b0328c30d}).
  • Elements that depend on a NULL value are left out, as Windows leaves them
    out: the <Binary></Binary> and <Data></Data> of values that were never
    set, and unset optional System fields. Code that reads them needs to handle
    their absence.
  • In JSON, consecutive Data elements of one name are one member whose value
    is an array, and a name that comes back later is numbered _1, _2: in
    event 4648 of some logs, the second LogonGuid is LogonGuid_1.
  • XML writes empty elements as <X/>, or as <X></X> when their content is
    empty, with nothing inside them when indented.
  • Characters that XML doesn't allow are _ in XML, and lone surrogates are _
    in XML and U+FFFD in JSON. utf16-simd 0.2.0 does the same.
  • A log that has wrapped around comes out oldest record first.
  • The walk over a chunk's records resyncs past a corrupt record header, so more
    records come out. With recover_records, the records that the resync skips
    come out as recovered.
  • A record fails with an error once its output passes 16 MiB, or once its tree
    takes more than 2^18 nodes. The samples' records stay far below both.

API:

  • EvtxFileHeader has computed_checksum, and EvtxChunkData has number,
    so struct literals of them need the new fields.
  • HeaderFlags and ChunkFlags keep the bits evtx doesn't define: test flags
    with contains, since == compares those bits too.
  • A record that can't be read fails with EvtxError::FailedToReadRecordAt,
    whose source is the error it used to fail with. EvtxError,
    DeserializationError (OutOfBounds, InvalidRecordTimestamp) and
    ChunkError (InvalidChunkHeaderChecksum, InvalidFreeSpaceOffset) have
    new variants, and InvalidChunkChecksum is now only for the records' CRC32.
  • BinXmlValue::FileTimeType, SysTimeType and their arrays hold FileTime
    and SysTime, the values as stored. to_timestamp() gives a jiff
    Timestamp when jiff can represent the value. AnsiStringArrayType holds
    its strings.
  • ParserSettings with different WEVT template caches no longer compare equal.

Added

  • EvtxParser::header() returns the file header, which was private. The
    header also has computed_checksum, the CRC32 of its first 120 bytes as
    read, and validate_checksum(), which compares it with the stored
    checksum unless NO_CRC32 is set (the Application_no_crc32 sample's
    header sets it and stores 0). evtx never checked the header's CRC32. A file
    whose header fails the check is still read, since evtx finds chunks at fixed
    offsets, but the parser logs a warning and evtx_dump prints one.
    Breaking: code that builds an EvtxFileHeader with a struct literal
    needs the new field.
  • evtx_dump info -i <file> shows what the file header and each chunk header
    say: the version, flags, chunk numbers, next record ID and CRC32 of the
    header, and each chunk's record numbers and IDs, flags, and header and
    records CRC32s, with empty and unreadable chunks marked, without parsing
    records. For triaging dirty, wrapped or damaged logs: security.evtx's dirty
    header says the next record ID is 2226, where its last chunk ends at 2261.
  • ChunkFlags, the type of EvtxChunkHeader::flags, is exported, so that its
    flags can be named.

Changed

  • A log that has wrapped around comes out oldest record first, as Windows reads
    it: from the chunk that holds its lowest record ID to the end of the file,
    then from the start of the file. evtx read it in file order, so its newest
    records came first. The file header names the oldest chunk too, but a log
    that wasn't closed cleanly can be a chunk ahead of it, as the LiveId sample
    is, and Windows still starts at the oldest records. 5 of the samples change.
  • Timestamps render with seven fractional digits, the 100 ns that a FILETIME
    counts, as Windows renders them: 2016-07-08T18:12:51.6816408Z instead of
    2016-07-08T18:12:51.681640Z, which dropped the last digit. SYSTEMTIME
    values, which store milliseconds, render as .7890000Z, as in Windows. This
    covers XML and JSON, TimeCreated included, so code that parses evtx's
    timestamps with exactly six digits needs to accept seven.
  • In JSON, Data elements that share a name no longer become duplicate keys,
    of which JSON parsers keep only the last. Consecutive ones, which an array
    substitution writes, one per value, become one member whose value is an
    array: "UnicodeStrings":["a","","c,d"] instead of
    "UnicodeStrings":"a","UnicodeStrings":"","UnicodeStrings":"c,d". A name
    that comes back later is numbered _1, _2 and so on, as repeated element
    names already are. Event 4648 in the Security_with_size_t and
    security_big_sample samples names both of its GUIDs LogonGuid, where the
    other samples name the second TargetLogonGuid, so the second is now
    LogonGuid_1 and LogonGuid is the first, which parsers used to lose. XML
    is unchanged, and so are arrays of one value, which render as that value.
  • Errors say where they are. A record that can't be read, such as one whose
    header is damaged, fails with EvtxError::FailedToReadRecordAt, which names
    its chunk and its offsets and has the error it replaces as its source:
    Failed to read the record at offset 0x2060 of chunk 7 (file offset 0x73060). The chunks that the parser reads keep their number in the file in
    EvtxChunkData::number, so errors name it when such a chunk is parsed on its
    own, with EvtxChunkData::parse; a chunk built with EvtxChunkData::new
    doesn't know it, and says of its chunk. A position past the end of the data
    reads NullType Descriptor at offset 78404 is past the end of the data (65536 bytes) (DeserializationError::OutOfBounds) instead of buffer too small for NullType Descriptor at offset 78404 (need 0 bytes, have 0), and a record
    header whose timestamp is out of range fails with InvalidRecordTimestamp,
    which gives the FILETIME, instead of InvalidDateTimeError. Breaking:
    code that matches on such a record's error finds it under
    FailedToReadRecordAt, exhaustive matches on EvtxError and
    DeserializationError need the new variants, and code that builds an
    EvtxChunkData with a struct literal needs its number.
  • BinXmlValue's FILETIME and SYSTEMTIME variants hold the stored value, a
    FileTime or a SysTime, instead of a jiff Timestamp, so that values jiff
    can't represent still render. to_timestamp() converts them.
  • BinXmlValue::AnsiStringArrayType holds its strings, as a &[&str].
  • evtx_dump starts each chunk's output buffer as big as the largest a chunk of
    the log has needed so far (from 128 KiB up to 1 MiB), instead of at 128 KiB.
    Most Security chunks render about 160 KiB of XML, and growing the buffer
    copies it unless the allocator has free space right after it, so the cost of
    a dump depended on heap layout: up to 6.5% more instructions on a 30 MB
    Security log.

Fixed

  • A chunk whose string table couldn't be read was reported as Failed to parse chunk number N with N its place among the chunks read, not its number in the
    file. The two differ after an empty chunk and in a log that has wrapped
    around.
  • GUIDs render as Windows renders them, lowercase and in braces:
    {54849625-5478-4994-a5ba-3e3b0328c30d} instead of
    54849625-5478-4994-A5BA-3E3B0328C30D. This covers GUID values in XML and
    JSON, the provider's Guid and the ActivityID included. A GUID that a
    template holds as text keeps its case. Code that matches evtx's GUIDs as text
    needs to accept the new form.
  • XML writes empty elements as Windows does: <Provider Name="P"/> for an
    element the template closes empty, and <Data Name="x"></Data> for one whose
    content is empty. Indented output used to put a newline and indentation inside
    them, which XML parsers read as text. JSON is unchanged.
  • An element whose template makes it depend on a value (its DependencyId) is
    left out when that value is NULL, as MS-EVEN6 requires and Windows does. This
    removes the <Binary></Binary> and <Data></Data> that classic events wrote
    for values that were never set, and optional System fields left unset. An
    element left with no children renders empty, as <EventData></EventData> in
    XML and "EventData": null in JSON. An empty string still renders as an
    empty element, as in Windows. This covers XML and JSON.
  • A record holding a FILETIME or SYSTEMTIME value that jiff can't represent
    failed with InvalidDateTimeError: a FILETIME from 9999-12-30T22:00 UTC on,
    and a SYSTEMTIME with a field out of range. Such values now render as Windows
    renders them. Years past 9999 keep their last four digits, a FILETIME past
    i64::MAX renders as 0000-00-00T00:00:00.0000000Z, and an invalid
    SYSTEMTIME as 1601-01-01T00:00:00.0000000Z, as an unset one already did.
    10 records of the Windows types sample failed this way.
  • A record holding an array of ANSI strings, which Windows stores for a
    win:AnsiString field with a count, failed because evtx didn't implement
    that value type. Each string now renders as an element of its own, as Windows
    renders them. 3 records of the Windows types sample failed this way.
  • A record whose template holds a CDATA section or a character reference failed,
    because evtx didn't implement those BinXML tokens. XML now writes them as
    <![CDATA[...]]> and &#65;, and JSON gets their text. A ]]> inside a
    CDATA section splits it in two, so the XML stays well-formed. With this, every
    record of the Windows types sample renders.
  • XML output wasn't always well-formed: C0 controls other than tab, LF and CR,
    and U+FFFE and U+FFFF, went into it as they were, and XML parsers reject them.
    Each now renders as _, as Windows renders them. A lone UTF-16 surrogate was
    dropped: it now renders as _ in XML, as in Windows, and as U+FFFD in JSON,
    which already escaped controls. 5 records across the samples weren't
    well-formed XML, and now every record is. utf16-simd 0.2.0 makes the same
    change in its XML, JSON and raw output.
  • A chunk whose string table links back to a string it has already listed, as
    a damaged or crafted chunk can, made the parser loop forever: only a string
    that links to itself ended the walk. Any string already read now ends it.
    Found by fuzzing.
  • Reading a .wevtcache file trusted each entry's length and allocated that
    many bytes before reading, so a 25-byte crafted file could request ~4 GiB.
    An entry longer than the rest of the file is now rejected with
    EntryLengthTooLarge before anything is allocated (#334).
  • The WEVT manifests in .wevtcache files and DLLs could abort the process the
    same way: a TTBL table, or a CHAN, KEYW, LEVL, OPCO, TASK or EVNT table of
    size 0, reserved room for as many entries as its count claimed, up to
    4 billion, before reading any. Those tables now reserve no more entries than
    the manifest has room for.
  • A BinXML value holding more than one element kept only the first. Windows
    writes such values: in the Shell-Core sample, events 161 and 968 hold their
    event data and then a RenderingInfo element, which evtx dropped. Every
    element now renders, in XML and JSON, as Windows renders them.
  • A BinXML value holding no element rendered as an empty Event element
    ("Event": null in JSON), as in record 17 of the LanguagePackSetup sample. It
    now renders nothing.
  • A corrupt or zeroed record header ended its chunk: the live records after it
    were lost unless --recover-records was set. In every mode, the walk now
    reports the bad header and resyncs on the next record whose ID is in the chunk
    header's range, which brings back 166 records in the samples. With
    --recover-records, every record carved before the free space used to count
    as live. The ones the resync skips, such as records of the log's other pass
    over a chunk, now come out as recovered, and the 23 of them whose templates
    were overwritten are skipped like other carved noise instead of reported as
    errors.
  • A crafted record could make evtx do work exponential in its size: a template
    that uses a value in several places, whose value holds another instance of
    the template, and so on a few levels down. A 600-byte record rendered to
    600 MB of XML, and the records API could take hours to start rendering such a
    record. A template that uses one long value or one long name thousands of
    times, or many instances of such a template, could also render a record to
    gigabytes, and an array of thousands of items deep in a record to hundreds
    of megabytes. A record now fails with an error once its output passes
    16 MiB, whichever API and format renders it, and the records API no longer
    stalls. Records that render the slower way, from their tree, also fail once
    building and walking the tree take more than 2^18 nodes, counting a value's
    nodes once for each place the value is used: elements with thousands of empty
    attributes render nothing, and kept evtx busy for a minute per record. Records
    take that way when their templates don't compile, in JSON with
    --separate-json-attributes, and in the records API with an .MTA file. The
    faster way renders each value once, so its output bounds its work.
  • The slower way built a record's whole tree before it rendered any of it, so a
    crafted record could take gigabytes before a cap stopped it. A 62 KB record
    that places a value of 3,000 elements 8,000 times took 1.7 GB, and a 558-byte
    record with 6 arrays of 16 items in one element, which repeats the element for
    each combination of items, took 20 s and 7 GB. A BinXML value in a template
    can hold instances of other templates, which become part of the template: a
    2 KB record of 25 templates that each hold two instances of the one before
    took 4.8 GB and aborted. Building a record now counts toward its nodes as it
    goes, the templates it instantiates and the instances they hold included, so
    these records fail within 0.03 s and 20 MB. A record's tree takes at most
    about 30 MB, and the samples' records build at most 198 nodes.
  • Records share their chunk's templates, so hundreds of small records in a
    crafted chunk could each render close to 16 MiB, and both the records API and
    evtx_dump hold a chunk's output until its last record: a 68 KB file needed
    9 GB and aborted. A pass over a chunk now renders up to 64 MiB, failed
    records included, and builds and walks up to 2^20 nodes the slower way. Once
    less than one record's worth is left, the chunk's later records fail with an
    error. The samples' chunks render at most 234 KB.
  • A record whose values nest elements more than 512 levels deep overflowed the
    stack and aborted the process. It now fails with an error, unless evtx
    renders it from a compiled template, which doesn't recurse per element and
    renders it in full. A template whose elements nest more than 512 levels deep,
    counting the instances that a BinXML value in it holds, now fails with an
    error whichever way it renders: compiling or instantiating it recurses once
    per level, and an 8 KB record of such a template overflowed the stack in both
    APIs.
  • Crafted templates could make evtx keep hundreds of megabytes of compiled
    templates per chunk for the rest of the parse. Each chunk now compiles at
    most 16 MiB of them and renders the records that would need more the slower
    way, and at most 64 MiB are kept for reuse across chunks.
  • A BinXML value used in two places of its template, at different depths, was
    indented in both as in the last one.
  • In JSON, an element with more than 65,536 children of one name numbered them
    from the start again, repeating keys. Debug builds panicked. Numbering the
    children of an element with thousands of names took time quadratic in their
    number.
  • A chunk that failed a checksum check reported
    ChunkError::InvalidChunkChecksum { expected: 0, found: 0 }, whichever check
    failed. The error now says which: InvalidChunkHeaderChecksum for the
    header's CRC32 and InvalidChunkChecksum for the records', both with the
    stored and computed values, or InvalidFreeSpaceOffset when the header's
    free space offset is outside the chunk, so the records' CRC32 can't be
    computed. Breaking: ChunkError has these two new variants.
  • File and chunk headers dropped the flag bits evtx doesn't define, so the
    post-Security sample's header, whose flags are 0x1b970000, read as having no
    flags. EvtxFileHeader::flags and EvtxChunkHeader::flags now keep every
    bit.
  • ParserSettings equality ignored the WEVT template cache, so settings with
    different caches compared equal. Caches now compare by identity, as .MTA
    files do.
  • evtx_dump built without the multithreading feature warned at every run
    that threads were turned on. It now warns only when -t asks for more than
    one thread.
  • Docs: the --events help said it counts records from the start of the file
    ("offseted reltaive to file"); it filters by event record ID. The README said
    threads could reorder records, but the records come out in the same order
    with any number of threads. EvtxParser::from_buffer's doc said it loads
    from a path.
  • evtx_dump piped into a reader that stops early, such as head, ended with
    Error: Broken pipe (os error 32) and exit status 1, and
    dump-template-instances panicked. They now stop quietly, with status 0.
  • evtx_dump didn't flush its output before exiting, so a failure to write the
    last of it, such as a full disk, was lost and the exit status was 0. It is
    now an error.

Security

  • Refreshed lockfiles to clear Dependabot alerts: crossbeam-epoch 0.9.21
    (RUSTSEC-2026-0204) and anyhow 1.0.104 (RUSTSEC-2026-0190), rkyv 0.8.18 in the
    utf16-simd benches, and zod 4.6.7, vite 8.3.5, vitest 5.0.5 and
    source-map-js 1.2.2 in the web viewer.

What's Changed

Full Changelog: v0.14.0...v0.15.0