Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency org.postgresql:postgresql to v42.5.5 [SECURITY] #30

Open
wants to merge 1 commit into
base: sprint
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Mar 25, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
org.postgresql:postgresql (source) 42.5.4 -> 42.5.5 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2024-1597

Impact

SQL injection is possible when using the non-default connection property preferQueryMode=simple in combination with application code that has a vulnerable SQL that negates a parameter value.

There is no vulnerability in the driver when using the default query mode. Users that do not override the query mode are not impacted.

Exploitation

To exploit this behavior the following conditions must be met:

  1. A placeholder for a numeric value must be immediately preceded by a minus (i.e. -)
  2. There must be a second placeholder for a string value after the first placeholder on the same line.
  3. Both parameters must be user controlled.

The prior behavior of the driver when operating in simple query mode would inline the negative value of the first parameter and cause the resulting line to be treated as a -- SQL comment. That would extend to the beginning of the next parameter and cause the quoting of that parameter to be consumed by the comment line. If that string parameter includes a newline, the resulting text would appear unescaped in the resulting SQL.

When operating in the default extended query mode this would not be an issue as the parameter values are sent separately to the server. Only in simple query mode the parameter values are inlined into the executed SQL causing this issue.

Example

PreparedStatement stmt = conn.prepareStatement("SELECT -?, ?");
stmt.setInt(1, -1);
stmt.setString(2, "\nWHERE false --");
ResultSet rs = stmt.executeQuery();

The resulting SQL when operating in simple query mode would be:

SELECT --1,'
WHERE false --'

The contents of the second parameter get injected into the command. Note how both the number of result columns and the WHERE clause of the command have changed. A more elaborate example could execute arbitrary other SQL commands.

Patch

Problem will be patched upgrade to 42.7.2, 42.6.1, 42.5.5, 42.4.4, 42.3.9, 42.2.28, 42.2.28.jre7

The patch fixes the inlining of parameters by forcing them all to be serialized as wrapped literals. The SQL in the prior example would be transformed into:

SELECT -('-1'::int4), ('
WHERE false --')

Workarounds

Do not use the connection propertypreferQueryMode=simple. (NOTE: If you do not explicitly specify a query mode then you are using the default of extended and are not impacted by this issue.)


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/maven-org.postgresql-postgresql-vulnerability branch from b78de52 to 9944b14 Compare March 25, 2024 08:29
@renovate renovate bot force-pushed the renovate/maven-org.postgresql-postgresql-vulnerability branch 3 times, most recently from 424faed to 02df653 Compare April 15, 2024 13:30
@renovate renovate bot force-pushed the renovate/maven-org.postgresql-postgresql-vulnerability branch from 02df653 to 4e98908 Compare April 17, 2024 12:52
@renovate renovate bot changed the title Update dependency org.postgresql:postgresql to v42.5.5 [SECURITY] Update dependency org.postgresql:postgresql to v42.5.5 [SECURITY] - autoclosed Apr 23, 2024
@renovate renovate bot closed this Apr 23, 2024
@renovate renovate bot deleted the renovate/maven-org.postgresql-postgresql-vulnerability branch April 23, 2024 01:43
@renovate renovate bot restored the renovate/maven-org.postgresql-postgresql-vulnerability branch April 23, 2024 03:14
@renovate renovate bot changed the title Update dependency org.postgresql:postgresql to v42.5.5 [SECURITY] - autoclosed Update dependency org.postgresql:postgresql to v42.5.5 [SECURITY] Apr 23, 2024
@renovate renovate bot reopened this Apr 23, 2024
@renovate renovate bot force-pushed the renovate/maven-org.postgresql-postgresql-vulnerability branch 3 times, most recently from 0194541 to 10f6d49 Compare April 24, 2024 13:18
@renovate renovate bot force-pushed the renovate/maven-org.postgresql-postgresql-vulnerability branch 2 times, most recently from 8b4660d to 9f80e35 Compare May 13, 2024 07:57
@renovate renovate bot force-pushed the renovate/maven-org.postgresql-postgresql-vulnerability branch 2 times, most recently from bc60268 to 301003f Compare June 24, 2024 14:00
@renovate renovate bot force-pushed the renovate/maven-org.postgresql-postgresql-vulnerability branch from 301003f to a21c864 Compare July 23, 2024 06:48
@renovate renovate bot force-pushed the renovate/maven-org.postgresql-postgresql-vulnerability branch from a21c864 to 5fcb0c7 Compare August 14, 2024 14:02
@renovate renovate bot force-pushed the renovate/maven-org.postgresql-postgresql-vulnerability branch 2 times, most recently from 92791fc to a5bd05b Compare October 16, 2024 08:05
@renovate renovate bot force-pushed the renovate/maven-org.postgresql-postgresql-vulnerability branch 3 times, most recently from 3375b6b to 9ee13ff Compare November 21, 2024 14:34
@renovate renovate bot force-pushed the renovate/maven-org.postgresql-postgresql-vulnerability branch from 9ee13ff to db28566 Compare December 2, 2024 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant