The Maven reader decoded every file as strict UTF-8, so an ISO-8859-1 POM
such as Maven's own pom-encoding fixture, or a BOM-marked UTF-16 POM,
failed as "not valid UTF-8". Decode with the shared XML text decoder and
admit ISO-8859-1. A POM that declares an encoding REA does not decode is
now refused as unsupported and names that declaration.
Fixes#15664
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* fix(xml): refuse element depth at the syntax check
saxes keeps one handler per event and walks the open-element stack on
every start tag. checkXmlSyntax now owns opentagstart and closetag, runs
every caller handler after the depth check, and refuses depth above 1024
as xml-element-depth. 1024 stays above the desktop XML view cap and the
plist nesting cap. This release adds no runtime override.
* fix(xml): keep the depth limit when package parsers read XML
XAR TOC, installer XML, Maven POM, and VSIX manifest parsing wrapped
every syntax failure as malformed or a node budget. A depth limit is
returned as the limit failure those callers already accept.
* test(xml): cover element depth past the syntax ceiling
A document one element past 1024 fails the syntax check, including a
XAR TOC that used to parse because a later opentagstart handler replaced
the depth guard. A sibling range after a branch at the ceiling still
matches.
* test(plist): keep nesting refusals inside the XML depth ceiling
Plist fixtures deeper than 1024 now fail at syntax, so the nesting-limit
cases sit on the deepest document the syntax check admits. One plist and
one keyed archive assert the syntax limit past that ceiling.
* fix(xml): type the depth guard as a saxes start tag
opentagstart emits a start tag, not the finished SaxesTagNS. The handler call failed typecheck on that assignment.
* fix(xml): report element depth from the package providers
A VSIX manifest or Maven POM past the syntax ceiling is an XML limit. Those providers only translated their own format, so the refusal became an I/O error.
* fix(xml): report element depth as a fixed allowance
* fix(firmware): report SVD element depth as the XML ceiling
* fix(nuget): preserve XML element depth on package XML
* fix(capture): preserve XML element depth in SAZ metadata
* style(nuget): format the package fixture
* fix(plist): report XML element depth from native inspection
* fix(pkg): carry the XML depth allowance through a deep TOC
* test(plist): narrow the XML depth refusal before projection
The native depth failure is an analysis error. Project it after that check.
inspect-maven-gradle-metadata accepted only the
http://maven.apache.org/POM/4.0.0 namespace, so every Maven 4 POM in the
4.1.0 model namespace was refused as "not a Maven project POM".
Classify a project root in any http://maven.apache.org/POM/ namespace as
a POM, as Maven 4's DefaultModelXmlFactory does, and read the 4.0.0 and
4.1.0 models with the same rules. Other model namespaces are refused
with a specific unsupported_target reason. A 4.1.0 model imports managed
bom-typed rows and carries a limitation that Maven 4 parent and reactor
coordinate inference was not applied.
Co-authored-by: aadheel <250292080+aadheel@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: gensokyo-dev <gensokyo-dev@users.noreply.github.com>
* feat(metadata)!: give NTFS, Maven report and NuGet budgets typed per-call controls
inspect_ntfs_journal refused acquisitions above a fixed 64 MiB allowance;
it now takes max_file_bytes (default 64 MiB) and re-admits a retained
acquisition under the call's budget, so lowering it cannot reuse a larger
cached read. inspect_maven_gradle_metadata refused at six fixed report
allowances; they are now report_limits fields (CLI --report-limits JSON)
with today's values as defaults. Maven max_file_bytes and NuGet
max_file_bytes, max_entries and max_nuspec_bytes refusals now report
details.limit from the same bounds objects the schemas use.
The Ghidra installation-properties read allowance is registered as a
protocol bound: it reads the provider's own short installation
descriptor, not analysis input.
BREAKING CHANGE: NTFS and Maven report refusals report details.limit
instead of a fixed_ceiling refusal, and parseMavenGradleMetadata and the
inspect_ntfs_journal input contract gain the new controls.
* fix(metadata): keep omitted NTFS budgets omitted and type host and maximum recovery
inspect_ntfs_journal recorded the default max_file_bytes as if the caller
had chosen it; the field is now optional and resolved for execution only,
so Evidence keeps omission. A host allocation failure while holding an
admitted acquisition is reported as measured memory exhaustion instead
of generic I/O. A Maven report refusal whose need exceeds the control's
maximum no longer suggests raising it. A public CLI/MCP test covers
report_limits refusal and recovery for a POM.
Read property values through the same Java String.trim semantics as other
POM scalar declarations. Preserve non-ASCII boundary characters and
nonempty Unicode-only properties before transport credential removal.
Exercise compiled CLI, stdio MCP and retained Evidence with property
references, ASCII controls, URL redaction and unchanged artifact bytes.
The .nuspec, its OPC relationships and the Maven POM now parse with
lineEndings normalize, as XML 1.0 section 2.11 and the NuGet and Maven
readers do. Text from CRLF files no longer keeps carriage returns.
Inspect local Maven/Gradle metadata as Evidence with bounded report/XML admission, preserved caller choices and owned cleanup.
Refs #8828; broader comparison and resolution work remains outside this change.
Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>