fix(security): close #140 — migrate constant-only commons-httpclient callers to org.apache.http (SEC-03)#159
Open
NSchatz wants to merge 7 commits into
Conversation
Swap line 75 import from `org.apache.commons.httpclient.HttpStatus` to `org.apache.http.HttpStatus`. Constant names (SC_OK, SC_INTERNAL_SERVER_ERROR) are identical between commons-httpclient 3.x and httpcore 4.4.13; all six callsites (lines 483, 485, 529, 550, 722, 815) remain byte-unchanged. Eliminates exposure to CVE-2012-5783, CVE-2014-3577, CVE-2015-5262 in this caller. WebDAV path (WebDavConnection.java) still uses 3.x at runtime — disclosed in SECURITY.md and tracked in SEC-V2-01. Refs Innovar-Healthcare#140 (SEC-03) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Swap line 43 import from `org.apache.commons.httpclient.HttpStatus` to `org.apache.http.HttpStatus`. Constant names (SC_OK, SC_INTERNAL_SERVER_ERROR, SC_NOT_FOUND) are identical between commons-httpclient 3.x and httpcore 4.4.13; all three callsites (lines 927, 956, 960) remain byte-unchanged. Eliminates exposure to CVE-2012-5783, CVE-2014-3577, CVE-2015-5262 in this caller. WebDAV path (WebDavConnection.java) still uses 3.x at runtime — disclosed in SECURITY.md and tracked in SEC-V2-01. Refs Innovar-Healthcare#140 (SEC-03) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Swap line 20 import from `org.apache.commons.httpclient.HttpStatus` to `org.apache.http.HttpStatus`. Constant names (SC_OK, SC_MOVED_TEMPORARILY) are identical between commons-httpclient 3.x and httpcore 4.4.13; all four callsites (lines 79, 115, 173, 224) remain byte-unchanged. Note: this file already imported `org.apache.http.HttpEntity`, `NameValuePair`, and `StatusLine` on adjacent lines — the `HttpStatus` import was the lone remaining 3.x reference. The file now uses a single coherent httpcomponents 4.x stack. Eliminates exposure to CVE-2012-5783, CVE-2014-3577, CVE-2015-5262 in this caller. WebDAV path (WebDavConnection.java) still uses 3.x at runtime — disclosed in SECURITY.md and tracked in SEC-V2-01. Refs Innovar-Healthcare#140 (SEC-03) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…n.java Add a single-line TODO comment immediately above the `org.apache.commons.httpclient.HttpURL` / `HttpsURL` imports flagging that WebDAV migration to Sardine is deferred to SEC-V2-01 (next milestone). No functional change — imports preserved, runtime behavior unchanged, `commons-httpclient-3.0.1.jar` remains on classpath. Apache Slide WebDAV's `HttpURL` and `HttpsURL` types are runtime classes for which there is no 4.x equivalent without rewriting the connector against a different WebDAV client library. CONTEXT.md locks this deferral. Refs Innovar-Healthcare#140 (SEC-03) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add a single-line TODO comment immediately above the `org.apache.commons.httpclient.Header` / `HttpParser` imports flagging that this caller's migration to `org.apache.http` is deferred to the SEC-V2-01 companion task. No functional change — imports preserved, runtime behavior unchanged. `HttpParser.parseHeaders(InputStream, String)` from commons-httpclient 3.x has no direct equivalent in httpcomponents 4.x; the deferral is a behavior-level API rewrite, not a constant swap. CONTEXT.md locks this deferral. Refs Innovar-Healthcare#140 (SEC-03) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… SECURITY.md Append a new "Known residual dependencies" section to SECURITY.md disclosing that `commons-httpclient-3.0.1.jar` remains on the server classpath for `WebDavConnection.java` runtime resolution (Apache Slide WebDAV). Tracked for removal under SEC-V2-01. This completes the user-visible disclosure pair for Innovar-Healthcare#140: the three constant-only callers (`HttpReceiver`, `MirthWebServer`, `ConnectServiceUtil`) have been migrated to `org.apache.http`; the remaining 3.x exposure is scoped to the WebDAV ingest path, which will be addressed in the SEC-V2-01 follow-up milestone. Closes Innovar-Healthcare#140 (SEC-03) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…d (WR-05) The original disclosure asserted 'No other callers reference 3.x APIs as of Innovar-Healthcare#140 merge,' but the same PR explicitly retained 3.x imports in both WebDavConnection.java (HttpURL / HttpsURL) and HTTPUtil.java (Header / HttpParser) with TODO markers tracking deferral. Replace the single-call-site disclosure with an accurate enumeration of both deferred call sites, the unmigrated CVEs in the retained jar, and the bounded-exposure statement.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #140.
Migrates the three constant-only
commons-httpclient 3.0.1callers to the already-vendoredorg.apache.http(httpcore-4.4.13.jar/httpclient-4.5.13.jar). Per CONTEXT.md,commons-httpclient-3.0.1.jarSTAYS on the classpath becauseWebDavConnection.javastill depends on it at runtime (Apache Slide WebDAV). Full WebDAV migration is deferred to SEC-V2-01.Changes
server/src/com/mirth/connect/connectors/http/HttpReceiver.javaline 75 — import swap. AllHttpStatus.SC_*usage sites (lines 483, 485, 529, 550, 722, 815) byte-unchanged (constant names identical between 3.x and 4.x).server/src/com/mirth/connect/server/MirthWebServer.javaline 43 — import swap. Usage sites (lines 927, 956, 960) byte-unchanged.server/src/com/mirth/connect/client/core/ConnectServiceUtil.javaline 20 — import swap. Usage sites (lines 79, 115, 173, 224) byte-unchanged. (This file already imported otherorg.apache.http.*classes; theHttpStatusimport was the lone remaining 3.x reference.)server/src/com/mirth/connect/connectors/file/filesystems/WebDavConnection.java— inline// TODOcomment referencing SEC-V2-01 (Sardine migration deferred; Apache SlideHttpURL/HttpsURLruntime dependency).server/src/com/mirth/connect/server/userutil/HTTPUtil.java— inline// TODOcomment referencing SEC-V2-01 companion (HttpParser.parseHeaders()rewrite deferred — no direct 4.x equivalent).SECURITY.md— appended a new "Known residual dependencies" section disclosing the residualcommons-httpclient-3.0.1.jaron classpath.Per RESEARCH.md, NO
build.xmlmodification is required: the classpath is a glob<fileset dir="${lib}" includes="**/*.jar" />— the jar stays on disk and resolves transitively.Scope clarifications
HttpReceiver,MirthWebServer,ConnectServiceUtil).WebDavConnection.javaandHTTPUtil.javaintentionally NOT migrated — both require behavior-level API rewrites and are deferred to SEC-V2-01 / SEC-V2-01 companion in the next milestone. Inline// TODOcomments mark the deferral.commons-httpclient-3.0.1.jarretained on classpath atserver/lib/commons/commons-httpclient-3.0.1.jar— required byWebDavConnection.javaat runtime.server/build.xmlnot modified — the classpath is a glob (<fileset dir="${lib}" includes="**/*.jar" />); no individual jar entry exists to annotate. The two inline// TODOcomments serve the discoverability intent.SECURITY.mdunder a new "Known residual dependencies" section.Test plan
grep -n "org.apache.commons.httpclient" <three target files>returns ZERO matches.import org.apache.http.HttpStatus;line.find server/lib -name 'commons-httpclient-3.0.1.jar' | wc -lreturns 1 (jar still on disk for WebDAV).server/libbundlesorg/apache/commons/httpclient/classes.WebDavConnection.java,HTTPUtil.java) still import fromorg.apache.commons.httpclient(intentional — runtime resolution preserved) and now carry an explicit// TODOreferencing SEC-V2-01.ant -f server/build.xml compile— deferred to CI:ant/javanot available in the executor's local environment. Compile validation falls back to GitHub Actions on push.ant -f server/build.xml test -Dtest=DigesterTestand-Dtest=DefaultUserControllerTest— deferred to CI (same reason)..planning/phases/01-security-cluster/01-VALIDATION.md).Residual risk disclosed
commons-httpclient-3.0.1.jarremains on classpath for the WebDAVWebDavConnection.javaruntime dependency. CVE-2012-5783, CVE-2014-3577, and CVE-2015-5262 remain exposed in that code path until SEC-V2-01 lands. The migrated call sites (HttpReceiver,MirthWebServer,ConnectServiceUtil) are no longer exposed.Local test verification (2026-05-13)
Ant 1.10.14 + OpenJDK 17.0.18.
ant -f server/build.xml compile— BUILD SUCCESSFUL (48s)ant -f server/build.xml test-compile— BUILD SUCCESSFUL (20s)java org.junit.runner.JUnitCoreon the four test classes that exercise the migrated files:com.mirth.connect.server.MirthWebServerTestcom.mirth.connect.connectors.http.HttpReceiverTestcom.mirth.connect.connectors.http.HttpListenerRequestHeaderSizeTestcom.mirth.connect.connectors.http.HttpReceiverPropertiesTestResult: 107 of 108 tests pass in 7.7s.
The single failure —
MirthWebServerTest.testContextPathNormalizationHandlesEmpty(expected/, was empty string) — is pre-existing onbridgelink_development: rerunning the same test on trunk (bridgelink_developmentHEADafcfa7160) produces the identical failure. Unrelated to the commons-httpclient import migration.Production-code grep gate:
grep -n "org.apache.commons.httpclient" server/src/com/mirth/connect/connectors/http/HttpReceiver.java server/src/com/mirth/connect/server/MirthWebServer.java server/src/com/mirth/connect/client/core/ConnectServiceUtil.javareturns zero matches. Each target file importsorg.apache.http.HttpStatusexactly once.Deferred files (
WebDavConnection.java,HTTPUtil.java) still resolve theirorg.apache.commons.httpclientimports —commons-httpclient-3.0.1.jarretained atserver/lib/commons/commons-httpclient-3.0.1.jar. Server compiles cleanly with the deferred-file// TODOmarkers in place.