CVE-2009-0663: Buffer Overflow
A heap-based buffer overflow flaw was found in perl-DBD-Pg's pggetline. When pggetline is used, pgdbgetline (in dbdimp.c) is called that gets buffer of size length (specified by pggetline called) passed to it. Data read from the DB server is stored in temporary buffer pointed to by tempbuf and later copied to the buffer passed to pgdbgetline as:
strncpy(buffer, tempbuf, strlen(tempbuf)+1); buffer[strlen(tempbuf)] = '\0';
This incorrectly uses source length as copy size limit, not the destination length, allowing overflow of input buffer.
This problem should be fixed in DBD-Pg versions 2.x, where pgdbgetline completely ignores length argument of pggetline, allocating buffer of the required size.
Other sources
Heap-based buffer overflow in the DBD::Pg (aka DBD-Pg or libdbd-pg-perl) module 1.49 for Perl might allow context-dependent attackers to execute arbitrary code via unspecified input to an application that uses the getline and pggetline functions to read database rows.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.x
Event History
Frequently Asked Questions
What is the severity of CVE-2009-0663?
CVE-2009-0663 is considered a critical vulnerability due to the potential for arbitrary code execution.
How do I fix CVE-2009-0663?
To fix CVE-2009-0663, upgrade the DBD::Pg module to a version that is not affected by this vulnerability.
What software is affected by CVE-2009-0663?
CVE-2009-0663 affects the DBD::Pg module version 1.49 for Perl.
Can CVE-2009-0663 be exploited remotely?
Yes, CVE-2009-0663 can be exploited by context-dependent attackers through specific input.
What functions in DBD::Pg are related to CVE-2009-0663?
The functions getline and pg_getline in the DBD::Pg module are related to CVE-2009-0663.