# CVE-2023-41329: Domain restrictions bypass via DNS Rebinding in WireMock and WireMock Studio

> Attackers can bypass domain restrictions in WireMock proxy mode via DNS rebinding, allowing access to prohibited internal network targets.

- **Severity:** Low 3.9 (`CVSS:3.1/AV:A/AC:H/PR:H/UI:N/S:U/C:L/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Sep 2023
- **Updated:** 26 Sep 2024
- **Also known as:** BIT-wiremock-2023-41329, GHSA-pmxq-pj47-j8j4, PYSEC-2026-2050

## What is CVE-2023-41329?

CVE-2023-41329 is a low-severity server-side request forgery vulnerability in wiremock, published on 6 Sep 2023. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

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.

Weakness: CWE-290 (Authentication Bypass by Spoofing)

## Which versions are affected by CVE-2023-41329?

12 open source packages ship an affected version, including wiremock, com.github.tomakehurst:wiremock-jre8 and com.github.tomakehurst:wiremock-jre8-standalone. It affects 4 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `wiremock` | Bitnami | All versions | 2.35.1, 3.0.3 |
| `wiremock` | PyPI | All versions | 2.6.1 |
| `wiremock` | PyPI | All versions | 2.6.1 |
| `wiremock` | PyPI | All versions | 2.6.1 |
| `com.github.tomakehurst:wiremock-jre8` | Maven | All versions | 2.35.1 |
| `com.github.tomakehurst:wiremock-jre8` | Maven | All versions | 2.35.1 |
| `com.github.tomakehurst:wiremock-jre8-standalone` | Maven | All versions | 2.35.1 |
| `com.github.tomakehurst:wiremock-jre8-standalone` | Maven | All versions | 2.35.1 |
| `org.wiremock:wiremock` | Maven | All versions | 3.0.3 |
| `org.wiremock:wiremock` | Maven | All versions | 3.0.3 |
| `org.wiremock:wiremock-standalone` | Maven | All versions | 3.0.3 |
| `org.wiremock:wiremock-standalone` | Maven | All versions | 3.0.3 |

Products: Wiremock Python Wiremock, Wiremock Studio, Wiremock Wiremock, Wiremock Wiremock Docker.

## How do I fix CVE-2023-41329?

Upgrade wiremock to a fixed version for your release line: 2.35.1, 3.0.3 or 2.6.1.

## Is CVE-2023-41329 being exploited?

There is no known exploitation of CVE-2023-41329 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-41329 and fix it if it is affected.

What it is: CVE-2023-41329 is a low-severity server-side request forgery vulnerability in wiremock, published on 6 Sep 2023. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-41329 in the wild and no public exploit code.

Affected packages and fixed versions:
- wiremock (Bitnami): affected all versions; fixed in 2.35.1, 3.0.3
- wiremock (PyPI): affected all versions; fixed in 2.6.1
- wiremock (PyPI): affected all versions; fixed in 2.6.1
- wiremock (PyPI): affected all versions; fixed in 2.6.1
- com.github.tomakehurst:wiremock-jre8 (Maven): affected all versions; fixed in 2.35.1
- com.github.tomakehurst:wiremock-jre8 (Maven): affected all versions; fixed in 2.35.1
- com.github.tomakehurst:wiremock-jre8-standalone (Maven): affected all versions; fixed in 2.35.1
- com.github.tomakehurst:wiremock-jre8-standalone (Maven): affected all versions; fixed in 2.35.1
- org.wiremock:wiremock (Maven): affected all versions; fixed in 3.0.3
- org.wiremock:wiremock (Maven): affected all versions; fixed in 3.0.3
- org.wiremock:wiremock-standalone (Maven): affected all versions; fixed in 3.0.3
- org.wiremock:wiremock-standalone (Maven): affected all versions; fixed in 3.0.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-41329/ (Markdown: https://insights.sbomify.com/CVE-2023-41329/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-41329
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-41329
- OSV: https://osv.dev/vulnerability/CVE-2023-41329

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-41329/
Summaries are generated and may contain mistakes; the official description above is the record.
