Tuesday, April 22, 2025
HomeCVE/vulnerabilityCritical pgAdmin Flaw Allows Remote Code Execution

Critical pgAdmin Flaw Allows Remote Code Execution

Published on

SIEM as a Service

Follow Us on Google News

A severe Remote Code Execution (RCE) vulnerability in pgAdmin (CVE-2025-2945), the popular PostgreSQL database management tool, has been patched after researchers discovered attackers could hijack servers through malicious API requests.

The flaw affects pgAdmin versions ≤9.1 and allows authenticated users to execute arbitrary commands on affected systems.

Technical Breakdown

The vulnerability stems from improper use of Python’s eval() function in two endpoints:

- Advertisement - Google News
  1. /sqleditor/query_tool/download/<int:trans_id>
query_commited = eval(value) if isinstance(value, str) else value  # Vuln code

Attackers could send crafted POST requests containing Python code (e.g., open(‘/tmp/pyozzi-poc’, ‘w’)) to write files or execute commands.

  1. /cloud/deploy
high_availability = 'REGIONAL' if eval(args.high_availability) else 'ZONAL'  # Vuln code

Malicious inputs like reverse shell payloads could grant full server access:

exec('import socket,subprocess,os;s=socket.socket(...)')

Both endpoints processed user input without sanitization, enabling attackers to abuse the eval() function’s ability to execute code.

Attack Scenarios & Impact

Successful exploitation could lead to:

  • Database Manipulation: Theft or destruction of sensitive PostgreSQL data.
  • Lateral Movement: Compromise of internal networks via server access.
  • Credential Theft: Extraction of API keys, passwords, and tokens from configuration files.
  • Persistent Backdoors: Installation of malicious scripts for long-term access.

Notably, the flaw requires authentication, limiting immediate widespread exploitation. However, compromised accounts or phishing attacks could bypass this barrier.

Patch & Remediation

The pgAdmin team resolved the issue in version 9.2 by eliminating eval() usage. For example, in the query_commited parameter patch:

- query_commited = eval(value) if isinstance(value, str) else value 
+ query_commited = value.lower() == 'true'  # Secure boolean parsing 

Users must update to pgAdmin 9.2 immediately. Organizations unable to patch should restrict pgAdmin instance access to trusted networks and audit user privileges.

The bug hunter who discovered the flaw noted:

“Why use eval() here? The logic didn’t need it at all. This was an avoidable risk.”

The pgAdmin security team addressed the report within 24 hours, highlighting the importance of coordinated disclosure.

Find this News Interesting! Follow us on Google NewsLinkedIn, & X to Get Instant Updates!

Divya
Divya
Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Latest articles

Hackers Exploit Cloudflare Tunnel Infrastructure to Deploy Multiple Remote Access Trojans

The Sekoia TDR (Threat Detection & Research) team has reported on a sophisticated network...

Threat Actors Leverage npm and PyPI with Impersonated Dev Tools for Credential Theft

The Socket Threat Research Team has unearthed a trio of malicious packages, two hosted...

Hackers Exploit Legitimate Microsoft Utility to Deliver Malicious DLL Payload

Hackers are now exploiting a legitimate Microsoft utility, mavinject.exe, to inject malicious DLLs into...

Cybercriminals Exploit Network Edge Devices to Infiltrate SMBs

Small and midsized businesses (SMBs) continue to be prime targets for cybercriminals, with network...

Resilience at Scale

Why Application Security is Non-Negotiable

The resilience of your digital infrastructure directly impacts your ability to scale. And yet, application security remains a critical weak link for most organizations.

Application Security is no longer just a defensive play—it’s the cornerstone of cyber resilience and sustainable growth. In this webinar, Karthik Krishnamoorthy (CTO of Indusface) and Phani Deepak Akella (VP of Marketing – Indusface), will share how AI-powered application security can help organizations build resilience by

Discussion points


Protecting at internet scale using AI and behavioral-based DDoS & bot mitigation.
Autonomously discovering external assets and remediating vulnerabilities within 72 hours, enabling secure, confident scaling.
Ensuring 100% application availability through platforms architected for failure resilience.
Eliminating silos with real-time correlation between attack surface and active threats for rapid, accurate mitigation

More like this

Hackers Exploit Cloudflare Tunnel Infrastructure to Deploy Multiple Remote Access Trojans

The Sekoia TDR (Threat Detection & Research) team has reported on a sophisticated network...

Threat Actors Leverage npm and PyPI with Impersonated Dev Tools for Credential Theft

The Socket Threat Research Team has unearthed a trio of malicious packages, two hosted...

Hackers Exploit Legitimate Microsoft Utility to Deliver Malicious DLL Payload

Hackers are now exploiting a legitimate Microsoft utility, mavinject.exe, to inject malicious DLLs into...