Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2025-12819

CVE-2025-12819: PgBouncer SQL Injection Vulnerability

CVE-2025-12819 is a SQL injection flaw in PgBouncer that allows unauthenticated attackers to execute arbitrary SQL via malicious search_path parameters. This article covers technical details, affected versions, and mitigations.

Published: March 11, 2026

CVE-2025-12819 Overview

CVE-2025-12819 is an untrusted search path vulnerability in the auth_query connection handler in PgBouncer before version 1.25.1. This security flaw allows an unauthenticated attacker to execute arbitrary SQL during the authentication phase by injecting a malicious search_path parameter within the StartupMessage. The vulnerability is classified under CWE-426 (Untrusted Search Path), which occurs when an application uses a search path that includes directories or locations that could be controlled by malicious actors.

PgBouncer is a lightweight connection pooler for PostgreSQL, commonly deployed in production environments to improve database performance and manage connection limits. Given its position as a gateway between applications and PostgreSQL databases, vulnerabilities in PgBouncer can have significant security implications for the entire database infrastructure.

Critical Impact

Unauthenticated attackers can execute arbitrary SQL commands during the authentication process, potentially leading to data exfiltration, privilege escalation, or complete database compromise without valid credentials.

Affected Products

  • PgBouncer versions prior to 1.25.1

Discovery Timeline

  • 2025-12-03 - CVE-2025-12819 published to NVD
  • 2025-12-27 - Last updated in NVD database

Technical Details for CVE-2025-12819

Vulnerability Analysis

This vulnerability resides in PgBouncer's authentication mechanism, specifically within the auth_query connection handler. PgBouncer uses the auth_query feature to delegate authentication decisions to the backend PostgreSQL database by executing a configured SQL query. The flaw allows an attacker to manipulate the search_path parameter in the PostgreSQL StartupMessage, which is the initial protocol message sent when establishing a connection.

By controlling the search_path, an attacker can influence which schema PostgreSQL searches first when resolving function or object names. If the auth_query uses unqualified function names (functions without explicit schema prefixes), an attacker could create malicious functions in a schema they control that would be executed instead of the intended authentication functions.

Root Cause

The root cause is improper handling of untrusted input in the StartupMessage processing logic. PgBouncer fails to sanitize or restrict the search_path connection parameter before forwarding authentication requests to the backend PostgreSQL server. This allows attackers to inject arbitrary schema paths that get processed during the authentication query execution, enabling schema injection attacks where malicious functions can shadow legitimate database functions.

Attack Vector

The attack is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by:

  1. Initiating a connection to the PgBouncer instance
  2. Crafting a malicious StartupMessage containing a specially crafted search_path parameter
  3. The search_path points to an attacker-controlled schema containing malicious functions
  4. When PgBouncer executes the auth_query, PostgreSQL resolves function names using the malicious search path
  5. Attacker's malicious functions execute instead of legitimate authentication functions

The vulnerability mechanism involves manipulating the PostgreSQL StartupMessage protocol to include a malicious search_path parameter. When PgBouncer forwards the authentication query to the backend database, PostgreSQL uses this attacker-controlled search path to resolve object names, allowing arbitrary SQL execution during authentication. For detailed technical information, refer to the PgBouncer Changelog.

Detection Methods for CVE-2025-12819

Indicators of Compromise

  • Unusual search_path values in PostgreSQL connection logs containing non-standard or unexpected schema names
  • Authentication attempts with suspicious StartupMessage parameters from external IP addresses
  • Creation of new schemas or functions in the PostgreSQL database that mirror authentication-related function names
  • Failed authentication events followed by successful database queries from the same source

Detection Strategies

  • Monitor PgBouncer logs for connections with non-default search_path parameters in the startup phase
  • Implement network intrusion detection rules to identify anomalous PostgreSQL wire protocol messages
  • Enable detailed PostgreSQL logging (log_statement = 'all') to capture unexpected SQL execution during authentication
  • Deploy SentinelOne agents to detect suspicious process behavior and network activity associated with database exploitation

Monitoring Recommendations

  • Configure alerting for any modifications to PostgreSQL schemas that could be used for search path hijacking
  • Establish baseline connection patterns and alert on deviations in StartupMessage parameters
  • Implement real-time monitoring of database authentication events with correlation to application-level authentication logs
  • Review PgBouncer configuration regularly to ensure auth_query uses fully qualified function names

How to Mitigate CVE-2025-12819

Immediate Actions Required

  • Upgrade PgBouncer to version 1.25.1 or later immediately
  • Review and audit auth_query configurations to ensure they use fully schema-qualified function names (e.g., pg_catalog.function_name)
  • Restrict network access to PgBouncer instances using firewalls and security groups
  • Enable connection logging and monitor for suspicious authentication patterns

Patch Information

The PgBouncer development team has released version 1.25.1 which addresses this vulnerability. Security updates are also available through distribution channels including Debian. Refer to the PgBouncer Changelog 1.25.x for detailed release notes. Debian users should consult the Debian LTS Announcement for package update information.

Workarounds

  • Modify auth_query to use fully qualified function names with explicit schema prefixes to prevent search path manipulation
  • Implement network segmentation to limit access to PgBouncer instances only from trusted application servers
  • Configure PostgreSQL to restrict schema creation and function deployment privileges for non-administrative users
  • Consider using client certificate authentication instead of password-based authentication via auth_query
bash
# Configuration example - Update auth_query to use fully qualified function names
# In pgbouncer.ini, change:
# auth_query = SELECT usename, passwd FROM pg_shadow WHERE usename=$1
# To use fully qualified references:
auth_query = SELECT usename, passwd FROM pg_catalog.pg_shadow WHERE usename=$1

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeSQLI

  • Vendor/TechPgbouncer

  • SeverityHIGH

  • CVSS Score8.1

  • EPSS Probability0.16%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-426
  • Technical References
  • PgBouncer Changelog 1.25.x

  • Debian LTS Announcement December 2025
  • Related CVEs
  • CVE-2025-2291: PgBouncer Auth Bypass Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English