CVE-2023-41329
Domain restrictions bypass via DNS Rebinding in WireMock and WireMock Studio webhooks, proxy and recorder modes
Description
Impact
The proxy mode of WireMock, can be protected by the network restrictions configuration, as documented in Preventing proxying to and recording from specific target addresses. These restrictions can be configured using the domain names, and in such a case the configuration is vulnerable to the DNS rebinding attacks. A similar patch was applied in WireMock 3.0.0-beta-15 for the WireMock Webhook Extensions.
The root cause of the attack is a defect in the logic which allows for a race condition triggered by a DNS server whose address expires in between the initial validation and the outbound network request that might go to a domain that was supposed to be prohibited. Control over a DNS service is required to exploit this attack, so it has high execution complexity and limited impact.
Affected versions
- WireMock 3,x until 3.0.3 (security patch), on default settings in environments with access to the network
- WireMock 2.x until 2.35.1 (security patch), on default settings in environments with access to the network
- Python WireMock until 2.6.1
- WireMock Studio - all versions, this proprietary product was discontinued in 2022
Patches
- WireMock 3.0.3 + the 3.0.3-1 Docker image
- WireMock 2.35.1 + the 2.35.1-1 Docker image - backport to WireMock 2.x
- Python WireMock 2.6.1
Workarounds
For WireMock:
- Option 1: Configure WireMock to use IP addresses instead of the domain names in the outbound URLs subject to DNS rebinding
- Option 2: Use external firewall rules to define the list of permitted destinations
For WireMock Studio: N/A. Switch to another distribution, there will be no fix provided. The vendor of former WireMock Studio recommends migration to WireMock Cloud
References
- CVE-2023-41327 - Related issue in the WireMock Webhooks Extension
Affected Maven artifacts (4)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| com.github.tomakehurst » wiremock-jre8 | < 2.35.1 | 2.35.1 |
| com.github.tomakehurst » wiremock-jre8-standalone | < 2.35.1 | 2.35.1 |
| org.wiremock » wiremock | < 3.0.3 | 3.0.3 |
| org.wiremock » wiremock-standalone | < 3.0.3 | 3.0.3 |
Blast radius
36% of the dependent artifacts (181) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 6,942 |
| 2 hops | 7,490 |
| 3 hops | 5,902 |
| 4 hops | 1,700 |
| 5 hops | 92 |
| 6 hops | 51 |
Most used dependents
- org.apache.camel.quarkus » camel-quarkus-maven-plugin302 usages
- uk.gov.hmrc » bootstrap-test-play-27146 usages
- org.apache.camel » camel-catalog87 usages
- org.springframework.cloud » spring-cloud-contract-wiremock61 usages
- io.gravitee.apim.gateway » gravitee-apim-gateway-tests-sdk55 usages
- com.atlassian.bitbucket.server » bitbucket-it-common54 usages
- com.atlassian.bitbucket.server » bitbucket-page-objects53 usages
- org.apache.camel.quarkus » camel-quarkus-integration-wiremock-support43 usages
- org.springframework.cloud » spring-cloud-contract-verifier34 usages
- io.micrometer » micrometer-test33 usages
- org.springframework.cloud » spring-cloud-starter-contract-stub-runner33 usages
- org.openrewrite.recipe » rewrite-testing-frameworks33 usages
- nl.vpro.shared » vpro-shared-util32 usages
- nl.vpro.shared » vpro-shared-test31 usages
- org.marvelution.testing » testkit30 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects PyPI (1 package) . See all on OSV
References
| Advisory | NVD CVE-2023-41329 | nvd.nist.gov |
| Package | wiremock/wiremock | github.com |
| Web | wiremock/wiremock advisory GHSA-pmxq-pj47-j8j4 | github.com |
| Web | docs/configuration | wiremock.org |
