Time-of-Check Time-of-Use (TOCTOU) Race Condition Affecting postgresql package, versions [,12.20) [13.0,13.16) [14.0,14.13) [15.0,15.8) [16.0,16.4)


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    EPSS
    0.05% (21st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-UNMANAGED-POSTGRESQL-7660065
  • published 9 Aug 2024
  • disclosed 8 Aug 2024
  • credit Noah Misch

How to fix?

Upgrade postgresql to version 12.20, 13.16, 14.13, 15.8, 16.4 or higher.

Overview

Affected versions of this package are vulnerable to Time-of-Check Time-of-Use (TOCTOU) Race Condition in the pg_dump command. A user can execute arbitrary SQL by replacing another relation type with a view or foreign table. While the victim needs to run pg_dump to be vulnerable, the attacker can exploit the race condition reliably by leaving a transaction open.

CVSS Scores

version 4.0
version 3.1
Expand this section

Snyk

Recommended
8.7 high
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Attack Requirements (AT)
    None
  • Privileges Required (PR)
    Low
  • User Interaction (UI)
    None
  • Confidentiality (VC)
    High
  • Integrity (VI)
    High
  • Availability (VA)
    High
  • Confidentiality (SC)
    None
  • Integrity (SI)
    None
  • Availability (SA)
    None