Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-19858

SQLi (SQL Injection) org.postgresql:postgresql Dependency in Bitbucket Data Center and Server

    • 7.1
    • High
    • CVE-2022-31197
    • Atlassian (Internal)
    • CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H
    • SQLi (SQL Injection)
    • Bitbucket Data Center, Bitbucket Server

      This High severity org.postgresql:postgresql Dependency vulnerability was introduced in version 8.0 of Bitbucket Data Center. A version of the PostgreSQL JDBC driver is bundled in the Mesh Application (/app/WEB-INF/mesh/mesh-app.jar) however Mesh does not use the PostgreSQL driver, rather it uses a H2 embedded database. The fix delivered is to no longer bundle the unused PostgreSQL driver in the mesh-app.jar.

      This org.postgresql:postgresql Dependency vulnerability, with a CVSS Score of 7.1 and a CVSS Vector of CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H allows an authenticated attacker to expose assets in your environment susceptible to exploitation which has high impact to confidentiality, high impact to integrity, high impact to availability, and requires user interaction.

      Atlassian recommends that Bitbucket Data Center and Server customers upgrade to latest version, if you are unable to do so, upgrade your instance to one of the specified supported fixed versions:

      • Bitbucket Data Center and Server 8.9: Upgrade to a release greater than or equal to 8.9.25
      • Bitbucket Data Center and Server 8.19: Upgrade to a release greater than or equal to 8.19.15
      • Bitbucket Data Center and Server 9.4: Upgrade to a release greater than or equal to 9.4.3
      • Bitbucket Data Center and Server 9.5: Upgrade to a release greater than or equal to 9.5.1
      • Bitbucket Data Center and Server 9.6: Upgrade to a release greater than or equal to 9.6.0

      See the release notes (https://confluence.atlassian.com/bitbucketserver/release-notes). You can download the latest version of Bitbucket Data Center and Server from the download center (https://www.atlassian.com/software/bitbucket/download-archives).

      The National Vulnerability Database provides the following description for this vulnerability: PostgreSQL JDBC Driver (PgJDBC for short) allows Java programs to connect to a PostgreSQL database using standard, database independent Java code. The PGJDBC implementation of the `java.sql.ResultRow.refreshRow()` method is not performing escaping of column names so a malicious column name that contains a statement terminator, e.g. `;`, could lead to SQL injection. This could lead to executing additional SQL commands as the application's JDBC user. User applications that do not invoke the `ResultSet.refreshRow()` method are not impacted. User application that do invoke that method are impacted if the underlying database that they are querying via their JDBC application may be under the control of an attacker. The attack requires the attacker to trick the user into executing SQL against a table name who's column names would contain the malicious SQL and subsequently invoke the `refreshRow()` method on the ResultSet. Note that the application's JDBC user and the schema owner need not be the same. A JDBC application that executes as a privileged user querying database schemas owned by potentially malicious less-privileged users would be vulnerable. In that situation it may be possible for the malicious user to craft a schema that causes the application to execute commands as the privileged user. Patched versions will be released as `42.2.26` and `42.4.1`. Users are advised to upgrade. There are no known workarounds for this issue.

          Form Name

            [BSERV-19858] SQLi (SQL Injection) org.postgresql:postgresql Dependency in Bitbucket Data Center and Server

            Question: Is this a problem even if Bitbucket is not mesh configured?

            henrik.gerdtsson added a comment - Question: Is this a problem even if Bitbucket is not mesh configured?

              Unassigned Unassigned
              security-metrics-bot Security Metrics Bot
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: