Rapid7 has identified a SQL injection vulnerability, CVE-2025-1094, affecting all supported PostgreSQL versions prior to 17.3, 16.7, 15.11, 14.16, and 13.19, with a CVSS 3.1 base score of 8.1. This vulnerability is linked to another vulnerability, CVE-2024-12356, which allows unauthenticated remote code execution in BeyondTrust's solutions. Exploiting CVE-2024-12356 requires prior exploitation of CVE-2025-1094. The issue arises from flawed assumptions in PostgreSQL's string escaping routines, particularly in handling invalid UTF-8 characters, which can lead to SQL injection through the psql tool. Attackers can execute arbitrary SQL statements and operating system shell commands under certain conditions. Users are advised to upgrade to secure PostgreSQL versions to mitigate risks. A Metasploit exploit module for CVE-2025-1094 is also available for vulnerable BeyondTrust systems.