Changes for version 2.61 - 2026-11-29

  • Fixes:
    • PR #307 Don't load encoding maps from the current working directory. The encoding name in an XML declaration is attacker-controlled; removing curdir from @Encoding_Path and closing the bare-name fallback in load_encoding() prevents directory-planted .enc files from being loaded
    • PR #295 GH #277 Fix OOB heap read in convert_to_unicode via crafted encoding map. Bounds-check the prefix index from the bytemap before indexing enc->prefixes[]; also validate at load time that every bytemap entry marked as a prefix index is less than pfxsize
    • PR #291 GH #281 Add MaxEntitySize option (default 10 MB) to limit LWP external entity fetches and prevent unbounded memory consumption
    • PR #303 GH #299 Find MSVC-built libexpat.lib during expat detection on Windows; fall back to probing 'libexpat' on MSWin32 and propagate the name to Expat/Makefile.PL
    • PR #292 GH #280 Use xml_escape() in Stream.pm Start handler instead of manual regex substitutions to escape attribute values
    • PR #290 GH #282 Prevent RETVAL SV leak in XML_LoadEncoding when croak fires; mortalize RETVAL immediately after creation and remove dead NULL checks after Newx calls
    • PR #287 Fix escaping of CR/LF/TAB in Stream style attribute value serialization so round-trip parsing cannot silently corrupt whitespace
    • PR #271 Validate PrefixMap bmap_start bounds in XML_LoadEncoding; reject the encoding file if bmap_start + len exceeds bmsize
    • PR #270 Return undef from ErrorString for unknown error codes instead of passing NULL to newSVpv(), which is undefined behavior
  • Improvements:
    • PR #293 GH #279 Extract _expat_options() as a shared private method to eliminate duplication between parse() and parse_start()
  • Maintenance:
    • PR #305 Update CI actions: actions/checkout v7, codecov-action v7, perl-actions/perl-versions v2.0; fix node24 deprecation warnings
    • PR #304 GH #300 Pin test coverage for predefined entity redefinition behavior (expat ignores non-conforming declarations for amp, apos, gt, lt, quot per backwards-compat decision)
    • PR #301 GH #275 Document external entity risks for untrusted XML and show how to block or ignore external entities with a custom ExternEnt handler
    • PR #302 Clarify that MaxEntitySize also applies to local file entities (not just HTTP responses); document per-entity semantics
    • PR #306 Fix unresolved setHandlers link in Parser.pm POD
    • PR #286 Simplify xml_escape() regex escaping with quotemeta
    • PR #288 Consolidate CallbackVector cleanup into free_cbv() to eliminate duplicated inline cleanup in XML_ParserFree
    • PR #283 Enable use warnings in Expat.pm and LWPExternEnt.pl
    • PR #273 Add Codecov coverage thresholds (70% project, 70% patch) and PR comment layout to codecov.yml
    • Clean up MANIFEST.SKIP to use #!include_default and exclude .claude/ files

Modules

Lowlevel access to James Clark's expat XML parser
A perl module for parsing XML documents
Debug style for XML::Parser
Objects styler parser
Stream style for XML::Parser
glue for handling element callbacks
Tree style parser