Domain restrictions bypass via DNS Rebinding in WireMock and WireMock Studio
wiremock
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| org.wiremock:wiremock-standalone Maven |
|
|
| org.wiremock:wiremock Maven |
|
|
| com.github.tomakehurst:wiremock-jre8 |
wiremock
| Product | Affected | Fixed in |
|---|---|---|
| org.wiremock:wiremock-standalone Maven |
|
|
| org.wiremock:wiremock Maven |
|
|
| com.github.tomakehurst:wiremock-jre8 |
|
|
| com.github.tomakehurst:wiremock-jre8-standalone Maven |
|
|
| wiremock PyPI |
|
|
WireMock is a tool for mocking HTTP services. 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. This issue has been addressed in version 2.35.1 of wiremock-jre8 and wiremock-jre8-standalone, version 3.0.3 of wiremock and wiremock-standalone, version 2.6.1 of the python version of wiremock, and versions 2.35.1-1 and 3.0.3-1 of the wiremock/wiremock Docker container. Users are advised to upgrade. Users unable to upgrade should either configure firewall rules to define the list of permitted destinations or to configure WireMock to use IP addresses instead of the domain names.
From the CVE record · GitHub_M
WireMock proxy mode is vulnerable to DNS rebinding when network restrictions use domain names. An attacker who controls a DNS service can exploit a race between address validation and the outbound request, potentially causing WireMock to connect to a prohibited destination.
Check deployments using Maven WireMock packages below 3.0.3, Maven wiremock-jre8 packages below 2.35.1, or PyPI wiremock below 2.6.1; also check WireMock Docker deployments.