Skip to content

Releases

MockServer 9.4.0

Choose a tag to compare

@jamesdbloom jamesdbloom released this 20 Nov 09:44

[9.4.0] - 2026-11-20

Security

  • Every Docker image now runs a Java runtime with the fix for CVE-2026-114938, a memory-corruption bug in how JDK 17.0.6 and later, 21, 25, 26 and 27 decode Base64 on x86-64 processors with AVX-512. MockServer decodes Base64 sent by clients, such as an expectation's base64Bytes and gRPC-Web text bodies, before checking any credentials. On x86-64 the standard, -aot, -graaljs, -http3, snapshot and root images and the mockserver-webhook image run Eclipse Temurin 27.0.1.1, and the -clustered image runs Temurin 21.0.13.1; the ARM64 images, which the bug does not affect, run the newest Temurin ARM64 build (27.0.1.0.2, and 21.0.13 for -clustered). The images therefore do not set the -XX:-UseBASE64Intrinsics workaround. The binary bundle, which still carries its own Temurin 21 runtime, starts Java with -XX:-UseBASE64Intrinsics after MOCKSERVER_JAVA_OPTS in bin/mockserver and bin/mockserver.bat, and mockserver-node and the VS Code extension, which start the bundled Java themselves, put it in the same place. The Maven plugin's runForked goal and mockserver-node running the jar on your own Java pass it too, before your JVM options. The option switches off the optimised Base64 encoder and decoder, and results are unchanged. Security researchers recommend it and the JDK vendors have not yet confirmed it, and remote code execution has not been demonstrated. If you run MockServer on your own Java (the executable JAR, the WAR, the Maven plugin, JUnit, Spring or the Java API), update to a fixed JDK (Oracle or Eclipse Temurin 17.0.21.1, 21.0.13.1, 25.0.5.1 or 27.0.1.1, Amazon Corretto 17.0.21.1.2, or a fixed Azul build) or add the option yourself; see the security notice
  • customJsonUnitMatchersClass can only be set at startup (BREAKING for anyone who changes customJsonUnitMatchersClass with PUT /mockserver/configuration or a client's updateConfiguration; see upgrading to 9). This setting names the class MockServer loads and creates to supply custom json-unit matchers, but a PUT /mockserver/configuration could change it on a running server, and MockServer created the named class before checking that it implements CustomJsonUnitMatcherProvider. So anyone who could reach the control plane could make MockServer run the static initialiser and no-argument constructor of almost any class on its classpath. A PUT that sets a different value is now still answered, but the value is ignored, a warning is logged and GET /mockserver/configuration reports the value in force; a PUT that sends the value already in force logs nothing. Set it before the server starts with a system property, environment variable, mockserver.properties or Configuration. MockServer also now ignores, with the same warning as before, a named class that does not implement CustomJsonUnitMatcherProvider without running any of its code.
  • Agent skills: dockerhub-credentials no longer asks for the Docker Hub token in the chat or puts it on a command line; you now enter it at a hidden prompt in your own terminal, and it reaches AWS Secrets Manager through a private temporary file (#3027). pr-monitor now only reports when asked to monitor or watch PRs, and merges only when asked to merge (its script needs --merge), holds merges while a release is in progress, and no longer hides its status report (#3028)

Added

Changed

  • Every Docker image except -clustered now runs Java 27: Eclipse Temurin from a checksum-pinned Adoptium download, trimmed with jlink and copied onto gcr.io/distroless/java-base-debian13. The standard and -aot images move from Java 26 and 25. The root, snapshot, -graaljs and mockserver-webhook images used the distroless Java 25 image and keep its Java modules except four that the Temurin 27 JDK no longer ships: jdk.graal.compiler, jdk.graal.compiler.management, jdk.internal.vm.ci and jdk.jsobject. The -clustered image moves from the distroless Java 21 image to a jlink-trimmed Temurin 21, because its Infinispan library cannot start on Java 24 or later, and drops jdk.internal.vm.ci, jdk.internal.vm.compiler, jdk.internal.vm.compiler.management and jdk.jsobject. Every image uses the base image's Debian trust store (/etc/ssl/certs/java/cacerts), as the distroless Java images did, so a trust store mounted there is used. The library is still compiled for Java 17. Start-up figures for the new runtime have not been re-measured yet.
  • -XX:+ZGenerational now stops the Java 27 images from starting (BREAKING for anyone who still passes it in JAVA_TOOL_OPTIONS or the Helm chart's app.jvmOptions to any image except -clustered): Java 27 no longer recognises it and exits with Unrecognized VM option 'ZGenerational', where Java 25 and 26 ignored it with a warning. Drop it; -XX:+UseZGC alone already gives generational ZGC. The -clustered image, still on Java 21, keeps -XX:+UseZGC -XX:+ZGenerational.
  • Every image's Java is now at /usr/lib/jvm/temurin-trimmed/bin/java, and on the PATH. The root, snapshot, -graaljs, -clustered and mockserver-webhook images keep /usr/bin/java as a link to it, but their arch-specific Java home (such as /usr/lib/jvm/temurin-25-jre-amd64) and the JAVA_VERSION environment variable are gone: use java on the PATH or the new path. The standard and -aot images used /usr/lib/jvm/temurin25-trimmed/bin/java, which still works as a link to the new path, so an entrypoint override copied from an older image keeps starting; switch it to the new path.
  • The -sources.jar of each -no-dependencies artifact on Maven Central (mockserver-netty-no-dependencies, mockserver-client-java-no-dependencies, mockserver-junit-jupiter-no-dependencies, mockserver-junit-rule-no-dependencies and mockserver-spring-test-listener-no-dependencies) now holds only MockServer's own sources, so it is a few MB instead of 34 to 51 MB. It used to also hold the sources of every library those jars bundle. To read a bundled library's sources, use that library's own -sources.jar. The library is renamed under shaded_package in the jar, but its sources keep the original package names.
  • mockserver-junit-jupiter-no-dependencies, mockserver-junit-rule-no-dependencies and mockserver-spring-test-listener-no-dependencies keep their names but no longer each carry a full copy of the MockServer server (about 87 MB each). Each jar now holds only its own classes and brings in mockserver-netty-no-dependencies as a dependency, which Maven and Gradle download for you, so build files need no change; if you also listed mockserver-netty-no-dependencies, you no longer get two copies of every MockServer class. Three things now match mockserver-netty-no-dependencies: HTTPS uses Java's built-in TLS instead of bundled OpenSSL libraries; a module-info.java that uses ClientAndServer or MockServerClient also needs requires org.mockserver.netty;; and a project with no SLF4J provider now gets MockServer's log output through java.util.logging. See Upgrading to 9.0.0.
  • The CycloneDX software bill of materials on Maven Central is now one file covering every released module and its dependencies, at org/mock-server/mockserver/<version>/mockserver-<version>-cyclonedx.json (for example https://repo1.maven.org/maven2/org/mock-server/mockserver/<version>/mockserver-<version>-cyclonedx.json). This applies from the release after 9.3.0. 9.3.0 published a separate <artifactId>-<version>-cyclonedx.json next to each module, and its mockserver-9.3.0-cyclonedx.json covers only the parent POM. From the next release, fetch the single file instead. The single file covers the Maven plugin too.

Fixed

  • maxLoggedMatchFailures now also limits requests served by a forward expectation. After the upstream answered, mock drift detection (on by default) checked the request against every expectation again and logged a "didn't match expectation" line for each one, with no limit and no "further did-not-match entries were not logged" summary, so one forwarded request could log a line per configured expectation, including a second "matched expectation" line. That check no longer logs match results; the request's own matching still logs them, within the limit. gRPC bidirectional-streaming requests, whose routing check logged every expectation it tried before the request's own matching logged them again, no longer log them twice either. PUT /mockserver/pact/verify no longer writes a per-expectation match entry for each interaction either; its result reports the outcome (#3020)
  • maxLoggedMatchFailures now also limits the "didn't match expectation" lines logged when MockServer checks an HTTP/1.1 request against respondBeforeBody expectations before its body arrives. That check logged a line for every respondBeforeBody expectation it tried, with no limit, and when none of them answered the request, the request's normal matching then logged them again. A request answered by a respondBeforeBody expectation now logs the expectations it was checked against within the limit, then the "matched expectation" line; any other request is logged once, by its normal matching (#3020)
  • (Release) The release preflight now checks the NuGet API key live on nuget.org instead of only checking that the secret exists. It flags a key that has expired or been revoked, or that cannot push MockServerClient or MockServer.Testcontainers. nuget.org now limits API keys to 30 days, and an expired key failed both NuGet publish jobs in...
Read more

MockServer 9.3.0

Choose a tag to compare

@jamesdbloom jamesdbloom released this 15 Nov 21:33

[9.3.0] - 2026-11-15

Security

  • Release image and Helm chart signing can no longer be skipped. A release used to publish Docker images and the Helm chart unsigned, without failing, when it could not find the cosign signing key (this is how the 8.0.0 images and chart shipped unsigned). The release now checks the key before it publishes anything and stops if the key is missing or unusable. The mockserver/mockserver-webhook image on ECR Public is now signed too
  • (Release) Every toolchain image the release runs in is now pinned by digest, not only by tag, so re-pushing a tag cannot change what a release runs. This includes the community alpine/helm and maniator/gh images, which receive the signing key and the GitHub token. The pins live in scripts/release/images/Dockerfile, which Dependabot keeps current in one PR that is never merged automatically and only refreshes digests or moves to a patch release on the same line. The VS Code extension is now packaged and published with the @vscode/vsce and ovsx versions locked in its package-lock.json, instead of the latest versions installed globally in the container that holds the marketplace tokens, and the PyPI packages are built and uploaded with build, twine and setuptools installed from a hash-pinned requirements file (scripts/release/requirements-publish.txt) rather than the latest versions. The npm release of mockserver-node and mockserver-client-node now installs from their committed lockfiles (npm ci), updating only the entries the release itself changes, instead of deleting the lockfile, resolving every dependency afresh and running npm audit fix before publishing. The .NET client and Testcontainers packages are now restored in locked mode from committed NuGet lock files (packages.lock.json)
  • With proxyAuthenticationUsername and proxyAuthenticationPassword set, a client could use MockServer as a proxy without credentials by opening its connection the way MockServer's own CONNECT and SOCKS tunnels open theirs internally. MockServer now accepts that opening only on its own internal tunnel connections. The forward allow, deny and private-network rules were not affected, and CONNECT, SOCKS and plain proxy requests sent with credentials work as before. Present since 5.11.0 (fixes GHSA-36c2-h3v8-7w6w)
  • With proxyAuthenticationUsername and proxyAuthenticationPassword set, SOCKS5 clients could proxy without credentials by offering "no authentication", SOCKS4 clients were never asked for credentials, and HTTP/3 CONNECT-UDP tunnels were opened without checking the Proxy-Authorization header. SOCKS5 now selects username/password authentication whenever the client offers it and refuses a client that does not (replying 0xFF and closing the connection), SOCKS4 is refused (it cannot carry a password) with a warning in the log, and HTTP/3 CONNECT-UDP now requires the proxy credentials, answering 407 without them. Without proxy credentials configured, SOCKS4, SOCKS5 and CONNECT-UDP behave as before, except that a SOCKS5 0xFF refusal now also closes the connection. With transparentProxyEnabled also set, MockServer now logs a warning at startup that connections handled as transparent proxying, including those whose destination comes from the Host header or a PROXY protocol header, are not asked for proxy credentials (fixes GHSA-36c2-h3v8-7w6w)
  • With proxyAuthenticationUsername and proxyAuthenticationPassword set, a plain HTTP proxy request for another host (a request line holding a full URL, such as GET http://example.com/path) without the credentials was still answered by a matching expectation, and was asked for them only when nothing matched; a WebSocket upgrade for another host was relayed to it without them; and the proxy WAR (mockserver-proxy-war) never asked for them. Such a request to the standalone server now gets 407 before it is matched against any expectation, a WebSocket upgrade for another host is relayed only with the credentials, and the proxy WAR asks for them before matching a request whose Host names another host. A request sent to MockServer directly (a request line holding only a path, as every HTTP/2 and HTTP/3 request is) is still matched without proxy credentials whatever its Host header says, and needs them only when MockServer would forward it; requests for MockServer's own address never need them. A request refused this way is logged as a failed proxy authentication, as a refused CONNECT is, not as a received request, so it does not count in verify or retrieveRecordedRequests. The WAR (mockserver-war) cannot see whether a request line held a full URL, so there every request is handled like one sent to MockServer directly. Without proxy credentials configured nothing changes
  • Build-time dependency fixes, none shipped in a published package: the Maven plugin's integration-test projects now pin Guava 33.8.0-jre, the version the main build uses (GHSA-xxph-c9ww-hj94 was fixed in 33.7.2), the VS Code extension's development lockfile resolves qs 6.16.1 (GHSA-6pq8-jhm2-2vcw; it reaches the build only through @vscode/vsce → typed-rest-client), and the Rust client's lockfile resolves rustls 0.23.46 (GHSA-vp88-798v-h67f, GHSA-w44r-93j7-qv28, GHSA-c8m5-c952-6cm4, GHSA-h2v8-394m-p7vv; the client uses native TLS, so rustls is listed in its lockfile but not compiled into it). The development lockfiles of the Node client, mockserver-node, the dashboard UI and the VS Code extension now resolve minimatch 11.0.3 (GHSA-g3hv-75wg-m249) for every copy that contains the affected code: under c8 → test-exclude in the Node client, through mockserver-node's glob development dependency (now 14.0.3), for eslint and its plugins in the dashboard UI and under @vscode/vsce in the VS Code extension. All but mockserver-node use npm overrides, because no release of those tools accepts minimatch 11 yet. The minimatch 3.x copies that grunt and jshint still pull in do not contain the affected code. The development lockfiles of the Node client and mockserver-node now also resolve lodash 4.18.1 for the copy under jshint (GHSA-f23m-r3pf-42rh), through an npm overrides entry because jshint accepts only lodash 4.17.x; jshint does not call the affected _.unset, _.omit or _.pullAt
  • The standard image (mockserver/mockserver, built from docker/local), the -aot image and the reference docker/Dockerfile image now run on gcr.io/distroless/java-base-debian13:nonroot instead of java-base-debian12. Distroless stopped building java-base-debian12 in February 2026 (GoogleContainerTools/distroless#2023), so its pinned digest could no longer pick up Debian security fixes; the new base ships libbrotli1 1.1.0-2+deb13u1, fixing CVE-2026-111497 (DSA-6582-1), and is the same Debian release as the other image variants (#2927)
  • The Node Testcontainers module's lockfile now resolves glob 14.0.3 and minimatch 11.0.3 under archiver, a runtime dependency of the published @mockserver/testcontainers package (GHSA-3g3m-2fjr-6pw4, GHSA-g3hv-75wg-m249). The fix uses npm overrides, which npm does not apply when another project installs the package, so a project that depends on @mockserver/testcontainers resolves these from its own lockfile until archiver moves to the patched releases; it can add the same overrides itself. The module does not reach the affected code: archiver copies a directory without a glob pattern, and the affected glob copy is used only by an archiver-utils helper that archiver does not call
  • The forward-target checks (forwardProxyBlockPrivateNetworks, forwardProxyAllowedHosts, forwardProxyDeniedHosts) could be sidestepped by a destination an upstream proxy reads differently from MockServer. Through forwardHttpProxy the proxy's request line was built from the raw Host header and path, so a Host such as 8.8.8.8:80@169.254.169.254 or allowed?.example.com, a second Host header, or a path not starting with / could send the proxy to a host that was never checked. A plain HTTP request sent through forwardHttpProxy now needs exactly one Host header (without one, the client address is used) that is a host name, IPv4 address or bracketed IPv6 address with an optional port, and is otherwise refused with 502 Bad Gateway even when no check is set; its path always starts with /, spaces and control characters in it, Unicode ones included, are percent-encoded except CR and LF, which are still refused, and OPTIONS * is sent as OPTIONS http://<host>/ rather than with * appended to the host. Through forwardHttpsProxy or forwardSocksProxy, a request whose tunnel destination is not a host of that form is refused before connecting, and so is a binary (non-HTTP) connection tunnelled through any of the three upstream proxies, whose destination previously reached the proxy as given (a forwardProxyAllowedHosts entry *.allowed.com let secret.internal.example/.allowed.com through). A PROXY protocol v1 header whose destination is not an IP address of the family it declares (TCP4 or TCP6), such as a host name, is now ignored as malformed, as the PROXY protocol requires. Where a check is set, a numeric IPv4 host that is not four decimal octets without leading zeros (0177.0.0.1, 0x7f.1, 2130706433), which resolvers may read as another address, is refused, as is a forwarded request whose destination host or port cannot be read, and an IPv6 address whose dotted IPv4 part has a leading zero ([::ffff:017.0.0.1]) is refused too. forwardProxyBlockPrivateNetworks and address entries in forwardProxyAllowedHosts / forwardProxyDeniedHosts now check the IPv4 address inside an IPv4-compa...
Read more

MockServer 9.2.0

Choose a tag to compare

@jamesdbloom jamesdbloom released this 27 Oct 00:11

[9.2.0] - 2026-10-26

Security

  • In the mockserver-netty-no-dependencies jar and the Docker images, the bundled Kafka client used for AsyncAPI mocking now refuses the JndiLoginModule and LdapLoginModule JAAS login modules in a saslJaasConfig, as Kafka does by default since CVE-2023-25194. The jar renames the libraries it bundles, and the renaming changed the module names Kafka checks against, so the check never matched (#2869)
  • With dataPlaneAuthenticationRequired on, a mocked endpoint could still be reached without credentials in several ways. A path that only starts with /mockserver (such as /mockserverfoo), or a /mockserver/... path that the server does not handle (such as /mockserver/nope, or /mockserver/status and /ready over HTTP/3), skipped the check and was answered by any matching expectation, a catch-all one included. Over HTTP/1.1, an expectation with respondBeforeBody answered the first request on a connection without checking credentials. And a gRPC bidirectional-streaming expectation (respondWithGrpcBidi) answered over HTTP/2 or HTTP/3 without checking them. gRPC server reflection also answered without credentials, listing the loaded services and message types, and so did a gRPC chaos fault and the UNIMPLEMENTED answer for an unknown gRPC method, which told the caller which methods exist. All of these are now refused (401, or gRPC status UNAUTHENTICATED) like any other mocked endpoint. A refused request does not use up the expectation's Times, move its scenario on or count towards a gRPC chaos profile. The control plane, the readiness and liveness probes (the gRPC health check included), and CORS preflights for the control plane still work without data-plane credentials. Data-plane authentication does not apply to DNS mocking
  • dataPlaneAuthenticationRequired now applies to the WAR deployments (mockserver-war, mockserver-proxy-war) and to InProcessMockServer, which served their mocks without credentials whatever it said. Credentials are checked before a request can match an expectation, so a refused request uses up no Times and moves no scenario, and a CORS preflight for a control-plane route stays open, as on the standalone server. An in-process request carries its credentials in its headers. In a WAR, tlsMutualAuthenticationRequired is now enforced too: a mocked request over plain HTTP gets 426 Upgrade Required, and one over HTTPS without a client certificate verified by the servlet container gets 401; the container's trust store decides which certificates are accepted (see upgrading to 9).
  • The Kafka SASL JAAS configuration for AsyncAPI broker mocking can now only be set at startup, with the new asyncKafkaSaslJaasConfig property (-Dmockserver.asyncKafkaSaslJaasConfig or MOCKSERVER_ASYNC_KAFKA_SASL_JAAS_CONFIG). A JAAS configuration names the Java login class the Kafka client loads, and PUT /mockserver/asyncapi let any control-plane caller choose it through brokerConfig.kafkaSecurity.saslJaasConfig. That request is now rejected with a 400 that names the startup property, and so is any other field in kafkaSecurity that MockServer does not know, so no Kafka client setting that loads a class can be passed in; saslMechanism and securityProtocol must be one of Kafka's own values. A request that selects SASL_PLAINTEXT or SASL_SSL uses the startup JAAS configuration (or the JVM's own JAAS file). Because every SASL login is now held by the server, such a request may only use the startup asyncKafkaBootstrapServers: it must omit kafkaBootstrapServers or name the same brokers, or it gets a 400 and no credential is sent, and it gets a 400 while no startup bootstrap servers are set. asyncKafkaBootstrapServers can now only be set at startup: PUT /mockserver/configuration ignores it and logs a warning. PUT /mockserver/configuration ignores asyncKafkaSaslJaasConfig and logs a warning, and GET /mockserver/configuration never returns it. To upgrade, move the saslJaasConfig value from your requests to asyncKafkaSaslJaasConfig, set asyncKafkaBootstrapServers at startup to the brokers it logs in to, and keep securityProtocol and saslMechanism in the request (see upgrading to 9)
  • retrieve with forwardUnmatchedTo now needs a control-plane role that may change state. The parameter repoints where unmatched requests are forwarded, but control-plane authorization treated the call as a read, so with controlPlaneAuthorizationEnabled a principal with only the READ role could redirect unmatched traffic. Such a principal now gets 403, as it already did for extractBodiesLargerThan; a retrieve without either parameter is still a read (see upgrading to 9)
  • Upgraded DOMPurify (dashboard UI dependency) to 3.4.17 to fix GHSA-cg2g-xh64-v4q7
  • Build-time dependency fixes, none shipped in a published package: the Node Testcontainers module's own development lockfile resolves undici 7.30.1 (Dependabot alerts 610, 611, 612; the published package ships only dist), and the VS Code extension's development dependency @vscode/vsce now resolves @azure/msal-node 7.1 through an npm overrides entry (alert 613; it reaches the build only through @vscode/vsce → @azure/identity, which has no release that allows msal-node 7 yet)
  • The paths MockServer writes files to, and the protoc executable it runs, can now only be set at startup: auditLogFile, persistedExpectationsPath, persistedRecordedExpectationsPath, persistedRecordedRequestsPath, memoryUsageCsvDirectory and directoryToSaveDynamicSSLCertificate, like recordedBodyFilesDirectory. Before, PUT /mockserver/configuration (or a client's updateConfiguration) could change them on a running server, so anyone who could reach the control plane could redirect the audit log (before its first write) or the generated certificates and their private keys into another directory, such as one on the extension classpath, or point a format=recording disk import (which reads persistedRecordedRequestsPath) at another file. grpcProtocPath, which names the protoc executable MockServer runs, is now startup-only for the same reason. A PUT that sets a different value is still answered, but the value is ignored and a warning is logged; a PUT that sends the value already in force logs nothing. Set them with a system property, environment variable, properties file or Configuration instead (see upgrading to 9)
  • The settings that decide who may use the control plane, what each user may do, whether control-plane changes are audited, and where dashboard usage events go can now only be set at startup: controlPlaneTLSMutualAuthenticationRequired, controlPlaneTLSMutualAuthenticationCAChain, the controlPlaneJWTAuthentication* and controlPlaneOidc* settings, controlPlaneAuthorizationEnabled, controlPlaneScopeMapping, controlPlaneAuditEnabled and dashboardAnalyticsEndpoint, like the controlPlaneBasicAuthentication* settings. Before, anyone allowed to change the configuration with PUT /mockserver/configuration could switch control-plane authentication off, trust their own keys or identity provider, give themselves a role, switch auditing off before making changes, or send every dashboard viewer's usage events to their own server. A PUT that sets a different value is still answered, but the value is ignored and a warning is logged, and GET /mockserver/configuration reports the value in force; the dashboard's Audit Trail view no longer has an on/off switch (see upgrading to 9)
  • A PUT /mockserver/configuration that changes where the default LLM backend sends requests (llmBaseUrl, or llmProvider while llmBaseUrl is empty) without also supplying llmApiKey now clears the held key and logs a warning, so the key is never sent to the new endpoint. Before, anyone allowed to change the configuration could collect the key by pointing llmBaseUrl at their own server. A PUT that supplies both applies both; a JSON llmBackendsConfig value that changes a backend's baseUrl or provider while leaving its key masked is not applied (see upgrading to 9)
  • A held secret is no longer sent to a destination that a control-plane caller can choose. clusterVerifyFanInPeers and clusterFanInPeerAuthToken can now only be set at startup: PUT /mockserver/configuration could repoint the fan-in peers at any host, and every verify or retrieve then sent it the cluster peer token, which grants write access to every node. A PUT that supplies a different value is ignored and logs a warning. The detect_llm_drift MCP tool, which a read-only caller may use, now refuses a cassette whose provider is not the configured LLM backend's provider and sends nothing; before, it replayed the cassette with that provider's client, which, when no llmBaseUrl was set, sent the held llmApiKey to that provider's default host. An AZURE_OPENAI backend with no llmBaseUrl now sends nothing, instead of sending its key to the placeholder host example-resource.openai.azure.com. See upgrading to 9.
  • noProxyHosts can now only be set at startup, like the upstream proxies it applies to (forwardHttpProxy, forwardHttpsProxy, forwardSocksProxy). Before, anyone allowed to change the co...
Read more

MockServer 9.1.0

Choose a tag to compare

@jamesdbloom jamesdbloom released this 21 Oct 11:40

[9.1.0] - 2026-10-21

Security

  • Control-plane mTLS could be bypassed by sending the CA certificate after an untrusted client certificate. With controlPlaneTLSMutualAuthenticationRequired on, MockServer 5.13.0 to 9.0.0 accepted a control-plane request if any certificate the client sent could be validated against controlPlaneTLSMutualAuthenticationCAChain. A CA certificate is public, so anyone who could reach the control plane could send their own certificate followed by your CA certificate and create, read or delete expectations, change the configuration or reset the server, without the CA's private key. Also requiring data-plane mTLS (tlsMutualAuthenticationRequired) did not prevent this in the default set-up: the data-plane check also trusts MockServer's own CA, which by default is the CA bundled with MockServer, and its private key is published in the jar, so an attacker could sign their certificate with it. Data-plane mTLS prevented it only if MockServer had its own CA (certificateAuthorityCertificate and certificateAuthorityPrivateKey, or dynamicallyCreateCertificateAuthorityCertificate) and every CA in tlsMutualAuthenticationCertificateChain was private. MockServer now checks only the client's own certificate (the one whose private key it used for the connection): it must be signed by a CA in the chain, directly or through intermediate CA certificates the client sends after it, be in date, allow digital signatures if it lists key usages, allow client authentication if it lists extended key usages, and not be a CA certificate, a self-signed certificate or one of the certificates in the chain. A self-signed client certificate listed in controlPlaneTLSMutualAuthenticationCAChain is no longer accepted; sign client certificates with a CA instead. A controlPlaneTLSMutualAuthenticationCAChain that contains the bundled CA (or any certificate for its key) is now refused: MockServer does not start, PUT /mockserver/configuration answers 400, and any other change makes every control-plane request fail, where before only a warning was logged. If MockServerClient and MockServer share that property in one JVM (for example ClientAndServer or the JUnit rule) and you added the bundled CA so the client trusts MockServer's certificate, give MockServer its own CA with certificateAuthorityCertificate and certificateAuthorityPrivateKey and put that CA in the chain instead. The control-plane audit log now records the validated client certificate's subject as a verified principal (verified-mtls) unless OIDC supplied one; with mTLS and JWT both on, the audit principal is now the certificate subject instead of the unverified JWT sub. If a MockServer reachable by others had control-plane mTLS on, with or without data-plane mTLS, treat its expectations, recorded traffic and settings as possibly read or changed by someone else (fixes GHSA-52vf-hgvq-8pr3)
  • mTLS (tlsMutualAuthenticationRequired) no longer accepts client certificates anyone can create (BREAKING for mTLS set-ups that use MockServer's default CA; see upgrading to 9). Up to 9.0.0, MockServer trusted client certificates signed by MockServer's own CA whenever mTLS was on, even with tlsMutualAuthenticationCertificateChain set. By default that CA is the one bundled with MockServer, and its private key is published in the MockServer jar, so anyone could create a client certificate, with any name, that MockServer accepted. That client also matched any client certificate condition in your expectations and, when control-plane authentication was off, could create, read or delete expectations. MockServer now never trusts the bundled CA for mTLS. If mTLS is on and nothing but the bundled CA would be trusted, or tlsMutualAuthenticationCertificateChain contains the bundled CA, MockServer does not start, PUT /mockserver/configuration answers 400, and the message names the fix: give MockServer its own CA with certificateAuthorityCertificate and certificateAuthorityPrivateKey, set dynamicallyCreateCertificateAuthorityCertificate=true, or set tlsMutualAuthenticationCertificateChain to the CA that signs your client certificates. With a chain set and the default CA, MockServer now trusts only the chain. For a throwaway local test, the new tlsMutualAuthenticationAllowBundledCa=true restores the old behaviour, and a warning is logged whenever the bundled CA becomes trusted (at startup, when a configuration change makes it trusted, and when the TLS context is rebuilt). This applies to HTTPS and HTTP/3. If a MockServer reachable by others relied on mTLS with the default CA, treat its expectations and recorded traffic as possibly read or changed by someone else (fixes GHSA-52vf-hgvq-8pr3)
  • Dashboard: a crafted dashboard link can no longer make the dashboard reset, clear or stop the MockServer that serves it. The dashboard reads ?host=, ?port= and ?basePath= from its own address and used them unchecked to build every call it makes to MockServer, so a link such as …/mockserver/dashboard?basePath=/mockserver/reset%23 turned the dashboard's next routine call into /mockserver/reset as soon as someone opened it. These values now go through the same checks as a server typed into Set MockServer: a host must be a plain host name or IP address (no scheme, path, @ or #), a port a number from 1 to 65535, and a base path a plain path (no ?, #, %, \, // or ./.. segments). An invalid value is ignored, the dashboard uses the server that served it instead, and a warning at the top of the dashboard names what was ignored. A valid link that points the dashboard at a server on a different host now shows a warning naming that server, because what you create in the dashboard is sent there, with a button to switch back to the server that served the page; that server no longer decides whether dashboard analytics are on (the server that served the page still does). Valid links on the same host, such as ?port=1080 or ?basePath=/mock, work as before with no warning. A dashboard served behind a proxy under a path containing a percent-encoded character (for example a space) now falls back to the root path, with the same warning; pass ?basePath= to set it. The stricter base-path check also applies to Set MockServer, and a saved workspace target whose base path contains % or \ is dropped, so that workspace follows the dashboard's address again
  • Load scenarios: a STAIRS load shape with a huge steps value (for example 2147483647) could exhaust the server's memory when it was loaded with PUT /mockserver/loadScenario, before the stage limit was checked. A shape is now checked against the stage limit (loadGenerationMaxStages, 20 by default) before it is expanded, and rejected with 400 Bad Request if it is too big; no shape can expand to more than 10,000 stages. Stage durations so large that their total wrapped past the maximum run duration are now rejected too, and so is NaN or Infinity in any number in a load scenario (stage rates, shape parameters, step weights, the pacing value and thresholds); before, a NaN step weight made a weighted scenario fail once it ran. A VU shape value too big for a whole number of virtual users is now rejected by the virtual-user limit instead of silently wrapping to a small or negative count
  • Node, Python, Go, Rust and .NET clients: the callback and breakpoint WebSocket now carries the client's configured control-plane bearer token as Authorization: Bearer <token>, as control-plane HTTP calls already did, so callbacks and breakpoints keep working when MockServer requires JWT or OIDC control-plane authentication on that WebSocket. A token supplier is asked for a fresh token on each connection, including the Node and Python clients' reconnects. With no token configured nothing is sent, and a MockServer that does not require authentication ignores the header. In a browser the Node client cannot send it, because browsers do not let a page set headers on a WebSocket and MockServer accepts the token only in that header; use mutual TLS for browser callbacks and breakpoints when control-plane authentication is on. The Ruby client has no control-plane token option and the PHP client has no callback WebSocket, so neither changes
  • Log lines can no longer be forged through request data. The forward circuit breaker's log messages (which name the upstream, which can come from a request's Host header or HTTP/2 :authority) and the LLM conversation matcher's debug messages (which quote the request body) now write carriage returns, line feeds and other control characters as escapes such as \r and \n, so a crafted request cannot start a new log line
  • By default, web pages on other sites can no longer use MockServer's API or WebSockets from your browser (BREAKING; see upgrading to 9). Since 7.0.0, MockServer's own API (every /mockserver/... path, including MCP and metrics), the dashboard's live log and the callback WebSocket answered any web page, so a site you visited while MockServer was running could read recorded traffic, add or change expectations, and reset or stop the server. A new property, controlPlaneCorsAllowOrigin, now decides which browser origins may use them. Left blank (the default), it allows pages on localhost, 127.0.0.1 or [::1] (http or https, any port) and pages MockServer serves itself, such as the dashboard, when MockServer is reached by a name DNS rebinding cannot take over (see the next entry); set it to a comma-separated list of origins (or *) to allow others. It can only be set at star...
Read more

MockServer 9.0.0

Choose a tag to compare

@jamesdbloom jamesdbloom released this 15 Oct 21:51

[9.0.0] - 2026-10-15

This release delivers a sustained performance and memory programme alongside data-integrity fixes under load, plus a large set of LLM-provider correctness fixes, dashboard improvements, and client-library parity work. Headline numbers from the single-load-generator benchmark on the same six-core rig (builds 420 and 464): the healthy ceiling rises from 39,033 to 57,149 req/s and the peak from 43,671 to 59,905 req/s, with p95 at 32,000 req/s falling from 56.6 ms to 0.44 ms on the new ZGC default in the Docker images; event-log retained heap at 20,000 entries falls from 429 MB to 61 MB; Docker image download shrinks ~23%; and instance shutdown drops from ~107 ms to near zero. 22 BREAKING changes affect HTTP/3, DNS mocking, binary (non-HTTP) proxying and binary expectation matching while proxying, template-failure response codes, maxLoggedMatchFailures's default, initialisation-file id conflicts, the Node client's TypeScript typings and exports map, LOG_ENTRIES log output, control-plane error handling and mTLS, the Rust client's enums, verification-failure wording, response statusCode validation, AsyncAPI and response/OpenAPI verification, GenAI trace span names, the Node client's recorded-request typings, and the Go client/Testcontainers module's /v9 module paths — see Upgrading from 8.0.0 and the BREAKING entries under Changed. For a per-change migration list, see the upgrade guide at https://www.mock-server.com/mock_server/upgrading_to_9.html.

Metric Before After
Throughput, healthy ceiling / peak (req/s, 6 cores) 39,033 / 43,671 57,149 / 59,905
p95 latency at 32,000 / 48,000 req/s offered 56.6 ms / 82.4 ms 0.44 ms / 12.0 ms
Event-log heap (20,000 entries) 429 MB 61 MB
Docker image download (linux/arm64, standard image) ~167 MB ~129 MB
Instance shutdown time ~107 ms ~0 ms

"Before" is perf build 420 (commit d568695, 2026-09-24, JDK 17.0.20, G1 collector), measured nine days after the 8.0.0 tag and already carrying some of this release's own work, since 8.0.0 itself was never measured on this rig. "After" is perf build 464 (commit efdc522, 2026-09-27, JDK 25, ZGC), the performance page's single-load-generator figures; the page's headline is now a different, multi-generator measurement (see Changed). Both are comparable with each other but not with any benchmark published after this release.

Upgrading from 8.0.0

  • Go client and Go Testcontainers module users: both modules move to /v9 module paths (the Go module proxy refused their 8.0.0 tags) — run go get github.com/mock-server/mockserver-monorepo/mockserver-client-go/v9 (and the Testcontainers module's /v9 path if you use it) and change your
    imports from the /v7/unsuffixed paths to the /v9 ones; see Changed.
  • HTTP/3 users (http3Port set): the QUIC native library now ships separately — use the -jar-with-dependencies-http3 jar or the mockserver/mockserver:<version>-http3 Docker image (latest-http3, snapshot-http3; Helm: image.variant=http3), and a server that cannot serve HTTP/3 (missing
    native, or the port unusable) now refuses to start instead of silently falling back.
  • DNS mocking users (dnsEnabled=true): MockServer now refuses to start if its dnsPort cannot be bound, instead of logging a warning and running without DNS. Leave dnsPort at its default of 0 to let the OS pick a free port, or set dnsEnabled=false.
  • TypeScript users of mockserver-client/llm: the deep-import typings no longer declare a default export; import from mockserver-client itself, use import llm = require(...)/import * as llm from ..., or turn on esModuleInterop (see Changed).
  • Binary (non-HTTP) proxy users: a client connection now always keeps one upstream connection for its whole life — forwarding one message per upstream connection is removed, along with its forwardBinaryRequestsWithoutWaitingForResponse setting (a value still set is ignored, with a warning); remove it from your configuration.
  • Anyone reading a request or response body from message/arguments of LOG_ENTRIES output (including the MCP retrieve_logs/raw_retrieve tools): read it from the entry's httpRequest/httpResponse instead — message/arguments now refer to that request/response by a short form
    such as "POST /orders" or "201".
  • Anyone treating a control-plane 400 as any failure, or catching the Java client's IllegalArgumentException for non-input failures: an unexpected server-side fault is now a 500 with a generic message and correlation id; 400 is now reserved for requests MockServer genuinely rejects. The
    Java client's retrieveLogsByCorrelationId and retrieveActiveExpectations(requestDefinition, format) now throw instead of returning the error's text.
  • Anyone importing a path inside mockserver-client/mockserver-node other than the package or a documented module: both packages now have an exports map, so an unlisted path (.d.ts files, tasks/mockServer.js, etc.) now fails to resolve — resolve <package>/package.json and join a file's
    path to that directory if you need one by location.
  • Control-plane mTLS, Java client: the client now trusts only controlPlaneTLSMutualAuthenticationCAChain for MockServer's certificate; add MockServer's own CA to that chain if it signs the server certificate.
  • Control-plane mTLS, server: MockServer now accepts only client certificates signed by controlPlaneTLSMutualAuthenticationCAChain; add MockServer's own CA to the chain if it signs your client certificates (or use your own CA if it's the bundled default), and MockServer now refuses to start with
    mTLS required, no chain set, and the bundled default CA — set the chain or configure your own CA with certificateAuthorityCertificate/certificateAuthorityPrivateKey.
  • Rust client users who match on its enums: every public enum is now #[non_exhaustive] (add a wildcard arm), and server-sent enums (ResponseMode, BinaryUpstream, CrossProtocolTrigger, the Load* enums) gain an Unknown variant that cannot be sent back; LoadThresholdMetric also gains
    CheckFailureRate.
  • Anyone asserting the exact text of an over-count verification failure (never(), exactly, atMost, between, verifyZeroInteractions): the message now reads "found … but should have been found …" instead of "not found".
  • Anyone with a response statusCode of 0 or outside 100–999 (most likely from a blank 8.0.0 dashboard status field): it is now rejected at creation with a 400, or skipped with a WARN (naming it) when loaded from an initialization/persisted-expectations file, with the file backed up first.
  • AsyncAPI verification users (PUT /mockserver/asyncapi/verify, or the Java client's verifyAsyncMessage): put atLeast/atMost/exactly inside count, not at the top level — the endpoint now answers 400 for unknown fields instead of ignoring them.
  • Anyone verifying a response body with a regex, JSON path, JSON Schema, XPath, XML Schema, form, multipart, fuzzy, GraphQL, JSON-RPC, WASM or allOf matcher: that matcher is now actually applied, where it was previously ignored (verification passed whenever any recorded response had a JSON object
    body).
  • Anyone verifying requests with an OpenAPI matcher: only requests for the matched operationId now count, instead of every recorded request (verifySequence was unaffected).
  • Anyone selecting LLM completions by gen_ai.operation.name == "chat": Gemini calls are now generate_content, and prompt-string completions (legacy /v1/completions, Mistral FIM, Ollama /api/generate, prompt-based Bedrock InvokeModel models) are now text_completion — update to match
    chat, generate_content and text_completion together.
  • TypeScript users of the Node client's retrieveRecordedRequests/retrieveRecordedRequestsById: now typed Promise<RequestDefinition[]> instead of Promise<HttpResponse[]>; narrow each result to HttpRequest before reading HTTP-specific fields.
  • Anyone proxying binary (non-HTTP) traffic while binary expectations are registered on the same MockServer: a message matching a binary expectation is now answered by it and not forwarded, by default (matchBinaryExpectationsWhenProxying); set it to false to always forward as in 8.0.0.
  • Anyone relying on every "didn't match" comparison being logged: the new maxLoggedMatchFailures property now defaults to 50, so at INFO only the first 50 "didn't match" entries per request are logged; set maxLoggedMatchFailures=-1 to keep logging every comparison.
  • Anyone with expectations in an initializationJsonPath file whose ids repeat: the file now keeps the last expectation for each repeated id, not the first; remove the repeated ids, or put the one you want last.
  • Anyone relying on a failed template answering 404/502: a response/forward template that fails, or whose output isn't valid, now answers 500 by default (templateFailureAsServerError); set it to false to keep the 8.0.0 answers.

Also worth checking, though none is a breaking change: if you override the standard Docker images' ENTRYPOINT or copy the jar out of them, /mockserver-netty-jar-with-dependencies.jar is now split into /mockserver.jar and /mockserver-deps.jar — use -cp /mockserver.jar:/mockserver-deps.jar:/libs/* (java -jar /mockserver.jar still runs, but without the CDS start-up archive, so it starts more slowly); with forwardProxyBlockPrivateNetworks on, a request that matches no expectation and whose Host header names MockServer itself by a name it doesn't recognise as its own (a Docker Compose or Kubernetes service name, for example) now gets 502 Bad Gateway instead of 404 Not Found, because that name resolves to a private address — add the name to noProxyHosts, or set `attemptToPro...

Read more

MockServer 8.0.0

Choose a tag to compare

@jamesdbloom jamesdbloom released this 15 Sep 09:33

[8.0.0] - 2026-09-15

Added

  • Test port allocation can opt into a fixed port band instead of the OS ephemeral range.
    org.mockserver.socket.PortFactory normally finds a free port with bind(0), which draws from the same
    ephemeral range (on macOS net.inet.ip.portrange.hifirst..hilast, typically 49152-65535) that every other
    bind(0) on the machine uses — including unrelated applications, IDE helpers, and other JVMs. On a busy
    developer machine that causes two kinds of test flake: a foreign process can occupy a number a test is about to
    choose, and a test can momentarily connect to that foreign listener instead of the server under test. Setting
    both mockserver.testPortRangeStart and mockserver.testPortRangeEnd (for example
    -Dmockserver.testPortRangeStart=20000 -Dmockserver.testPortRangeEnd=40000) makes PortFactory choose ports by
    explicitly binding inside that band — which the OS does not itself hand out to bind(0) — retrying past any
    number already in use. Both properties are unset by default, so continuous integration and any machine that does
    not set them keep the exact bind(0) behaviour as before. This affects only test port selection; it does not
    change how MockServer binds its own ports at runtime (starting on port 0 and reading back the assigned port
    remains the fully race-free option and is unchanged). In a surefire/failsafe fork the two properties must reach
    the fork, e.g. via -Dmockserver.testArgLine="-Dmockserver.testPortRangeStart=20000 -Dmockserver.testPortRangeEnd=40000".

Changed

  • HTTP/2 now gives every request stream its own channel. MockServer's HTTP/2 server — both h2 (over TLS) and
    cleartext h2c — now uses Netty's stream-multiplexing model for every connection, replacing the previous
    shared-connection HTTP/2 pipeline. Each HTTP/2 stream is processed on its own isolated child channel. This
    removes a class of cross-stream interference on busy connections: concurrent streaming responses (Server-Sent
    Events, NDJSON, AWS Bedrock event-stream, and therefore all streaming LLM responses) can no longer have a later
    chunk of one stream mis-routed onto another, and each stream's end-of-stream is delivered independently, so a
    slow or streaming response on one stream cannot stall another. This model was previously used only when
    grpcBidiStreamingEnabled was set; it is now the standard HTTP/2 pipeline and needs no configuration — so the
    HTTP/2 correctness fixes listed below apply to all HTTP/2 traffic, not only when that flag is enabled. There is
    no change to the REST/Java API, to how expectations are written, or to HTTP/1.1 and HTTP/3 traffic, and HTTP/2
    clients receive the same responses. Users driving very large numbers of concurrent streams over a single
    connection may notice different memory and throughput characteristics, since each stream now has its own
    lightweight channel. (GitHub issue #2669).
  • Behaviour change — over HTTP/2, closeSocket now ends the stream, not the connection. A per-expectation
    ConnectionOptions.closeSocket / closeChannel (and the slowCloseDelay connection-lifecycle chaos) applied
    to an HTTP/2 request now closes only that request's stream; other requests in flight on the same connection
    continue and complete normally. Previously it tore down the whole TCP connection, killing every concurrent
    stream on it — so one expectation could destroy unrelated clients' in-flight requests. Ending a single stream
    is the correct HTTP/2 semantic and is what the same expectation already did over HTTP/1.1, where a connection
    carries one request at a time. If you rely on closeSocket to tear down an HTTP/2 connection — for example
    to test how your client recovers from a dropped connection — use the resetMidResponse connection-lifecycle
    chaos fault instead, which still aborts the whole TCP connection (that is its purpose, and it now does so
    properly rather than degrading into a single-stream reset). HTTP/1.1 and HTTP/3 behaviour is unchanged.
    (GitHub issue #2669).
  • BREAKING: mockserver-bom now manages only MockServer's own org.mock-server modules — it no longer pins
    the third-party libraries MockServer uses internally.
    The published BOM previously baked in MockServer's
    entire parent dependencyManagement (~190 third-party entries — Jackson, Netty, Guava, Nimbus, Velocity, and
    more), four of them at test scope. Because a BOM's managed versions and scopes apply to whoever imports it,
    this silently overrode a consumer's own versions and scopes for those shared libraries. For example, a
    project that declared com.nimbusds:oauth2-oidc-sdk without a scope had it forced onto the test classpath
    by MockServer's internal test-scoped pin, so the dependency disappeared from compile/runtime and the
    consumer's production code failed to build against it (GitHub issue #2684). The published BOM now contains
    only the MockServer module entries (24, down from 221), so importing it never changes any third-party version
    or scope in your build. What you need to do: if you imported mockserver-bom to align MockServer's
    transitive third-party versions — for instance to satisfy the Maven Enforcer dependencyConvergence rule —
    those pins are gone and convergence errors may reappear; manage the affected third-party versions yourself in
    your own dependencyManagement, or import each upstream project's own BOM. Aligning the MockServer modules
    themselves is unchanged: keep importing the BOM and declare MockServer artifacts without a version.
    (GitHub issue #2684).

Fixed

  • A SOCKS4a client (for example curl -x socks4a://…) proxying through MockServer no longer hangs.
    SOCKS4a is the SOCKS4 extension where the client sends the destination as a hostname instead of an
    IPv4 address. MockServer decoded the request correctly but then echoed that hostname back into the
    DSTIP field of the SOCKS4 grant reply, which must be an IPv4 literal; the resulting error was thrown
    while writing the reply, so the client never received one and blocked until it timed out (curl exit 28,
    0 bytes) — for cleartext HTTP as well as for TLS. The reply's DSTIP/DSTPORT are ignored by clients,
    so a SOCKS4a grant now carries 0.0.0.0:0; a classic SOCKS4 request (IPv4 literal) still echoes its
    destination back unchanged. Plain SOCKS4 and SOCKS5 (socks5h://) were unaffected.
  • The command-line server now exits with a non-zero status code when it fails to start. Previously, if
    MockServer could not start — most commonly because the requested port was already in use — the CLI logged
    the error but still exited 0, so a shell script or CI job that started MockServer got no failure signal
    and carried on as though the server was up (typically failing later with a confusing connection error).
    mockserver run / -serverPort (and the ui, demo, proxy, and openapi subcommands, which start a
    server the same way) now exit 1 on a failed start. Usage errors that were already handled — an invalid or
    missing port, an invalid host or log level — keep their existing exit code, so only the previously-silent
    startup-failure case changes.
  • An HTTPS request that negotiates HTTP/2 (ALPN h2) through MockServer's SOCKS proxy now works.
    Previously, using MockServer as a SOCKS4/SOCKS5 proxy for an https:// request that upgraded to HTTP/2
    failed completely — the client received nothing (curl reported CURLE_HTTP2, 0 bytes) — because MockServer
    provisioned its internal relay for HTTP/1.1 before the tunnelled TLS connection had negotiated its protocol,
    so the forwarded HTTP/2 frames were unparseable. SOCKS over HTTP/1.1, SOCKS over cleartext, and the HTTP
    CONNECT proxy over HTTP/2 were unaffected and continue to work. MockServer now terminates the tunnelled TLS
    in the relay and waits for its ALPN result before wiring up the connection, exactly as the CONNECT proxy
    already did. This works on any port: rather than guessing from the destination port number (the earlier
    fix inferred TLS only for ports ending in 443, so h2 to a TLS port such as 993, 465, or 9999 was
    still mis-provisioned as HTTP/1.1), MockServer now classifies the first bytes the client sends through the
    tunnel — a TLS record versus a cleartext HTTP request — and provisions the connection to match. As a result,
    HTTP/2 over TLS through a SOCKS tunnel succeeds on any port, and a cleartext tunnel to a port that happens to
    end in 443 is no longer mistaken for TLS. Cleartext HTTP/2 with prior knowledge (h2c) through a SOCKS
    tunnel now works too
    — the last case left as HTTP/1.1 by the earlier fixes. The same first-bytes
    classification now also recognises the HTTP/2 connection preface (PRI * HTTP/2.0…) after ruling out a TLS
    record, and provisions cleartext HTTP/2 on both relay legs so the mocked response is served over h2c
    (a curl --http2-prior-knowledge request through a socks5h:// proxy, for example); anything that is not a
    preface is still provisioned as HTTP/1.1, and when HTTP/2 is disabled (http2Enabled=false) the preface is
    ignored and the tunnel falls back to HTTP/1.1, exactly as MockServer's own listener does. The HTTP CONNECT
    proxy is unchanged, so cleartext HTTP/2 with prior knowledge through CONNECT is still served as HTTP/1.1 —
    that was never a working case and is unaffected either way. (GitHub issue #2685).
  • Starting the command-line server with port 0 now reports and uses the actual OS-assigned
    ephemeral port instead of 0. Previously mockserver run -p 0 (or -serverPort 0) bound a real
    ephemeral port but recorded the requested 0, so the port a caller needs to reach the server was
    not discoverable, and ui -p 0 / demo -p 0 printed a dashboard/getting-started URL pointing at
    localhost:0. MockServer now records the real bound port after startup and uses it for the
    ...
Read more

MockServer 7.6.0

Choose a tag to compare

@jamesdbloom jamesdbloom released this 17 Aug 17:10

[7.6.0] - 2026-08-17

Changed

  • The three Kubernetes container-integration cases that need Java-built images — helm_sidecar_injection
    (admission-webhook sidecar injection), helm_clustered_convergence, and helm_jgroups_dns_ping (both the
    -clustered Infinispan image) — now run blocking in CI instead of recording a skip. Previously the CI helm step
    ran with no JDK and never built those images, so all three recorded an honest but permanent SKIP — coverage that
    looked green while proving nothing. A new :maven: build container-test images (jars) step in the
    mockserver-container-tests pipeline builds the mockserver-netty, mockserver-k8s-webhook, and
    mockserver-state-infinispan jars from the tree (once, via the Maven-in-Docker reactor) and hands them to the
    helm step as Buildkite artifacts; the helm step downloads them and does cheap docker builds (a COPY into
    distroless) to produce the -clustered and mockserver-webhook images, then runs the suite. The jars travel as
    artifacts (~200 MB total) rather than docker saved images (~1.3 GB), mirroring the node-launcher / WAR hand-off. Both
    layers fail closed: the helm step exits non-zero if any jar artifact is absent, and the harness runs with
    REQUIRE_CLUSTERED_IMAGE=true/REQUIRE_WEBHOOK_IMAGE=true so an image that is expected-but-absent is recorded as a
    FAILURE, never a skip — a skip in CI is now impossible. Local container_integration_tests/integration_tests.sh
    is unchanged for a developer without the images: it still records a comprehensible SKIP (no fail-closed flag set),
    and the harness now also builds the mockserver-webhook image locally (build_webhook_docker) so the sidecar case
    runs blocking in local dev too — it was never built by the harness before, so that case had always skipped.

Added

  • Two new rules in the always-on check-false-green-guards.sh CI gate. Rule 4 fails the build if a CI step runs the
    container-integration harness with the helm/k3d cases active but does not export both REQUIRE_CLUSTERED_IMAGE=true and
    REQUIRE_WEBHOOK_IMAGE=true — the exact way the three image-dependent Kubernetes cases could silently revert to a green
    SKIP. It is keyed on the step's behaviour (invokes integration_tests.sh without SKIP_HELM_TESTS=true), not on a
    filename, so a rename or a second helm-running step is covered automatically. Rule 5 fails the build if a
    mockserver-core test that performs a JVM-global logging side effect (reaching LogManager.readConfiguration's handler
    reset() via the static ConfigurationProperties logging setters or a forced fresh <clinit>) is not in the
    sequential-tests include list — the shape behind a release-blocking flake that ParallelStaticStateGuardTest
    structurally cannot catch. Both rules fail closed on an empty corpus and carry a rotating allow-list. See
    docs/operations/false-green-guards.md.
  • A jarPath launcher option and matching MOCKSERVER_JAR_PATH environment variable for mockserver-node, pointing
    start_mockserver at a pre-provisioned mockserver-netty jar-with-dependencies instead of downloading one from
    Maven Central. When set, that exact jar is launched and no download is attempted; a configured-but-missing path is a
    hard error (... refusing to fall back to downloading a release) rather than a silent fall-back to a released
    jar, so a missing artifact fails loudly. Mirrors the existing MOCKSERVER_BINARY_BASE_URL bring-your-own-artifact
    path for the standalone binary, and serves air-gapped/corporate installs as well as testing a locally-built jar
    (jarPath takes precedence over mockServerVersion/artifactory*; the option beats the env var). The Node launcher
    integration tests now use it in CI: a new :maven: build node launcher jar step builds the jar from the tree and
    the launcher-test step downloads it as an artifact and launches it via MOCKSERVER_JAR_PATH — so the suite finally
    tests the repo's own code instead of the last release. Previously it ran a downloaded release chosen by
    package.json's version, so a mockserver-core fix could not green it and a regression could not red it; that
    released jar also carried the shipped dynamic-CA generation race (fixed on master in 4cff56e61) and flaked ~8% of
    runs. The launcher step fails closed if the tree-built jar is absent rather than reverting to a download, and
    local npm test outside CI is unchanged (with neither the option nor the env var set it still downloads as before).
  • A structural wire-contract test for the LLM provider codecs (LlmCodecStructuralContractTest), breaking the
    self-derivation weakness in the golden-file drift test. LlmCodecGoldenFileTest regenerates its golden bodies
    from the codec itself (-Dmockserver.updateLlmGoldens=true), so a structural codec defect — a renamed field, a
    wrong SSE event name, a dropped finish_reason — bakes straight into its own golden and the byte-for-byte drift
    test then passes forever, confirming only that the codec is consistent with itself (token counts were already
    pinned separately by shouldEncodeCanonicalTokenUsageCounts; the bodies were not). The new test asserts the live
    codec output against hand-authored expectations taken from each provider's published API schema — required
    fields, JSON types, the enum discriminators each provider uses (object/type/finish_reason/stop_reason/
    finishReason/status/done), the tool-call envelope shape (arguments as a JSON string for OpenAI/Responses
    vs a structured object for Anthropic/Gemini/Ollama), and the exact SSE event-name sequence for the event-typed
    providers — across all seven chat/completion providers (Azure and Bedrock via their delegate codecs). Crucially it
    never reads the golden files and is unaffected by -Dmockserver.updateLlmGoldens=true, so regenerating goldens
    cannot silence it. Each named defect class was injected into a codec and confirmed to turn the test red without
    regenerating goldens (OpenAI renamed finish_reason; Anthropic SSE content_block_delta→content_delta; Gemini
    dropped finishReason; Responses renamed status; Ollama renamed terminal done), then reverted. Residual
    streaming-over-the-wire behaviour remains covered by LlmAgentLoopE2eTest.
  • Endpoint-level test (HttpStateCassetteEndpointTest) and an authoritative CassetteRegistry javadoc note pinning
    the settled decision that loading and recording register a cassette automatically. The record_llm_fixtures
    and load_expectations_from_file MCP tools already auto-register the fixture in the process-wide CassetteRegistry
    (keyed by file path, origin recorded/loaded, upserting on re-load/re-record) so it surfaces under
    GET /mockserver/cassettes and in the dashboard's Cassettes tab without a manual PUT /mockserver/cassettes — but
    nothing pinned that a so-registered cassette is actually retrievable through the GET endpoint, and the registration
    policy lived only in the two MCP callers, inviting the question to be re-opened. The new test drives
    GET /mockserver/cassettes (and the bare /cassettes alias) against a registry populated the way the load/record
    handlers populate it and asserts the documented body shape (path, derived filename, expectation count, origin,
    lastUsed), that record-then-load on one path yields a single upserted entry, and that a server reset clears it. The
    MCP tools and consumer docs (ai_mcp_tools.html) already stated this behaviour; both are now clarified to say the
    fixture is registered automatically. This closes the "CassetteRegistry auto-population" product-decision item by
    recording the decision in code, docs, and a test rather than leaving it to resurface.
  • Compile gates for the dashboard composer's generated client code in Python, Ruby, Go and Rust
    (.buildkite/scripts/steps/ui-client-codegen-compile.sh, wired into pipeline-ui.yml), closing the gap where
    five of the composer's seven languages had no compile check — only Java (ui-java-codegen-compile.sh) and C#
    (ComposerCodegenEquivalenceTests.cs) were gated, so an emitter bug or a client-API rename would ship broken
    generated code to users caught by nothing (the existing per-language tests only string/byte-compare the emitter
    output, never feed it to a compiler). Each gate drives the shared representative composer matrix
    (extractParityCases.ts — the exact combos the byte-identity parity tests use) through that language's emitter
    and runs the lightest credible toolchain check: python -m py_compile and ruby -c catch any emitter bug that
    produces malformed source (the strongest static check for a dynamically-typed client with no shipped type stubs),
    while Go (go build/go vet ./...) and Rust (cargo check) compile the generated code against the real
    in-repo mockserver-client-go / mockserver-client-rust, so a renamed client method fails the build — the direct
    analog of the Java javac gate. Node was already covered: the tsc type-proof in node.test.ts
    (typecheck-node-codegen.mjs) runs under npm test, so the orphaned-script concern was already resolved by that
    test. All four new gates are proven to go red (emitter drift → non-zero exit) and green. Each phase runs in its
    toolchain's Docker image via run-in-docker.sh; set CODEGEN_COMPILE_USE_DOCKER=false for host validation.
  • Config-to-client wiring tests for the GCS and Azure blob-store backends
    (GcsBlobStoreRegistrarConfigWiringTest, AzureBlobStoreRegistrarConfigWiringTest), closing the gap where
    only S3 (S3BlobStoreRegistrarConfigWiringTest) proved that blobStoreType configuration is turned into a
    working client. The GCS and Azure contract tests hand-build their clients (new GcsBlobStore(storage, …),
    `new AzureBlobStore(containerClient, …...
Read more

MockServer 7.5.0

Choose a tag to compare

@jamesdbloom jamesdbloom released this 29 Jul 18:21

[7.5.0] - 2026-07-29

Security

  • BREAKING: response templates can no longer reach arbitrary Java classes by default, closing the
    template remote-code-execution paths reported as
    GHSA-7pwj-xvc2-hfpc (CVE-2026-123354, Velocity) and
    GHSA-xcr9-3j63-6cgq (CVE-2026-123355, JavaScript).

    A caller who can reach the management API can register an expectation, and a response template was able
    to load java.lang.Runtime and execute OS commands in the MockServer process. Both engines that could
    do this are now sandboxed out of the box:
    • velocityDisallowClassLoading now defaults to true (was false), installing Velocity's
      SecureUberspector so a template cannot reach classes through $request.class.classLoader.loadClass(...).
      This is the more exposed half of the issue, and the half the report did not cover: Velocity ships in
      the DEFAULT distribution, whereas the JavaScript engine does not.
    • JavaScript templates now resolve no Java classes unless an operator grants them. Previously an
      empty javascriptAllowedClasses and empty javascriptDisallowedClasses meant unrestricted
      Java.type(...) access; that combination — the out-of-the-box state — now denies every class.
    • The GraalJS guest context no longer grants access to the members of java.lang.Class or
      java.lang.ClassLoader. Denying classes at Java.type(...) alone was not sufficient: real host
      objects are bound into the context (faker and the other built-in helpers), and under the previous
      HostAccess.ALL a template could walk from one of them to a classloader —
      faker.getClass().getClassLoader().loadClass('java.lang.Runtime') — reaching Runtime without the
      class filter ever being consulted. That walk is now closed, so host-class lookup is the single complete
      gate; a regression test drives four such walks (including through request) and fails if any resolves.
      Velocity's SecureUberspector already blocked the equivalent walk through its own bound helpers, which
      is now covered by a test too.
      Both flips are fully reversible with one property and remove no functionality: set
      mockserver.velocityDisallowClassLoading=false, or list the classes your templates need in
      mockserver.javascriptAllowedClasses (the single entry * lets any class resolve again). Templates that
      do not touch Java classes are unaffected, which is the overwhelming majority — JavaScript templates have
      the full ES2023 standard library available regardless of this setting. A refused class is logged once at
      WARN naming the class and the property to set, because GraalJS otherwise surfaces a refusal only as the
      class being undefined ("... is not a function"); the log is bounded and de-duplicated so a hostile
      template cannot flood it. mockserver.javascriptAllowedClasses is now also settable through the Spring
      test listener's @MockServerTest properties, which it was not before — it was a nice-to-have while the
      default was unrestricted, and is the only way to grant a class now that it is not. The insecure-mode WARN
      now fires when an operator has explicitly opened the
      sandbox rather than when it is closed. Proven end-to-end by a Netty integration test that registers the
      reported payload through the real management API and asserts the OS command creates no marker file, with
      a negative control on a deliberately unsandboxed server that DOES create it — so a regression cannot pass
      as an inert payload. This lands DEF-2 and DEF-3 of docs/plans/later/security-defaults.md ahead of the
      other default flips listed there; JavaScript went further than that plan proposed (deny everything, not a
      built-in "safe types" allow-list) because deny-by-default is the only form that stays safe as the JDK
      grows new reachable classes.

Fixed

  • A property file that cannot be read is now reported instead of ignored in silence
    (#2358).
    When a
    mockserver.propertyFile an operator had explicitly configured could not be read, MockServer applied
    none of its properties and said nothing about it — at any log level. The only symptom was that every
    property in the file appeared to be at its default, which surfaces far downstream as unexplained
    behaviour: in the reported case an unreadable (but present) mounted file meant initializationJsonPath
    was never set, so no expectations loaded, no loading JSON initialization file: line appeared, and no
    error was logged either. The message existed but was unreachable in practice — gated at DEBUG and
    emitted during static initialisation, before any log level has been applied, so neither
    -Dmockserver.logLevel=DEBUG nor a -logLevel argument could surface it. Such a file is now logged at
    WARN, naming the path and the underlying reason verbatim; because FileNotFoundException covers "not
    there" and "not allowed to read it" alike, that reason is usually the whole answer (Permission denied
    in the reported case, typically SELinux labelling or a rootless/user-namespace UID mismatch). A property
    file that is merely absent at its default location stays quiet, as does the Docker image's built-in
    -Dmockserver.propertyFile=/config/mockserver.properties, which the entrypoint always passes and which
    therefore expresses no intent — otherwise every container started without a mounted config would warn.
    Inside the image, only MOCKSERVER_PROPERTY_FILE can express that intent, and it does.
  • The mockserver-node launcher suite no longer fails intermittently on a TLS handshake reset. The
    two tests that exercise jvmOptions did so over HTTPS against a server started with
    dynamicallyCreateCertificateAuthorityCertificate=true, and issued that HTTPS request as soon as
    start_mockserver resolved. start_mockserver only proves the HTTP control plane is answering — it
    polls PUT /mockserver/retrieve over plain HTTP — but with a dynamically created certificate
    authority the server still has to generate a CA key pair and a leaf certificate before it can serve
    TLS on that same (port-unified) port. A handshake arriving in that window was closed mid-negotiation
    and surfaced as ECONNRESET "Client network socket disconnected before secure TLS connection was
    established", failing whichever of the two tests lost the race. This accounted for every
    mockserver-node failure on master over the preceding 40 builds (5 of 40, ~12%), so it was the sole
    cause of the pipeline's intermittent red. Both tests now wait for an actual TLS handshake to complete
    before asserting, which gates them on the condition they really depend on rather than retrying the
    assertions. The new waitForTlsReady helper is verified to reject — not resolve — both when nothing
    is listening and when a listener accepts the TCP connection then destroys it mid-handshake, which is
    exactly the failure signature it exists to absorb. The readiness budget is deliberately generous
    (120s): waiting costs nothing when the server is healthy, since a ready server completes the
    handshake on the first attempt in milliseconds, so the limit only decides how much CI contention is
    tolerated before a slow start is misreported as a fault. An earlier 30s budget went green five builds
    running and then expired on a loaded agent — the same flake wearing a clearer error message. A start
    that takes over 5s is now reported even when it passes, because readiness creeping towards the limit
    is the signal that the next run will not make it.
  • archiver.glob() works again in @mockserver/testcontainers (Node), and CVE-2026-14257 stays
    closed.
    The previous remedy for the brace-expansion denial of service (GHSA-mh99-v99m-4gvg,
    patched only in 5.0.8) was a blanket "brace-expansion": "^5.0.8" override. That resolved the whole
    tree to a single hoisted 5.0.8 and npm audit reported zero vulnerabilities — but 5.x changed the
    CommonJS export from a callable function to an object ({ expand, EXPANSION_MAX, ... }), while the
    minimatch copies actually installed (3.1.5, 5.1.9, 9.0.9) all call it as expand(pattern). Every
    glob containing a brace therefore threw TypeError: expand is not a function, crashing
    archiver.glob(). The blast radius is narrower than it first looks — testcontainers copies files
    with archiver.directory()/.append(), which pass no brace pattern and still work — so what broke
    is brace globbing for anything in this module's runtime tree that does use it. The failure was
    invisible because minimatch short-circuits patterns with no {, so plain globs kept working and the
    unit suite stayed green. The override is now targeted: readdir-glob and archiver-utils' glob
    take minimatch@^10.2.5, which depends on brace-expansion@^5.0.5 and is written against the new
    API, so both runtime copies land on the patched 5.0.8 with a matching minimatch. jest keeps its own
    minimatch@3.1.5 + brace-expansion@1.1.16 pairing and is untouched. npm audit --omit=dev still
    reports 0 vulnerabilities, and a new dependency-integrity unit test drives a brace pattern through
    both runtime minimatch copies and through a real archiver.glob() tar, plus asserts expansion stays
    bounded — it fails against the blanket override, so the silent half of this cannot return.
  • A forward responseOverride that replaces the body no longer inherits the upstream response's
    Content-Length, which truncated the response on the wire.
    The override swapped the body but left the
    upstream header in place, so the client read only as many bytes as the body it replaced — a 34-byte
    override behind an upstream Content-Length: 13 arrived as 13 bytes — or hung waiti...
Read more

MockServer 7.4.0

Choose a tag to compare

@jamesdbloom jamesdbloom released this 04 Jul 18:05

[7.4.0] - 2026-07-04

Added

  • Dashboard: every language tab now generates typed client code. The composer's Java, Node.js, Python, Go,
    C#, Ruby, and Rust tabs construct each client's typed model — fluent builders and typed constructors matching
    the website examples — instead of embedding raw JSON, including full LLM response actions in Java. Every
    language's generated output is proven equivalent by executing or compiling it against the real client and
    comparing the serialized expectation with the registered JSON, and a CI gate compiles the generated Java
    against the built client on every build.

  • Every client library now round-trips the full expectation model, proven by a shared fidelity harness. The
    Go, Rust, C#, Python, Ruby, and Node clients gained typed support for every expectation feature they previously
    dropped silently — chaos profiles, rate limits, forward-with-fallback and forward-validate actions, gRPC bidi
    responses, before/after actions, steps, capture rules, namespaces, LLM response payloads including moderation,
    rerank, and content filters, WebSocket frame matchers, response trailers, DNS matchers, and all body matcher
    variants. Forty-four server-validated kitchen-sink fixtures now run as round-trip tests inside each client's own
    test suite, with a ratcheting known-gaps ledger that fails CI if a documented gap silently regresses or a fixed
    gap is still excused.

  • Dashboard: JWT and all-of body matchers are now authorable in the composer. The Advanced request form gains a
    JWT section (claims, issuer, audience, algorithm) and an all-of body matcher composing multiple sub-matchers,
    emitted in the exact server wire format and round-tripping on edit.

  • Dashboard: the Java code tab is now complete and type-safe. Generated Java uses the real client API for
    priority, times, and time-to-live, scenario bindings, namespaces, and capture rules — proven by compiling a
    kitchen-sink snippet against the built client — and the Java client gains matching withNamespace and withCapture
    fluent methods. Actions the Java builder preview cannot represent show an honest notice instead of fabricated code.

  • Dashboard: every captured flow is now a launchpad. A "Create From This" menu on traffic detail panes and
    log rows fans out into every subsystem pre-filled from that flow — create a mock in the composer, set a
    breakpoint, prefill a verification, or add chaos for the host. The traffic inspector also gains structured
    Request/Response tabs (headers tables and pretty-printed bodies, with the raw JSON tree kept as a tab),
    "Copy as curl" with shell-safe quoting and masked credentials, a Charles-style "Repeat" action (iterations,
    bounded concurrency, delay, live progress and cancel), a Proxyman-style diff pool with an editable ignored-headers
    list, an unmatched-count chip with why-didn't-this-match and generate-stub actions, and bulk
    "Promote to Mocks" over recorded traffic (PUT /mockserver/recordings/promote).

  • Dashboard: previously server-only capabilities are now reachable from the UI. Validate recorded traffic
    against an OpenAPI spec (/trafficValidate), import GraphQL SDL schemas and mock SCIM providers, import Pact
    contracts, generate HTTP expectations from AsyncAPI specs, dry-run WASM modules against a sample request,
    reload persisted recording archives (NDJSON or from server disk), a preemption-simulation card and experiment
    history in Service Chaos, a control-plane Audit view, a standalone Scenarios view in the navigation, and a
    read-only Server Info tab (effective configuration with source tiers, bound ports plus bind-additional-port,
    proxy setup with CA download) alongside a server-side decoded-prompt LLM run diff.

  • Dashboard: quick chaos and honest latency attribution. A one-toggle Quick Chaos strip (percentage slider
    over real per-request fault probabilities, per upstream host) makes fault injection approachable, and the
    traffic timing waterfall now distinguishes latency MockServer injected (chaos latency, configured response
    delays including the global delay, breakpoint holds) from real upstream/processing time — mock-served
    responses carry a timing block for the first time when they inject latency (a plain mock's recorded
    output is unchanged).

  • Force a response-sequence variant per request. A request matching an expectation with multiple responses
    can force which variant it receives via a 0-based x-mockserver-response-index header. Forced requests
    consume times but never advance the sequential/switch rotation for other callers; the header is retained
    in recordings and filtered from every outbound forward, including WebSocket passthrough. Invalid values are
    ignored.

  • Dashboard: faster first load, first-run onboarding, and one-click navigation. All views load lazily
    (initial bundle down from 259 kB to about 164 kB gzip), a Try It Now path on the get-started view creates a
    first mock, returning users get an open-dashboard shortcut, keyboard shortcuts move off
    browser-conflicting bindings with a ? help overlay, and matcher testing is available at the point of need
    in the composer and on every expectation row. The scenarios view details each scenario's states, bound
    mocks, and transitions with edit-in-composer actions, and the advanced composer models scenario bindings
    directly. The audit view explains the opt-in audit trail (and the demo enables it).

Fixed

  • Dashboard: editing an LLM or otherwise exotic expectation now generates complete typed client code in
    every language.
    Fields the composer form cannot model — LLM responses with their full completion detail,
    response sequences, object callbacks, forward-validate, gRPC bidi, rate limits, and cross-protocol
    scenarios — were silently dropped from generated Python and Ruby code and embedded as raw JSON in C# and
    Rust; all languages now construct the client's typed model, guarded by a universal test asserting no wire
    field is ever absent from generated code.

  • Registering forward-validate, forward-with-fallback, or gRPC bidi expectations no longer fails with a
    metrics error.
    The per-action counter constants for these action types were missing, and a guard test
    now asserts every action type has one.

  • Generated Go code now compiles. All Go code generators — the dashboard expectation, verification, and
    load-scenario tabs, the retrieve-as-Go endpoint, and the website examples — emitted the client import without its
    /v7 semantic-import-versioning suffix, so generated code never resolved against the published module.

  • .NET client: reading an object-callback expectation back from the server no longer throws. The
    responseCallback field was typed as a string while the server emits a boolean, losing the whole expectation.

  • Python client: multipart body field matchers no longer vanish on registration. Multipart fields were emitted
    in an array form the server misroutes; they now use the server's canonical object form.

  • Dashboard: editing a mock no longer shows phantom changes. An untouched edit round-trips to a zero diff — the
    explicit default forms of priority, times, and timeToLive are preserved instead of appearing as removals, and a
    genuine reset shows the explicit unlimited form.

  • Dashboard: the Promote to Mocks button no longer wraps in a narrow traffic pane.

  • Dashboard: editing an expectation no longer silently strips fields the form does not model. The composer
    now merges its form output onto the original expectation JSON, preserving scenario bindings, namespaces,
    response sequences, cross-protocol scenarios, and matcher fields such as keepAlive and socketAddress in
    both quick and advanced modes, with an alert listing the preserved fields.

  • Dashboard reliability fixes. Paused breakpoint exchanges survive navigating away from the Breakpoints
    view; stream-frame editing is UTF-8 safe and surfaces encode failures; a reconnect re-sends the active
    request filter instead of silently streaming unfiltered data; an error-only push no longer blanks the
    panels; user-action errors persist until dismissed (and the banner is dismissible); mismatch dialogs report
    honest "differs on N field(s)" scores with remediation hints; and a response template rendering invalid
    output is now surfaced as a TEMPLATE_GENERATION_FAILED event instead of a silent 404 logged as a success.

  • Dashboard performance, measured. Idle pushes no longer re-render every panel each second, hidden tabs
    buffer instead of processing WebSocket updates, and hot parse/search paths are cached — all verified by a
    committed benchmark suite (npm run bench in mockserver-ui) comparing against the pre-optimization
    implementations at small and large payload scales.

  • Automated release publishing for the Ruby and PHP Testcontainers modules. The mockserver-testcontainers/ruby
    and mockserver-testcontainers/php modules now publish automatically as two new soft_fail release-pipeline
    components. tc-ruby (scripts/release/components/tc-ruby.sh) self-bumps the gem version.rb, builds inside the
    pinned Ruby image and gem pushes testcontainers-mockserver to RubyGems (credential from the existing
    mockserver-build/rubygems secret; skips gracefully if absent). tc-php (scripts/release/components/tc-php.sh)
    subtree-splits the module and pushes master + a version tag to the mock-server/mockserver-testcontainers-php
    Packagist mirror repo, mirroring the PHP-client publish; it skips gracefully until that mirror repo is provisioned
    (one-time setup — see mockserver-testcontainers/php/PUBLISHING.md). Both support --dry-run, are release-type
    gated (full/post-maven), and have soft post-release verification checks. See
    docs/operations/release-process.md.

  • **Go client: jwt/allOf matchers, a /v7 module path, and a bundled Testcontai...

Read more

MockServer 7.3.0

Choose a tag to compare

@jamesdbloom jamesdbloom released this 01 Jul 07:03

[7.3.0] - 2026-07-01

Added

  • Typed client methods for control-plane operations that previously needed a hand-written REST call. The
    client libraries gain first-class methods for clock control (freeze / advance / reset / status), metrics
    (the JSON counter snapshot and the Prometheus scrape), configuration read/update, Pact import / export / verify,
    the file store (store / retrieve / list / delete), HAR and Postman import, the high-level operating mode
    (SIMULATE / SPY / CAPTURE), and generating expectations from a WSDL — so these no longer require a manual
    PUT /mockserver/… request. Rolling out across the Java, Node, Python, Ruby, Go, .NET, Rust and PHP clients.

Security

  • Fixture redaction now also masks credentials in query strings and streamed bodies, and fails closed on
    unparseable secrets.
    When redacting recorded traffic (HAR/Postman imports, the LLM optimisation report, the
    MCP capture tools) the redactor previously only masked sensitive headers and named JSON body fields. It now also
    (a) masks the values of credential-bearing query parameters by default (such as key, api_key, apikey,
    access_token, token, signature, sig, and the AWS SigV4 X-Amz-Signature/X-Amz-Security-Token) —
    e.g. Gemini's ?key= API key; (b) redacts configured fields inside each Server-Sent-Events data: payload of
    a streamed body, leaving non-JSON markers such as [DONE] intact (and failing closed on a data: payload it
    cannot parse that still mentions a configured field); and (c) when a body is configured for field redaction but
    cannot be parsed yet still mentions a configured field name, replaces the whole body rather than risk leaking it.
    Ordinary unstructured bodies (plain text, HTML, decoded binary) that mention no configured field are left
    unchanged.
  • A2A client builders: the custom-handler regex messagePattern is now escaped completely. Every client
    library (Java, Node, Python, Ruby, Go, Rust, PHP, .NET) inlines messagePattern into a JSONPath =~ /…/ regex
    literal but previously escaped only the / delimiter, so a pattern ending in a lone backslash (or containing
    \/) could escape the closing delimiter and break out of the regex literal into the surrounding JSONPath/JSON
    (CodeQL rb/incomplete-sanitization). The escaping now preserves valid regex escape sequences (e.g. \d) while
    neutralising the delimiter-breakout; normal patterns are unaffected.
  • Dashboard load-scenario report download now validates the URL scheme. The "download report" action passed a
    URL assembled from the user-configured connection to window.open without checking its scheme; it now opens the
    report only when the URL resolves to http/https, ruling out javascript:/data: redirection (CodeQL
    js/client-side-unvalidated-url-redirection).
  • /bind and /stop now honour control-plane authentication/authorization. These mutating lifecycle
    endpoints were serviced before the auth gate; they now require the same control-plane auth as
    /mockserver/configuration. Default deployments with no control-plane auth configured are unaffected, and
    /status / /ready remain open for health probes. Closes the lifecycle-endpoint gap noted in 7.2.0.
  • MCP tool calls now honour control-plane authorization. With controlPlaneAuthorizationEnabled, each MCP
    tool is classified read vs mutate (fail-closed) and checked against the same role model as the HTTP control
    plane, so a read-only principal can no longer invoke mutating MCP tools (create/clear/reset/…). Default
    (authorization disabled) behaviour is unchanged; enforced across HTTP and HTTP/3, single and batch. Closes
    the per-tool MCP gap noted in 7.2.0.
  • Control-plane JWT validation cross-request race fixed. A single shared JWTValidator reconfigured the
    Nimbus processor (key selector + claims verifier) on every call, so concurrent control-plane requests could be
    verified against another request's policy. The processor is now configured once and validate() is stateless.
  • Remote JWKS / OIDC discovery fetches are now bounded. JWKS-key-set and OIDC discovery-document fetches on
    the authentication path used the JOSE library defaults (infinite connect/read timeout, no size limit); they now
    use finite timeouts and a size cap, so a slow or hostile identity-provider endpoint can no longer hang the auth
    path or be used as an amplification vector.
  • Velocity templates can no longer fetch arbitrary URLs or read local files. The Apache Velocity
    ImportTool (which exposes $import.read(url|file)) was registered in the template toolbox; it has been
    removed, closing an SSRF / local-file-disclosure vector in response templates.
  • mTLS control-plane authentication rejects expired client certificates. Client-certificate authentication
    validated only that the certificate chained to the configured CA; it now also enforces the certificate
    validity window, so an expired or not-yet-valid (but correctly signed) client certificate is rejected.
  • Mock OIDC client-secret comparison is now constant-time.

Added

Load injection, chaos & SRE

  • Chaos experiments can assert an SLO and emit a verdict. A chaos experiment may now carry an optional
    sloCriteria; on termination MockServer attaches a terminal experimentVerdict (PASS / FAIL /
    INCONCLUSIVE) evaluated strictly over the experiment's window — PASS only if every objective held
    throughout, FAIL on any breach or auto-halt, INCONCLUSIVE below the minimum sample count. Turns
    "inject faults" into "verify resilience held."
  • SLO-breach auto-halt for chaos experiments. An experiment carrying sloCriteria is halted immediately
    (status halted_by_slo_breach, verdict FAIL) when an SLO objective is breached mid-run. No behaviour
    change when sloCriteria is absent. The dashboard's chaos panel now shows the terminal experimentVerdict
    (PASS / FAIL / INCONCLUSIVE) with per-objective observed-vs-threshold detail.

Request matching & response generation

  • JavaScript response templates now have a configurable execution timeout. A runaway or malicious
    JavaScript template (for example one containing an infinite loop) could previously pin the data-plane
    worker thread handling that request indefinitely. A new javascriptTemplateExecutionTimeout property
    (milliseconds) caps how long a template may run; on expiry a watchdog cancels the evaluation and the
    request fails fast with a clear, logged timeout error. The default is 5000 (5 seconds), far longer
    than any legitimate template needs. Set it to 0 (or a negative value) to disable the timeout and
    restore the previous unbounded behaviour. NOTE: this introduces a bounded behaviour change — templates
    that genuinely run longer than 5 seconds (previously allowed) will now be cancelled unless the timeout
    is raised or disabled.
  • Mustache response templates can now read scenario state by name. Velocity
    ($scenario.get('orderId')) and JavaScript (scenario.get('orderId')) could already read
    scenario/captured state in a response template; the Mustache engine now exposes the same through a
    section lambda — {{#scenario.get}}orderId{{/scenario.get}}, where the state name is the section
    body (jmustache cannot pass a method argument inline the way Velocity and JavaScript can). This
    completes capture → template value reuse across all three template engines, so an id captured
    from one request can be returned in the response body of a later request regardless of template
    engine. Documented on the Stateful Scenarios page with a per-engine example.
  • Closest-match hint on unmatched requests (closestMatchHintEnabled, default on). When a request
    matches no expectation, the 404 response now carries a compact, length-bounded
    x-mockserver-closest-match-hint header naming the closest expectation and the first field that differed —
    answering "why didn't my mock match?" without enabling verbose diagnostics. Set closestMatchHintEnabled=false
    to suppress. (The opt-in attachMismatchDiagnosticToResponse, which adds a full JSON diagnostic body, is
    unchanged and still off by default.)

OpenAPI & contract testing

  • Validate recorded traffic against an OpenAPI spec (PUT /mockserver/trafficValidate). A new
    control-plane endpoint validates the request/response traffic MockServer has already recorded against a
    provided OpenAPI spec (URL, file path, or inline), returning a structured pass/fail report
    (totalRequests / passed / failed / allPassed plus per-request matchedOperation, requestErrors,
    and responseErrors) — mirroring the /contractTest report. The endpoint is gated by the same
    control-plane authentication as its siblings, and a spec URL is fetched only after passing the same SSRF
    policy enforced on proxy/forward paths.
  • Java client helpers for contract testing & Pact. The Java MockServerClient now exposes fluent, typed
    methods for the contract-testing endpoints: contractTest(spec, baseUrl[, operationId]),
    trafficValidate(spec), pactImport(json), pactExport(consumer, provider), and pactVerify(json). The
    contract-test and traffic-validation reports parse into typed ContractReport / ContractResult objects so
    callers no longer hand-roll raw HTTP.
  • Per-import realistic example generation. OpenAPI imports can now request realistic (Datafaker) example
    values for a single import via a "realisticValues": true entry in the reserved __generationOptions__
    map (alongside the existing seed and fieldOverrides options), without changing the global
    generateRealisticExampleValues configuration. When the entry is absent, behaviour is unchanged and the
    global default still applies.

Dashboard UI

  • New "MCP Health" dashboard panel. When a coding-assistant CLI is proxied through MockServer, its MCP
    ser...
Read more