
Containerized lab and stdlib-only PoC for CVE-2026-116244: pgAdmin 4 server mode leaks its service account's Kerberos credentials to GSSAPI PostgreSQL, enabling passwordless privilege escalation.
| CVE | CVE-2026-116244 |
| Product | pgAdmin 4 (server mode) |
| Affected | ≤ v9.18 |
| Fixed | v9.19 (2026-10-29), issue #10655 |
| Class | Ambient credential confusion / authentication bypass (CWE-668-ish) |
| Preconditions | pgAdmin runs in server mode; the OS account running pgAdmin has Kerberos credentials reachable through the default credential cache (/tmp/krb5cc_<uid>) or the default/client keytab — exactly what happens when pgAdmin's host has been kinit-ed for the service account or uses a client keytab; attacker needs any pgAdmin web account (internal auth, no Kerberos); a PostgreSQL server reachable from the pgAdmin host that authenticates with GSSAPI (and maps the service principal to a privileged role — e.g. the pgAdmin service principal is also a DB superuser/owner). |
| Impact | A low-privilege web user makes pgAdmin's libpq answer the database's GSSAPI challenge as the pgAdmin service account's principal, inheriting every privilege that principal has on that server. No password, no Kerberos login, one unauthenticated-to-DB click path. |
For every server connection made on behalf of a web user, pgAdmin (≤ 9.18)
temporarily "isolates" Kerberos state in
web/pgadmin/utils/locker.py:
if source == KERBEROS and 'KRB5CCNAME' in session and self.is_kerberos_conn:
environ['KRB5CCNAME'] = session['KRB5CCNAME'] # user's delegated ticket
else:
environ.pop('KRB5CCNAME', None) # <-- the bug
Removing KRB5CCNAME does not remove Kerberos: libpq still answers a
server's AuthenticationGSS request, and the Kerberos library then falls back
to the default credential cache of the OS account running pgAdmin
(/tmp/krb5cc_<uid>) — or acquires one from the account's default client
keytab (~/client.keytab, KRB5_CLIENT_KTNAME). Whatever TGT the service
account holds is used for the GSS exchange, so the web user authenticates as
the service principal (e.g. pgadminsvc@REALM), and PostgreSQL's pg_ident
mapping then logs them into the privileged role that principal maps to.
The connect itself is psycopg.Connection.connect(...) inside the locker
(web/pgadmin/utils/driver/psycopg3/connection.py), so the credentials leak
through pgAdmin's own driver path — and equally through psql/pg_dump, which
inherit the same environment.
locker.py now points the environment at a cache/keytab that can never exist
and additionally hard-stops the GSS negotiation at the libpq level:
NO_KERBEROS_CREDENTIALS = {
'KRB5CCNAME': 'FILE:' + NO_CLIENT_FILE, # inside the app dir, never creatable
'KRB5_CLIENT_KTNAME': 'FILE:' + NO_CLIENT_FILE,
}
# plus, for every connection that may not use Kerberos:
# gssencmode=disable
# require_auth=!gss,!sspi (libpq >= 16; blocks SSPI on Windows and gssproxy)
# a server whose require_auth allows only gss/sspi is refused outright.
A user who actually logged in to pgAdmin with Kerberos still gets their own
delegated KRB5CCNAME, but only for servers with Kerberos authentication
enabled.
┌────────────┐ UDP/TCP 88 ┌───────────────────┐
│ kdc │◄───────────────►│ db (postgres:17) │ pg_hba: host gss only
│ MIT realm │ │ alias db.lab.test│ map: pgadminsvc→pgadminsvc
│ LAB.TEST │ │ secrets.payroll │ (privileged role owns it)
└─────┬──────┘ └─────────▲─────────┘
│ ktadd/ccache export (bind mount)│ GSSAPI 5432
│ │
┌─────▼──────────────────┐ ┌──────────┴──────────┐
│ pgadmin-vuln :9.18 │ │ pgadmin-fixed :9.19 │
│ dpage/pgadmin4:9.18 │ │ dpage/pgadmin4:9.19 │
│ uid 5050 + │ │ same service- │
│ /tmp/krb5cc_5050 │ │ account ccache … │
└────────────────────────┘ └─────────────────────┘
▲ HTTP 50918 / 50919 HTTP 50919
└─────────────── poc.py (attacker = ordinary web user)
kdc — MIT Kerberos realm LAB.TEST; exports the PG service keytab and a
TGT ccache for [email protected] which lands exactly at the default
ccache path (/tmp/krb5cc_5050) of pgAdmin's service account (uid 5050) in
both pgAdmin containers. No KRB5CCNAME is exported to the pgAdmin
process — that ambient default cache is precisely the credential the CVE
leaks.db — PostgreSQL 17 where GSSAPI is the only remote auth method
(host all all 0.0.0.0/0 gss include_realm=0 map=gssmap), with
pgadminsvc owning a secrets.payroll table and alice a harmless role.
The attacker's web login maps to no PostgreSQL role at all.pgadmin-vuln / pgadmin-fixed — official dpage/pgadmin4 images 9.18 and
9.19 in server mode; a non-administrator [email protected]
is created on both.Everything runs with CPU/memory caps (--cpus 2 --memory 4g, verified via
NanoCpus after create) on a single docker network.
poc.py does)POST /authenticate/login as the ordinary internal user (CSRF dance via
/login page props + /browser/js/utils.js token).POST /browser/server/obj/1/ — register server db.lab.test:5432 with
username=pgadminsvc, no password, kerberos_conn=true (this flag also
skips the "password required" prompt — the GSS path is taken either way).POST /browser/server/connect/1/<sid> — pgAdmin 9.18 answers the GSS
challenge with the service account's default ccache:
connection authorized: user=pgadminsvc … [email protected]./sqleditor/initialize/… + /query_tool/start + /poll):
SELECT current_user → pgadminsvc, then SELECT * FROM secrets.payroll
→ the privileged data.On 9.19 the same chain dies at step 3 with
authentication method requirement "!gss,!sspi" failed: server requested GSSAPI authentication even though the ambient ccache is still mounted — proving the
fix is what blocks it.
./lab.sh up # build + start kdc, db, pgadmin 9.18 & 9.19
python3 poc.py --url http://127.0.0.1:50918 # → VULNERABLE, exit 0
python3 poc.py --url http://127.0.0.1:50919 # → NOT VULNERABLE, exit 1
./lab.sh teardown
poc.py is stdlib-only. Against a real deployment, point --url at pgAdmin
and --target-* at any GSSAPI-authenticating PostgreSQL server it can reach.
The PoC also runs fully containerized: docker run --rm --network cve116244net -v "$PWD/poc.py":/poc.py:ro python:3.13-slim python3 /poc.py --url http://cve116244-pgadmin-vuln.
Variant notes: the trigger exercised here is the default FILE ccache holding
the service account's TGT — the reliable Linux reproducer. The advisory's
client-keytab fallback does not fire in libpq's gss_init_sec_context path on
stock MIT krb5 (tested with ~/client.keytab, KRB5_CLIENT_KTNAME, and a
DIR: collection ccache); that variant, like SSPI on Windows and gssproxy,
depends on the platform credential machinery — all covered by the same 9.19
fix. Setting kerberos_conn=false and sending a dummy password reaches the
same vulnerable path (the locker pops KRB5CCNAME regardless of the flag).