Fix SQLi + XXE CVEs (CVE-2026-82583, -78224, -82578) with regression tests #441
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #441"
general
weight: 0.35
pacmano1
Summary
Fixes three publicly-disclosed vulnerabilities (advisory) present in this tree (4.6.0 is below every upstream fix version). Each fix uses an idiom already established in this codebase; the branch is one commit per CVE (fix + its tests together).
| CVE | Component | Fix |
| --- | --- | --- |
| CVE-2026-82583 (SQLi, CWE-89) |
DatabaseConnectorServlet| Ignore callerselectLimit; resolve the probe template server-side from the built-in driver list; escape identifiers || CVE-2026-78224 (XSLT XXE, CWE-611) |
XsltStep| Deny external DTDs in the source XML; restrict stylesheet references to thefileprotocol (fail-closed) || CVE-2026-82578 (XML batch XXE, CWE-611) |
XMLBatchAdaptor| Parse with a hardened, namespace-awareDocumentBuilderFactory, then evaluate XPath |The fixes
CVE-2026-82583 — SQL injection
DatabaseConnectorServlet.getTablesexecuted the caller-suppliedselectLimitquery parameter as SQL viaStatement.executeQuery.selectLimitis only ever a driver-specific metadata-probe template (the metadata dialog sends the driver's own value), so it is now ignored and resolved server-side from the built-inDriverInfolist keyed by the JDBC driver class; anything unrecognised uses the safeDatabaseMetaData.getColumns()path.Resolving only from
DriverInfo.getDefaultDrivers()— never the API-writable configured driver list — closes the injection regardless of the deployment's authorization model.resolveSelectLimitisstaticand unit-tested with no database or live server.The probe query also embeds the schema/table identifier. Those names come from database metadata but may themselves contain a
", which would break out of the quoting (a second-order injection);quoteSchemaTablenow doubles any embedded quote per the SQL standard. The genericgetColumns()paths are scoped to the connecting user's discovered schema so a same-named table in another schema cannot leak its columns.Deliberately out of scope (follow-ups): the endpoint's
@MirthOperationhas nopermissionandauditable = false, anddriver/urlare unconstrained. The same gap exists on every other connector test servlet (file/tcp/http/smtp/ws/jms) and is better handled as its own change.CVE-2026-78224 — XSLT step XXE
XsltStepbuilds aTransformerFactoryinside generated JavaScript, so it was never reached by the Java-side XML hardening elsewhere in the tree. The source XML is attacker-controlled, so the generated script setsACCESS_EXTERNAL_DTD=""on both the normal and iterator paths — denying external DTDs/entities in it, which is what closes the CVE. The stylesheet is channel-author content, so following the OWASP XXE cheat sheet ("restrict rather than close" external references in your own stylesheets),ACCESS_EXTERNAL_STYLESHEETis restricted to thefileprotocol rather than blocked: localxsl:import/xsl:include/document()keep working whilehttp(s)SSRF is denied. Neither is swallowed: a factory that rejects the attribute fails the transform rather than running with external access silently open.FEATURE_SECURE_PROCESSINGis deliberately not enabled: on the JDK's built-in Xalan it also disables Java XSLT extension functions, which would break existing stylesheets that call Java._Note: the stylesheet is loaded from a
StringReaderwith no base URI, so relativehrefs may not resolve regardless; thefilefilter mainly governs absolutefile:///…references._CVE-2026-82578 — XML batch adaptor XXE
XMLBatchAdaptorevaluated XPath directly over anInputSource, letting the XPath engine build its own DOCTYPE-resolving parser. It now parses withDocumentSerializer.getSecureDocumentBuilderFactory()(disallow-doctype-decl, external entities/DTD off, no entity expansion) and evaluates against the parsedDocument.namespaceAwareis set true to preserve the prior path's namespace-aware parsing (namespace-uri()/prefix-sensitive split queries). The hardened parse is factored into astatic parseBatchSecurelyhelper.Tests
DatabaseConnectorServletTest(server unit test) —resolveSelectLimitreturns the built-in template per driver and""for unknown/injected drivers (proof the caller value never reachesexecuteQuery);quoteSchemaTabledoubles embedded quotes (second-order-injection payload stays a single quoted identifier).XsltStepSecurityTest(server unit test) — the generated script denies external DTD access ('') and restricts stylesheet access to'file'on both paths, does not emitFEATURE_SECURE_PROCESSING, and is not wrapped in a swallowingcatch.ci/tests/200-xslt-step-xxe(fixture) — an external-entity message →ERROR; a well-formed control →TRANSFORMED.XMLBatchAdaptorSecurityTest(server unit test) — external- and internal-entity DOCTYPEs are rejected with a specific DOCTYPE oracle (not catch-all); a benign namespaced batch still parses and anamespace-uri()predicate matches.XmlBatchXxeTest(smoketest) — deploys a batch-splitting channel and pairs the malicious batch with a benign control that must split, so the "marker not expanded" assertion cannot pass on an unrelated failure.Behavior changes
disallow-doctype-declrejects all DOCTYPEs — batches with an internal-subset DTD that previously parsed now error.getColumns()path (correct, possibly slower), now scoped to the connecting user's schema when one is discovered; identifiers are escaped.fileprotocol (OWASP "restrict rather than close"), so localxsl:import/xsl:include/document()still work buthttp(s)stylesheet fetches are denied.FEATURE_SECURE_PROCESSINGis intentionally not enabled, so Java XSLT extension functions keep working.Verification
./gradlew :server:test—DatabaseConnectorServletTest,XsltStepSecurityTest,XMLBatchAdaptorSecurityTestpass; existingdatatypes.xml,DocumentSerializer, andjdbctests still pass.ci/runtests.sh alpine-temurin21-derby— the XSLT fixture (maliciousERROR/ benignTRANSFORMED) and the hardenedXmlBatchXxeTestrun in every configuration; nooie.db.*or--add-opensneeded.🤖 Generated with Claude Code