RADAR-base / RADAR-Rest-Source-Auth

A simple application to support authorization of wearable devices using OAuth using a webservice with REST Endpoints.
https://radar-base.org/
Apache License 2.0
1 stars 0 forks source link

SQL Injection SNYK-JAVA-ORGPOSTGRESQL-2970521 #206

Closed github-actions[bot] closed 1 year ago

github-actions[bot] commented 1 year ago

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:

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.4.1 or higher.

References