CVE-2019-9039 json
SQL Injection in Couchbase Sync Gateway
published 7y ago modified 4mo ago also GHSA-g622-r636-qfqh , EUVD-2022-0999
- cvss
- 9.8
- version 3.0, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 2.7%
- EPSS 2.7% chance of exploitation in 30 days, percentile 86%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
Is CVE-2019-9039 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerExploit prediction
2.74% chance of exploitation in the next 30 days, higher than 86% of all scored CVEs (FIRST EPSS, 2026-11-09).
Exploits and checks
- research.hisolutions.com https://research.hisolutions.com/2019/06/n1ql-injection-in-couchbase-sync-gateway-cve-2019-9039/ referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.0 | 9.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 7.5 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
| GitHub | 3.0 | 9.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| go | github.com/couchbase/sync_gateway | <2.5.0 |
2.5.0 |
Classification
- Weakness
-
- CWE-89 Improper Neutralization of Special Elements used in an SQL Command
References
-
github.com
/couchbase/sync_gateway/commit/97adb5b496aa96aa70398018ea96da913ffd8d8c
web
-
research.hisolutions.com
/2019/06/n1ql-injection-in-couchbase-sync-gateway-cve-2019-9039/
exploit, third-party-advisory
-
docs.couchbase.com
/sync-gateway/2.5/release-notes.html
web, release-notes, vendor-advisory
-
couchbase.com
/resources/security#SecurityAlerts
web
-
nvd.nist.gov
/vuln/detail/CVE-2019-9039
advisory
-
research.hisolutions.com
/2019/06/n1ql-injection-in-couchbase-sync-gateway-cve-2019-9039
web
Sources
- CVE List CVE-2019-9039
- GitHub Advisory GHSA-g622-r636-qfqh
- NVD CVE-2019-9039
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.