Programming Error in PostgreSQL

postgresql Updated 02 Oct 2025

Summary

03/06/2006
N/A
Yes i
Unrated
Not published

DSA-1087-1: postgresql - programming error. Affects postgresql versions < 7.4.7-6sarge2. Fixed in 7.4.7-6sarge2. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

PostgreSQL is a popular SQL database that provides advanced features and reliability for various applications. It supports multiple encodings, including single-byte and multibyte encodings. However, a programming error in PostgreSQL allows attackers to inject arbitrary SQL commands through invalidly-encoded multibyte text data or client-side encodings containing specific byte sequences.

Vulnerability Detail

The vulnerability, identified as CVE-2006-2313 and CVE-2006-2314, enables an attacker to exploit encoding weaknesses in PostgreSQL. By manipulating invalidly-encoded multibyte text data or specially crafted byte sequences in client-side encodings, an attacker can inject arbitrary SQL commands. This can lead to unauthorized access, data manipulation, or even complete compromise of the database.

How To Fix

Minimum fixed version

7.4.7-6sarge2

This is the first release that contains the fix.

sudo apt-get install --only-upgrade postgresql

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If you only use single-byte encodings (e.g., SQL_ASCII or ISO-8859-X) or unaffected multibyte encodings (e.g., UTF-8), you are not affected by this vulnerability. However, it is still recommended to apply the necessary updates to ensure the overall security of your PostgreSQL installation.

Conclusion

Upgrading your PostgreSQL packages to the fixed versions is crucial to mitigate the programming error vulnerability. Additionally, ensure that any dependencies or libraries using the old encoding for binary data are also updated. Regularly monitoring for vulnerabilities using tools like Vulert can help maintain the security of your software.

See every vulnerability recorded for postgresql →

Share this vulnerability

FAQ

The vulnerability allows attackers to inject arbitrary SQL commands, potentially leading to unauthorized access, data manipulation, or complete compromise of the PostgreSQL database.

The vulnerability affects PostgreSQL versions prior to 7.4.7-6sarge2 for the stable distribution (sarge) and prior to 7.4.13-1 for the unstable distribution (sid).

If you only use single-byte or unaffected multibyte encodings, you are not affected by this vulnerability. However, it is still recommended to apply the necessary updates for overall security.

You can use Vulert's playground at Vulert Scanner to check if your PostgreSQL installation is affected by this vulnerability. Simply upload your package-lock.json file to the playground without any signup.

For further support on vulnerability remediation, you can contact info@devnack.com. They can provide guidance and assistance in securing your PostgreSQL installation.

Related vulnerabilities

Recent vulnerabilities recorded for postgresql.

How To Fix

Minimum fixed version

7.4.7-6sarge2

This is the first release that contains the fix.

sudo apt-get install --only-upgrade postgresql

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback