Skip to content

Domain restrictions bypass via DNS Rebinding in WireMock and WireMock Studio webhooks, proxy and recorder modes

Low severity GitHub Reviewed Published Sep 6, 2023 in wiremock/wiremock • Updated Nov 7, 2023

Package

maven com.github.tomakehurst:wiremock-jre8 (Maven)

Affected versions

< 2.35.1

Patched versions

2.35.1
maven com.github.tomakehurst:wiremock-jre8-standalone (Maven)
< 2.35.1
2.35.1
maven org.wiremock:wiremock (Maven)
< 3.0.3
3.0.3
maven org.wiremock:wiremock-standalone (Maven)
< 3.0.3
3.0.3
pip wiremock (pip)
< 2.6.1
2.6.1

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

References

@oleg-nenashev oleg-nenashev published to wiremock/wiremock Sep 6, 2023
Published by the National Vulnerability Database Sep 6, 2023
Published to the GitHub Advisory Database Sep 8, 2023
Reviewed Sep 8, 2023
Last updated Nov 7, 2023

Severity

Low

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Adjacent
Attack complexity
High
Privileges required
High
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:A/AC:H/PR:H/UI:N/S:U/C:L/I:L/A:L

EPSS score

0.070%
(32nd percentile)

CVE ID

CVE-2023-41329

GHSA ID

GHSA-pmxq-pj47-j8j4

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.