CVE-2019-9039: SQL Injection in Couchbase Sync Gateway

Summary

15/02/2022
Yes i
Critical
9.8

CVE-2019-9039: SQL Injection in Couchbase Sync Gateway. Affects github.com/couchbase/sync_gateway versions < 2.5.0. Fixed in 2.5.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Couchbase Sync Gateway is a component that synchronizes data between Couchbase Server and mobile devices. It provides a REST API for accessing and managing data. The vulnerability affects version 2.1.2 of Couchbase Sync Gateway in combination with a Couchbase Server. The REST API of the Sync Gateway is susceptible to a previously undisclosed N1QL-injection vulnerability. This vulnerability allows an attacker with access to the public REST API to insert additional N1QL statements through the parameters ?startkey? and ?endkey? of the ?_all_docs? endpoint.

Vulnerability Detail

The N1QL-injection vulnerability in Couchbase Sync Gateway's REST API can be exploited by an attacker to execute arbitrary N1QL statements. By manipulating the ?startkey? and ?endkey? parameters of the ?_all_docs? endpoint, an attacker can inject malicious N1QL code, leading to unauthorized access, data manipulation, or even remote code execution. This vulnerability has a CVSS score of 9.8, indicating its critical severity.

How To Fix

Minimum fixed version

2.5.0

This is the first release that contains the fix.

go get github.com/couchbase/sync_gateway@v2.5.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the latest version is not immediately possible, a temporary workaround is to restrict access to the public REST API of Couchbase Sync Gateway. This can be achieved by implementing network-level access controls or using a firewall to block access to the affected endpoints. However, applying the workaround is not a permanent solution, and upgrading to the fixed version is strongly advised.

Conclusion

The N1QL-injection vulnerability in Couchbase Sync Gateway's REST API poses a critical security risk. It allows an attacker to execute arbitrary N1QL statements, potentially leading to unauthorized access, data manipulation, or remote code execution. It is crucial to upgrade to the fixed version of Couchbase Sync Gateway (2.5.0 or later) to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for github.com/couchbase/sync_gateway →

Share this vulnerability

FAQ

Couchbase Sync Gateway is a component that synchronizes data between Couchbase Server and mobile devices. It provides a REST API for accessing and managing data.

N1QL is a query language used by Couchbase Server to interact with JSON documents. It allows for powerful querying and manipulation of data.

The N1QL-injection vulnerability in Couchbase Sync Gateway's REST API allows an attacker to insert additional N1QL statements through the ?startkey? and ?endkey? parameters of the ?_all_docs? endpoint. This can lead to unauthorized access, data manipulation, or remote code execution.

This vulnerability has a CVSS score of 9.8, indicating its critical severity.

To fix this vulnerability, it is recommended to upgrade to version 2.5.0 or later of Couchbase Sync Gateway. Upgrade instructions can be found in the official documentation.

Related vulnerabilities

Recent vulnerabilities recorded for github.com/couchbase/sync_gateway.

How To Fix

Minimum fixed version

2.5.0

This is the first release that contains the fix.

go get github.com/couchbase/sync_gateway@v2.5.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback