CVE-2026-6474
Medium · 4.3CVSS
4.3
EPSS
0.2%
Published
May 14, 2026
CISA due date
—
Cloudanix analysis
A flaw in some PostgreSQL versions could let a logged-in database user trick the server into revealing small pieces of information from its memory.
- Exploitation
- Remote Authenticated
- Attacker needs
- Low Privilege
- Complexity
- Moderate
- Impact
- Data Exposure
- Component
- Network Service
- Class
- Information Disclosure
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
This vulnerability is an externally controlled format string flaw in PostgreSQL's timeofday() function. An authenticated attacker who can execute SQL can supply a crafted time zone value and then invoke timeofday(), causing PostgreSQL to treat attacker-controlled time zone content as a format string. The practical impact described is information disclosure: portions of PostgreSQL server process memory may be returned in query results. The CVSS vector indicates network reachability, low attack complexity, required low privileges, no user interaction, and limited confidentiality impact, with no stated integrity or availability impact.
Why it matters to the business
An attacker with database access could potentially read small fragments of PostgreSQL server memory. Depending on what is present in memory at the time, this could expose sensitive operational data such as query contents, application data fragments, credentials, tokens, or connection details. The issue affects PostgreSQL versions before 18.4, 17.10, 16.14, 15.18, and 14.23. Although it is not currently listed in CISA KEV, has low EPSS, and no public exploit maturity is reported, database memory disclosure should still be treated seriously where PostgreSQL is internet-accessible, shared by multiple applications, or used in regulated environments.
How an attack unfolds
An attacker first obtains a PostgreSQL account or reaches an application feature that allows execution of attacker-controlled SQL. The attacker then sets the session time zone to a specially crafted value containing format string tokens. After changing the session time zone, the attacker calls the timeofday() function. Because the vulnerable PostgreSQL versions mishandle externally controlled formatting in this path, the returned value may include unintended bytes from the PostgreSQL server process memory. The attacker can repeat the process with different crafted time zone values to attempt to disclose additional memory fragments. Exploitation does not require operating system access or user interaction, but it does require SQL execution privileges.
How to fix it
Upgrade PostgreSQL to a fixed release for the deployed major version: PostgreSQL 18.4 or later, 17.10 or later, 16.14 or later, 15.18 or later, or 14.23 or later. If immediate upgrade is not possible, reduce exposure by restricting direct database network access, enforcing least-privilege database roles, preventing untrusted users from executing arbitrary SQL, monitoring and limiting use of session-level TimeZone changes by non-administrative roles, and reviewing application features that pass user-controlled SQL or time zone values to PostgreSQL. PostgreSQL 13 and older are outside the fixed-version list and should be migrated to a supported fixed branch if still in use.
How to confirm the fix worked
Confirm the running PostgreSQL version with SELECT version(); or by checking the package manager inventory, container image tag, or vendor build metadata. Verify that every affected major branch has been upgraded to at least 18.4, 17.10, 16.14, 15.18, or 14.23. Validate that replicas, standby nodes, containers, development databases, and managed-service instances are also on fixed builds. Review database access controls to confirm that only trusted roles can execute arbitrary SQL. If statement logging or audit logging is available, test that TimeZone changes and timeofday() calls are captured so future exploitation attempts can be investigated.
Typical attack path
- Gain valid PostgreSQL credentials, compromise an application account with database access, or find an injection path that permits SQL execution.
- Connect to a vulnerable PostgreSQL server running a version before 18.4, 17.10, 16.14, 15.18, or 14.23.
- Set the session TimeZone parameter to a crafted value containing format string sequences.
- Invoke SELECT timeofday(); or an equivalent SQL path that calls timeofday().
- Inspect the returned time string for leaked PostgreSQL server memory contents.
- Repeat with variations of the crafted time zone value to attempt to disclose additional memory fragments.
- Use any exposed secrets, query data, or operational details to support further compromise.
How to detect it
To determine whether exploitation has already occurred, review PostgreSQL statement logs, pgaudit logs, database proxy logs, application SQL logs, and authentication/session logs. Focus on sessions that set or changed the TimeZone parameter and then called timeofday(), especially from low-privileged application accounts, unfamiliar source IP addresses, unusual client applications, or accounts that do not normally run diagnostic SQL. Look for crafted TimeZone values containing printf-style format tokens such as %p, %x, %s, %n, excessive percent characters, long malformed time zone strings, or repeated invalid TimeZone errors. Also review query results, application error logs, and database client logs for anomalous timeofday() output containing hexadecimal-looking memory values, unexpected strings, or non-time data. Because exploitation may only return data in query results and may not create files or processes on the server, absence of operating system artifacts does not rule out exploitation.
- SELECT timeofday()
- timeofday()
- SET TimeZone
- SET timezone
- SET TIME ZONE
- set_config('TimeZone'
- invalid value for parameter "TimeZone"
- TimeZone=%p
- TimeZone=%x
- TimeZone=%s
- TimeZone=%n
- SET TimeZone TO '%p
- SET TimeZone TO '%x
- SET TimeZone TO '%s
- SET TimeZone TO '%n
- SET TIME ZONE '%p
- SET TIME ZONE '%x
- SET TIME ZONE '%s
- SET TIME ZONE '%n
What your security team should do
- Prioritize patching PostgreSQL instances that are internet-facing, reachable from shared application tiers, or used by multiple tenants or applications.
- Upgrade to PostgreSQL 18.4, 17.10, 16.14, 15.18, or 14.23 or later depending on the deployed major version.
- Inventory all PostgreSQL servers, containers, and managed instances to identify vulnerable versions, including non-production systems that may contain copied production data.
- Hunt historical database logs for suspicious combinations of TimeZone changes and timeofday() calls, especially from application users that do not normally run administrative or diagnostic SQL.
- Enable or tune PostgreSQL statement/audit logging for security-sensitive SQL patterns where operationally feasible, including SET TimeZone and SELECT timeofday().
- Restrict direct database access to trusted application hosts and administrative networks.
- Review application code and database permissions to reduce opportunities for arbitrary SQL execution by low-privileged users.
- Treat any confirmed exploitation as a potential sensitive data exposure event and assess whether credentials, tokens, or regulated data may have been present in database memory.
The record
Externally-controlled format string in PostgreSQL timeofday() function allows an attacker to retrieve portions of server memory, via crafted timezone zones. Versions before PostgreSQL 18.4, 17.10, 16.14, 15.18, and 14.23 are affected.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| openSUSE:Leap 16.0 | postgresql14 | 0 | 14.23-160000.1.1 |
| openSUSE:Leap 16.0 | postgresql15 | 0 | 15.18-160000.1.1 |
| openSUSE:Leap 16.0 | postgresql16 | 0 | 16.14-160000.1.1 |
| openSUSE:Leap 16.0 | postgresql17 | 0 | 17.10-160000.1.1 |
| openSUSE:Tumbleweed | postgresql14 | 0 | 14.23-1.1 |
| openSUSE:Tumbleweed | postgresql15 | 0 | 15.18-1.1 |
| openSUSE:Tumbleweed | postgresql16 | 0 | 16.14-1.1 |
| openSUSE:Tumbleweed | postgresql17 | 0 | 17.10-1.1 |
| openSUSE:Tumbleweed | postgresql18 | 0 | 18.4-1.1 |
Related vulnerabilities
- CVE-2026-6637 Stack buffer overflow in PostgreSQL module "refint" allows an unprivileged database user… Also affects postgresql14
- CVE-2026-6478 Covert timing channel in comparison of MD5-hashed password in PostgreSQL authentication… Also affects postgresql14
- CVE-2026-6479 Uncontrolled recursion in PostgreSQL SSL and GSS negotiation allows an attacker able to… Also affects postgresql14
- CVE-2026-6475 Symlink following in PostgreSQL pg_basebackup plain format and in pg_rewind allows an… Also affects postgresql14
- CVE-2026-6477 Use of inherently dangerous function PQfn(..., result_is_int=0, ...) in PostgreSQL libpq… Also affects postgresql14
- CVE-2026-6473 Integer wraparound in multiple PostgreSQL server features allows an unprivileged database… Also affects postgresql14
- CVE-2026-6472 Missing authorization in PostgreSQL CREATE TYPE allows an object creator to hijack other… Also affects postgresql14
- CVE-2026-2005 Heap buffer overflow in PostgreSQL pgcrypto allows a ciphertext provider to execute… Also affects postgresql14