module

pgAdmin Session Deserialization RCE

Disclosed
03/04/2024
Created
04/17/2024

Description

pgAdmin versions a pickled file to be loaded from an arbitrary location. This can be used to load a malicious, serialized Python
object to execute code within the context of the target application.

This exploit supports two techniques by which the payload can be loaded, depending on whether or not credentials
are specified. If valid credentials are provided, Metasploit will login to pgAdmin and upload a payload object
using pgAdmin's file management plugin. Once uploaded, this payload is executed via the path traversal before
being deleted using the file management plugin. This technique works for both Linux and Windows targets. If no
credentials are provided, Metasploit will start an SMB server and attempt to trigger loading the payload via a
UNC path. This technique only works for Windows targets. For Windows 10 v1709 (Redstone 3) and later, it also
requires that insecure outbound guest access be enabled.

Tested on pgAdmin 8.3 on Linux, 7.7 on Linux, 7.0 on Linux, and 8.3 on Windows. The file management plugin
underwent changes in the 6.x versions and therefor, pgAdmin versions technique whereby a payload is uploaded.

Authors

Spencer McIntyreDavide SilvettiAbdel Adim Oisfi

Platform

Python

Architectures

python

Module Options

To display the available options, load the module within the Metasploit console and run the commands ‘show options’ or ‘show advanced’:


    msf > use exploit/multi/http/pgadmin_session_deserialization
    msf /(n) > show actions
        ...actions...
    msf /(n) > set ACTION < action-name >
    msf /(n) > show options
        ...show and set options...
    msf /(n) > run
  
Title
NEW

Explore Exposure Command

Confidently identify and prioritize exposures from endpoint to cloud with full attack surface visibility and threat-aware risk context.