# CVE-2023-41327: Controlled SSRF through URL in the WireMock

> Attackers can bypass proxy restrictions in WireMock webhooks to send requests to internal services, potentially accessing sensitive data or bypassing security controls.

- **Severity:** Medium 4.6 (`CVSS:3.1/AV:A/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 6 Sep 2023
- **Updated:** 26 Sep 2024
- **Also known as:** BIT-wiremock-2023-41327, GHSA-hq8w-9w8w-pmx7

## What is CVE-2023-41327?

CVE-2023-41327 is a medium-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, and only if a user opens a file or follows a link.

### Official description

WireMock is a tool for mocking HTTP services. WireMock can be configured to only permit proxying (and therefore recording) to certain addresses. This is achieved via a list of allowed address rules and a list of denied address rules, where the allowed list is evaluated first. 

Until WireMock Webhooks Extension 3.0.0-beta-15, the filtering of target addresses from the proxy mode DID NOT work for Webhooks, so the users were potentially vulnerable regardless of the `limitProxyTargets` settings. Via the WireMock webhooks configuration, POST requests from a webhook might be forwarded to an arbitrary service reachable from WireMock’s instance. For example, If someone is running the WireMock docker Container inside a private cluster, they can trigger internal POST requests against unsecured APIs or even against secure ones by passing a token, discovered using another exploit, via authentication headers. This issue has been addressed in versions 2.35.1 and 3.0.3 of wiremock. Wiremock studio has been discontinued and will not see a fix. Users unable to upgrade should use external firewall rules to define the list of permitted destinations.

Weakness: CWE-918 (Server-Side Request Forgery)

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

5 open source packages ship an affected version, including org.wiremock:wiremock-webhooks-extension and wiremock. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.wiremock:wiremock-webhooks-extension` | Maven | From 2.0.0 | 2.35.1 |
| `org.wiremock:wiremock-webhooks-extension` | Maven | From 2.0.0 | 2.35.1 |
| `org.wiremock:wiremock-webhooks-extension` | Maven | From 3.0.0 | 3.0.3 |
| `org.wiremock:wiremock-webhooks-extension` | Maven | From 3.0.0 | 3.0.3 |
| `wiremock` | Bitnami | From 2.0.0 | 2.35.1, 3.0.3 |

Products: Wiremock Studio, Wiremock Wiremock.

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

Upgrade org.wiremock:wiremock-webhooks-extension to a fixed version for your release line: 2.35.1 or 3.0.3.

## Is CVE-2023-41327 being exploited?

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

## Other vulnerabilities in wiremock

- [CVE-2023-39967](https://insights.sbomify.com/CVE-2023-39967/): Full read and controlled SSRF through URL parameter when testing a request inside wiremock-studio (critical 10.0)

## Fix prompt for AI coding agents

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

What it is: CVE-2023-41327 is a medium-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, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2023-41327 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.wiremock:wiremock-webhooks-extension (Maven): affected from 2.0.0; fixed in 2.35.1
- org.wiremock:wiremock-webhooks-extension (Maven): affected from 2.0.0; fixed in 2.35.1
- org.wiremock:wiremock-webhooks-extension (Maven): affected from 3.0.0; fixed in 3.0.3
- org.wiremock:wiremock-webhooks-extension (Maven): affected from 3.0.0; fixed in 3.0.3
- wiremock (Bitnami): affected from 2.0.0; fixed in 2.35.1, 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-41327/ (Markdown: https://insights.sbomify.com/CVE-2023-41327/index.md)
```

## Sources

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

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