CVE-2021-31671: Pgsync Pgsync Contains Cleartext Transmission Of Vulnerability

HIGH
Advisory Identifier: GHSA-72rj-36qc-47g7
CVSS 7.5
CWE-319
Published
Advisory Summary

CVE-2021-31671 is a HIGH (CVSS 7.5) pgsync contains cleartext transmission of vulnerability (CWE-319: Cleartext Transmission of Sensitive Information) affecting Pgsync libraries in the RubyGems ecosystem. The issue involves pgsync contains cleartext transmission of sensitive information. Remediation is available by upgrading affected packages to version 0.6.7.

CVE-2021-31671 at a Glance

CVE Identifier CVE-2021-31671
GHSA Identifier GHSA-72rj-36qc-47g7
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-319: Cleartext Transmission of Sensitive Information
Affected Product Pgsync
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2021-31671

To remediate this vulnerability, upgrade all affected Pgsync dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pgsync fixed: 0.6.7
Upgrade pgsync to 0.6.7
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for pgsync

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-31671, inspect your project dependencies for Pgsync:

inspect dependencies for pgsync

Analyze the terminal output to locate any version of Pgsync in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.6.7), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-319: Cleartext Transmission of Sensitive Information, where the product transmits sensitive or security-critical data in cleartext in a communication channel that can be sniffed by unauthorized actors. In Pgsync, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

pgsync before 0.6.7 is affected by Information Disclosure of sensitive information. Syncing the schema with the `--schema-first` and `--schema-only` options is mishandled. For example, the sslmode connection parameter may be lost, which means that SSL would not be used.

CVE-2021-31671 Affected Pgsync Versions

1 component(s)
Fixed Versions:
0.6.7
Product / Package Ecosystem Affected Versions Fixed Version
pgsync
RubyGems
< 0.6.7
0.6.7

References

Frequently Asked Questions

What is CVE-2021-31671?
CVE-2021-31671 is a security vulnerability in Pgsync involving Pgsync Contains Cleartext Transmission of Sensitive Information under CWE-319: Cleartext Transmission of Sensitive Information.
Which Pgsync versions are affected?
Affected versions include releases prior to 0.6.7 across affected packages: pgsync.
What version fixes CVE-2021-31671?
Upgrading to 0.6.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pgsync affected?
Yes, pgsync is affected in releases prior to 0.6.7. Upgrade your dependency to 0.6.7 or later.
What is the CVSS score of CVE-2021-31671?
CVE-2021-31671 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2021-31671?
CVE-2021-31671 is classified under CWE-319: Cleartext Transmission of Sensitive Information (The product transmits sensitive or security-critical data in cleartext in a communication channel that can be sniffed by unauthorized actors.).
How can I check RubyGems dependencies for CVE-2021-31671?
Run the dependency tree command: 'inspect dependencies for pgsync'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-72rj-36qc-47g7",
  "modified" : "2023-08-25T22:09:00Z",
  "published" : "2021-04-27T15:54:52Z",
  "aliases" : [ "CVE-2021-31671" ],
  "summary" : "Pgsync Contains Cleartext Transmission of Sensitive Information",
  "details" : "pgsync before 0.6.7 is affected by Information Disclosure of sensitive information. Syncing the schema with the `--schema-first` and `--schema-only` options is mishandled. For example, the sslmode connection parameter may be lost, which means that SSL would not be used.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "pgsync"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.6.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-31671"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ankane/pgsync/issues/121"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ankane/pgsync/commit/05cd18f5fc09407e4b544f2c12f819cabc50c40e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ankane/pgsync/blob/master/CHANGELOG.md#067-2021-04-26"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/pgsync/CVE-2021-31671.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-319" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-04-27T15:54:16Z",
    "nvd_published_at" : "2021-04-27T03:15:00Z"
  }
}