← All updates

Security / News explained

A log-reading extension needs a firm file boundary

CVE-2026-139820 concerns delegated log_fdw access before extension version 1.5. AWS’s December advisory pairs the update with a review of existing foreign-table filenames.

By Zyel · Published · 4 min read

AWS’s December 1, 2026 advisory for CVE-2026-139820 describes a file-reading boundary failure in postgresql-logfdw, also called log_fdw. The extension lets PostgreSQL users query server logs through SQL foreign tables. Before extension version 1.5, a role already granted log_fdw privileges could supply a crafted foreign-table filename and potentially reach files beyond the configured log directory. The affected component and the delegated permissions both matter when assessing an installation. [1]

The recommended fixed version predates this disclosure. The project’s public release record places v1.5 on September 11, 2026. December 1 is the date of the security announcement, not the date that release first appeared. Keeping those dates separate makes the story more useful: an operator can compare an existing extension deployment with the newly disclosed risk without assuming that every relevant update arrived yesterday. [6]

A SQL table can be a view onto a file

PostgreSQL’s general foreign-data documentation explains the underlying arrangement. A foreign table provides a familiar SQL interface to data obtained through a foreign data wrapper; it does not store that data as an ordinary local table would. A foreign server object describes the external source, and the wrapper fetches its contents when queried. In this case, the source is a server log file. Our interpretation is that the friendly SQL interface should not obscure the second authority involved: the database process also opens a filesystem object. [4]

The project advisory identifies an authenticated non-superuser with previously granted log_fdw privileges as the relevant actor. Reachable files are limited to what the database server process can read. Server configuration files are one example given by the project. This distinction keeps the exposure assessment tied to actual delegation and process permissions. Possessing an ordinary application login, without the required extension privileges, does not by itself establish the described attack path. [2]

Consider a hypothetical support role allowed to examine database logs while application configuration remains outside its assigned duties. A traversal flaw could cross that intended division if the database process could read the target file. This example illustrates the advisory’s permission boundary; it is not a report about a particular organization. An assessment would need the real grants, extension revision and filesystem permissions before drawing a conclusion about that environment. [2]

The configured directory is part of the policy

The v1.5 documentation says filenames must be plain entries from the log-file listing. Absolute paths, directory separators, a single dot and a double dot are rejected when a foreign table is created and whenever it is read. The same documentation warns that choosing the data directory itself as log_directory leaves files located there within reach of authorized foreign-table creators. Our reading is that path validation and directory selection solve different parts of the access decision: a correct boundary can still enclose more material than an operator intended. [3]

The project documents superuser-only extension creation and restricted function access by default, with delegation through grants. PostgreSQL’s CREATE FOREIGN TABLE reference adds a general prerequisite: the creator needs USAGE on the foreign server and the column types. These details explain why a useful inventory includes the role’s actual delegated capabilities, together with the extension and its foreign-table definitions. A database product name and major version cannot supply that whole picture. [3] [5]

The update includes existing table definitions

AWS recommends upgrading to the latest extension release with the correction, and incorporating the equivalent fixes into forks. It also directs users to alter or recreate any foreign table whose filename is not a plain filename in the log directory. When an immediate upgrade is unavailable, the stated workaround is to revoke log_fdw privileges from non-superuser roles that should not read beyond that directory. Version 1.5 here refers to the extension; it is independent of the PostgreSQL server’s major-version number. [1]

For teams using log queries during investigations or support, the operational implication is a focused review of the data-access boundary that already exists. The extension revision addresses validation behavior; table definitions and delegated roles describe how that behavior is used. Our conclusion is that granting convenient access to logs deserves the same precision as granting access to an application table: identify the intended data, the authority that opens it and the people allowed to request it.

Sources + further reading

Source dates describe the original material. Publication above is the date this Zyel article went live.

  1. AWS security bulletin 2026-205-AWSAmazon Web Services · Checked Dec 2, 2026
  2. CVE-2026-139820: relative path traversal in postgresql-logfdwAWS postgresql-logfdw project · Checked Dec 2, 2026
  3. log_fdw documentation at the v1.5 tagAWS postgresql-logfdw project · Checked Dec 2, 2026
  4. PostgreSQL documentation: foreign dataPostgreSQL Global Development Group · Checked Dec 2, 2026
  5. PostgreSQL documentation: CREATE FOREIGN TABLEPostgreSQL Global Development Group · Checked Dec 2, 2026
  6. postgresql-logfdw v1.5 release recordAWS postgresql-logfdw project / GitHub · Checked Dec 2, 2026

Reader discussion

What would you ask next?

Questions, useful corrections and thoughtful disagreement are welcome. Comments are reviewed before they appear.

No reader comments yet.

10–2,000 characters. Plain text. Leave out passwords, private project data and personal contact details. A blank display name appears as Anonymous.

Complete the CAPTCHA before sending. Verification runs on your device.