Description
Multiple buffer overflows in gram.y for PostgreSQL 8.0.1 and earlier may allow attackers to execute arbitrary code via (1) a large number of variables in a SQL statement being handled by the read_sql_construct function, (2) a large number of INTO variables in a SELECT statement being handled by the make_select_stmt function, (3) a large number of arbitrary variables in a SELECT statement being handled by the make_select_stmt function, and (4) a large number of INTO variables in a FETCH statement being handled by the make_fetch_stmt function, a different set of vulnerabilities than CVE-2005-0245.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 3.0 | postgresql | 7.2.1-2woody8 | DSA-683-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 4 | postgresql +10 | 7.4.7-2.RHEL4.1 | RHSA-2005:138 |
| RHEL 3 | rh-postgresql +10 | 7.3.9-2 | RHSA-2005:141 |
Advisories 3
- RHSA-2005:141 Red Hat Security Advisory: rh-postgresql security update Red Hat Security Advisories (RHSA) · Jun 26, 2026
- RHSA-2005:138 Red Hat Security Advisory: postgresql security update Red Hat Security Advisories (RHSA) · Jun 26, 2026
- DSA-683-1 postgresql - buffer overflows Debian Security (DSA / DLA) · Mar 9, 2026
References
- [pgsql-committers] 20050207 pgsql: Prevent 4 more buffer overruns in the PL/PgSQL parser. mailing-list
- postgresql-makeselectstmt-arbitrary-bo(19377) vdb-entry
- GLSA-200502-19 vendor-advisory
- MDKSA-2005:040 vendor-advisory
- 20050210 [USN-79-1] PostgreSQL vulnerabilities mailing-list
- SUSE-SA:2005:027 vendor-advisory
- postgresql-readsqlconstruct-bo(19375) vdb-entry
- RHSA-2005:138 vendor-advisory
- postgresql-makeselectstmt-input-bo(19376) vdb-entry
- RHSA-2005:150 vendor-advisory
- postgresql-fetch-makefetchstmt-bo(19378) vdb-entry
- oval:org.mitre.oval:def:9345 vdb-entry signature
- 12417 vdb-entry
- DSA-683 vendor-advisory
- SUSE-SA:2005:036 vendor-advisory