CVE
CVE-2026-116241, CVE-2026-116242, CVE-2026-116239, CVE-2026-116243, CVE-2026-116244, CVE-2026-116245, CVE-2026-116247, CVE-2026-116249, CVE-2026-116238, CVE-2026-116248, CVE-2026-116250, CVE-2026-118938, CVE-2026-16760
CWE
CWE-78, CWE-287, CWE-426, CWE-22, CWE-502, CWE-693
Affected Surface
- PyPI `pgadmin4` (`pgadmin-org/pgadmin4`) versions `< 9.19` in server mode across 10 CVEs (`CVE-2026-116241` CVSS 9.9 Critical, `CVE-2026-116239`, `CVE-2026-116249`, `CVE-2026-116242`, `CVE-2026-116244`, `CVE-2026-116245`, `CVE-2026-116247`, `CVE-2026-116238`, `CVE-2026-116243`, `CVE-2026-116248`, and `CVE-2026-116250`)
- PyPI `fickling` (`trailofbits/fickling`) versions `<= 0.1.12` (latest on PyPI as of 31 October 2026; fixed on `master` in PR `#343` / commit `79ae401af3` for `CVE-2026-118938` and `CVE-2026-16760`)
- AI/ML model scanners, Hugging Face checkpoint pipelines, and pickle safety gates that rely on `fickling.check_safety()` or `fickling.always_check_safety()`
TL;DR
Between 20:17 UTC and 22:16 UTC on 30 October 2026, NVD published 10 security advisories in pgAdmin 4 (< 9.19 on PyPI and container distributions) alongside two static-analysis bypasses in Trail of Bits’ Python pickle and PyTorch scanner fickling (<= 0.1.12):
- pgAdmin 4
< 9.19psql \copydouble-quoted identifier RCE (CVE-2026-116241, CVSS 9.9 Critical) and nine server-mode isolation flaws:- Client-side
\copy ... TO PROGRAMescape (CVE-2026-116241, reported by Yonghwa Lee of Xint by Theori): pgAdmin 4’s Import/Export Data tool wraps a user’s export query insidepsql’s\copy (...) TOmeta-command and runs_is_query_parens_balanced(query)to stop the query from closing the outer(and appendingTO PROGRAM 'cmd'. An earlier patch (1496fabe2) rejected backslashes inside single-quoted literals ('...'), wherestandard_conforming_strings=offchanges whether\'closes the string. However,_is_query_parens_balanced()still allowed backslashes inside double-quoted identifiers ("..."). Becausepsql’sstrtokx()inparse_slash_copy()applies the connection’sstandard_conforming_stringsescape rule to whichever quote character opened the token, settingstandard_conforming_strings=off(which any unprivileged PostgreSQL role can set on its own session) makes\"an escaped quote topsqlwhile pgAdmin’s validator treats it as closing the identifier. SupplyingSELECT "a\"b"c) TO PROGRAM 'cmd' x"passes pgAdmin’s balance check and makespsqlcallpopen('cmd')on the pgAdmin host before the database server ever parses the SQL. - Host SSH identity, Kerberos cache, and
libpqambient file bleed (CVE-2026-116242,CVE-2026-116244,CVE-2026-116245,CVE-2026-116247, all CVSS 8.2 High;CVE-2026-116249, CVSS 8.4 High): In server mode, pgAdmin 4 failed to isolate per-user connections from the OS service account running the pgAdmin daemon.create_ssh_tunnel()passed neitherhost_pkey_directories=[]norssh_config_file=os.devnulltosshtunnel, letting any pgAdmin user authenticate an SSH tunnel with the service account’s~/.sshprivate keys,~/.ssh/config(ProxyCommand), orssh-agent(CVE-2026-116242). Similarly,libpqconnections fell back to the service account’s default Kerberos credential cache (CVE-2026-116244),~/.pg_service.conf(CVE-2026-116245), and~/.pgpass/~/.postgresql/postgresql.key(CVE-2026-116247), whileget_complete_file_path()returnedos.path.realpath()after checking the unresolved path so a symlink inside a user’s storage directory could pointsslkeyorpassfileat any file on the server (CVE-2026-116249). - Cross-source LDAP/Kerberos account takeover (
CVE-2026-116239, CVSS 8.5 High),SHARED_STORAGEbinary execution (CVE-2026-116243, CVSS 7.5 High), and login lockout bypass (CVE-2026-116238, CVSS 8.1 High): After LDAP or Kerberos authentication succeeded, pgAdmin looked up the local user record byusernamealone without filtering onauth_source, logging the user into an existinginternaladmin account with the same username and unlocking its saved database passwords (CVE-2026-116239). Meanwhile,validate_binary_path()blockedSTORAGE_DIRas a custom PostgreSQL utility path (pg_dump,psql) but forgot to block writableSHARED_STORAGEdirectories (CVE-2026-116243).
- Client-side
- Trail of Bits
fickling<= 0.1.12check_safety()bypasses (CVE-2026-118938andCVE-2026-16760, both CVSS 8.8 High, disclosed by Bombadil Systems):- Dotted
__qualname__inSTACK_GLOBAL(CVE-2026-118938): In pickle protocol 4,STACK_GLOBALpops a module name and a callable name and passes both toUnpickler.find_class(), which resolves dotted attribute paths via_getattribute()when the name contains.(for example("optparse", "Values.read_file")or("pathlib", "Path.write_text")). Infickling <= 0.1.12,StackGlobal.run()emittedast.ImportFrom(module=module, names=[ast.alias(name)]), soImport.namesrecorded only the first identifier component ("Values") while leaving the AST call target as a broken or unanalyzed attribute expression.check_safety()reportedSeverity.LIKELY_SAFEeven though unpickling executed the method. - Module-origin trust in
likely_safe_imports(CVE-2026-16760):ASTProperties._process_import()added every imported symbol from any module insys.stdlib_module_names(unless the module was onUNSAFE_IMPORTS) toself.likely_safe_imports, andOvertlyBadEvalsskipped every call whose function name appeared inlikely_safe_imports. Calling dangerous functions or constructors from non-denylisted standard-library modules (argparse,optparse,tkinter,dataclasses._create_fn,mailcap.findmatch,readline,gzip.GzipFile,pstats.Stats.dump_stats,zipapp,uu) passedcheck_safety()asLIKELY_SAFE.
- Dotted
What to do now: Upgrade pgadmin4 to >= 9.19 immediately across all server-mode and container deployments. If you use fickling (<= 0.1.12 on PyPI) to gate pickle or PyTorch checkpoint loads, pin to commit 79ae401af3 (PR #343 on master, merged 31 October 2026) until 0.1.13 is tagged on PyPI, and do not rely on denylist-based pickle AST scanners alone to load untrusted .pkl or .pt files with weights_only=False.
Affected packages
| Ecosystem | Package | CVE | Severity | Affected versions | Fixed version / Commit | Vulnerable component |
|---|---|---|---|---|---|---|
| PyPI / Container | pgadmin4 | CVE-2026-116241 | CVSS 9.9 Critical | < 9.19 | 9.19 (commit 9be31a019f) | _is_query_parens_balanced() in web/pgadmin/tools/import_export/__init__.py |
| PyPI / Container | pgadmin4 | CVE-2026-116239, CVE-2026-116249 | CVSS 8.5 / 8.4 High | < 9.19 | 9.19 (269e32d5ee, 2afe505ef4) | LDAP/Kerberos auth_source lookup; symlink traversal in get_complete_file_path() |
| PyPI / Container | pgadmin4 | CVE-2026-116242, 116244, 116245, 116247 | CVSS 8.2 High (all 4) | < 9.19 | 9.19 (d52fe4740e, 145e511f05, a0c8f4857f, 32db693198) | create_ssh_tunnel(), Kerberos KRB5CCNAME, and libpq service / passfile / sslkey defaults |
| PyPI / Container | pgadmin4 | CVE-2026-116238, 116243, 116248, 116250 | CVSS 8.1 High to 6.5 Medium | < 9.19 | 9.19 (9e95d9a721, 35c9235d17) | MAX_LOGIN_ATTEMPTS bypass; SHARED_STORAGE utility_path; shared server flag; storage symlink open |
| PyPI | fickling | CVE-2026-118938, CVE-2026-16760 | CVSS 8.8 High (both) | <= 0.1.12 (latest on PyPI) | Commit 79ae401af3 (PR #343) and 2a28b41392 | StackGlobal.run(), ASTProperties._process_import(), and UNSAFE_IMPORTS in fickling/fickle.py |
Technical analysis
1. CVE-2026-116241: how a backslash inside a double-quoted SQL identifier escapes psql \copy (...) into TO PROGRAM
When an authenticated pgAdmin 4 user exports the results of a custom SQL query via the Import/Export Data tool (tools_import_export_data, enabled by default for non-admin roles), pgAdmin spawns the local psql binary and passes -c "\copy (<user_query>) TO '<output_file>' ...".
Because psql’s \copy is a client-side meta-command executed by the psql process running on the pgAdmin server host, psql parses the \copy line before sending COPY (...) TO STDOUT to PostgreSQL. If the user’s query can close the opening ( of \copy (...) early and append TO PROGRAM 'sh -c ...', psql immediately calls popen() on the pgAdmin server.
To prevent that, pgAdmin’s _is_query_parens_balanced(query) in web/pgadmin/tools/import_export/__init__.py walks the query string tracking parenthesis depth, single-quoted strings, double-quoted identifiers, dollar-quoted strings, and comments. After an earlier vulnerability where 'a\') TO PROGRAM ...' bypassed the parser under standard_conforming_strings=on, pgAdmin rejected any backslash inside a single-quoted string. However, it still treated backslashes as ordinary characters inside double-quoted identifiers ("...").
The mismatch is in PostgreSQL’s src/fe_utils/string_utils.c: strtokx(), which parse_slash_copy() uses to tokenize \copy, sets its escape character to \ whenever the database session has standard_conforming_strings = off and applies that backslash escape rule to double-quoted tokens as well as single-quoted tokens.
An attacker with an ordinary database role simply sets ALTER ROLE current_user SET standard_conforming_strings = off; (or connects to a database with standard_conforming_strings = off) and submits an export query such as:
SELECT "a\"b"c) TO PROGRAM 'id > /tmp/pwned' x"
- What pgAdmin
< 9.19sees:_is_query_parens_balanced()enters the double-quoted identifier at"a, ignores the\, closes the identifier at the second", seesb"c)as a second double-quoted string"b"followed bycand a closing)that it thinks is matched or inside the second quote opened at the end, and accepts the query as balanced. - What
psqlsees (standard_conforming_strings = off):strtokx()treats\"inside"a\"b"as an escaped literal quote, so the identifier continues until"b"’s second quote. That leavesc)outside any quoted token, closing\copy (...)and exposingTO PROGRAM 'id > /tmp/pwned'as a live\copyoption.psqlexecutes the shell command viapopen()before PostgreSQL ever sees the query.
Commit 9be31a019f rejects any backslash inside a double-quoted identifier just as it already did for single-quoted literals:
--- a/web/pgadmin/tools/import_export/__init__.py
+++ b/web/pgadmin/tools/import_export/__init__.py
@@ -340,6 +340,10 @@ def _is_query_parens_balanced(query):
elif state == IN_DOUBLE_QUOTE:
+ if ch == '\\':
+ # Ambiguous with standard_conforming_strings=off in psql's
+ # strtokx; reject rather than guess the connection state.
+ return False
if ch == '"':
if nxt == '"':
i += 2
2. CVE-2026-116242 and CVE-2026-116243: server-mode SSH tunnel credential bleed and SHARED_STORAGE binary execution
In server mode, pgAdmin 4 runs as a single OS service account serving multiple web users. In web/pgadmin/utils/driver/psycopg3/server_manager.py, create_ssh_tunnel() constructed SSHTunnelForwarder(...) without overriding sshtunnel’s default key discovery (CVE-2026-116242, commit d52fe4740e):
- Because
host_pkey_directorieswas not passed,sshtunnelautomatically scanned~/.sshof the OS account running pgAdmin and loaded any unencrypted private keys (id_rsa,id_ed25519). - Because
ssh_config_filewas not passed,sshtunnelparsed the service account’s~/.ssh/config(IdentityFile,User,HostName,ProxyCommand). - If the user left the tunnel password and identity file blank,
allow_agentstayedTrue, allowing the tunnel to sign challenges with the pgAdmin service account’sssh-agent.
In 9.19, server-mode tunnels always pass host_pkey_directories=[], ssh_config_file=os.devnull, and allow_agent=False, and refuse to connect if a configured identity_file does not exist inside the user’s storage directory.
Separately, in web/pgadmin/misc/__init__.py (CVE-2026-116243, commit 9e95d9a721), validate_binary_path() and does_utility_exist() checked Path(config.STORAGE_DIR) not in Path(data['utility_path']).parents to stop users from uploading a fake pg_dump or psql into their personal file storage and pointing their PostgreSQL binary path preference at it. However, the check did not inspect config.SHARED_STORAGE directories (which ordinary users can also upload files into) and did not expand $DIR or .. before resolving symlinks.
3. CVE-2026-118938 and CVE-2026-16760: how dotted STACK_GLOBAL operands and likely_safe_imports bypass fickling
Trail of Bits’ fickling decompiles a Python pickle opcode stream into a synthetic Python AST and runs static analysis passes (UnsafeImportsML, BadCalls, OvertlyBadEvals, UnusedVariables) over that AST to decide whether the pickle is safe to load.
In CVE-2026-118938, pickle protocol 4’s STACK_GLOBAL opcode pops two strings from the pickle stack (module and name) and calls find_class(module, name). In CPython’s pickle.py, when proto >= 4, find_class() splits name on . via _getattribute(sys.modules[module], name) so a pickle can reference nested classes or unbound methods on a class (such as optparse.Values.read_file or pathlib.Path.write_text).
When fickling <= 0.1.12 translated STACK_GLOBAL("optparse", "Values.read_file") into AST nodes, it emitted from optparse import Values.read_file. In Python’s ast module:
Import.namessplitsalias.nameon.and returns only the root identifier ("Values"), so import-level checks only sawfrom optparse import Values.- In
OvertlyBadEvals,ASTProperties._process_import()added"Values.read_file"(or the root name) from a non-denylisted stdlib module intoself.likely_safe_imports(CVE-2026-16760), causingOvertlyBadEvalsto skip the subsequentREDUCEcall completely.
In commit 2a28b41392 and PR #343 (79ae401af3), Trail of Bits updated _process_import() so that dotted import names and private (_-prefixed) attributes are never added to likely_safe_imports, and expanded UNSAFE_IMPORTS to block stdlib file-read/write and execution gadgets (argparse, optparse, tkinter, trace, doctest, dataclasses, mailcap, readline, tracemalloc, mailbox, gzip, bz2, lzma, compression, netrc, zipapp, wave, pstats, uu, ElementInclude, minidom, expatbuilder, sax, xmlbuilder, and mimetypes):
# Regression test in trailofbits/fickling PR #343 (commit 79ae401af3)
def test_dotted_qualname_is_blocked(self):
pickled = self.stack_global_call("pathlib", "Path.write_text")
self.assertNotIn("Path.write_text", pickled.properties.likely_safe_imports)
self.assertGreaterEqual(check_safety(pickled).severity, Severity.LIKELY_OVERTLY_MALICIOUS)
Note that on 30 October 2026 (00:31 UTC), fickling also merged commit d0117098e3 (Analyze PyTorch ZIP records with PyTorch reader): previously, PyTorchModelWrapper.pickled opened .pt archives with Python’s zipfile.ZipFile (which reads the last duplicate data.pkl entry in the ZIP central directory), whereas torch.load()’s C++ PyTorchFileReader reads the first matching record, allowing a polyglot .pt archive with two data.pkl entries to show a benign pickle to fickling while executing a malicious pickle in torch.load().
Detection and remediation
# 1. Check installed pgadmin4 and fickling versions across Python environments and containers
pip show pgadmin4 fickling 2>/dev/null || true
rg -n '(pgadmin4|dpage/pgadmin4|fickling)' requirements*.txt pyproject.toml uv.lock Dockerfile* docker-compose*.{yml,yaml} k8s/ helm/ 2>/dev/null
# 2. On pgAdmin 4 server-mode hosts, check whether the service account has ambient ~/.ssh keys, ~/.pgpass, or ~/.pg_service.conf
ls -la ~pgadmin/.ssh/ ~pgadmin/.pgpass ~pgadmin/.pg_service.conf ~pgadmin/.postgresql/ 2>/dev/null || true
- Upgrade
pgadmin4to>= 9.19:- Update
pgadmin4viapip install --upgrade "pgadmin4>=9.19"or pull thedpage/pgadmin4:9.19container image. - Remove any personal SSH keys (
~/.ssh/id_*),~/.ssh/config,~/.pgpass, or~/.pg_service.conffiles from the home directory of the OS service account that runspgadmin4in server mode, and rotate any SSH keys that were stored there. - Ensure
config.STORAGE_DIRis set to a dedicated directory (never empty"") and restricttools_import_export_dataand customutility_pathpermissions if untrusted users have access to the pgAdmin web UI.
- Update
- Update
ficklingand enforceweights_only=Truein PyTorch:- Because
fickling 0.1.12on PyPI does not yet include commits2a28b41392,d0117098e3, or79ae401af3, installficklingfromgit+https://github.com/trailofbits/fickling.git@79ae401af3until0.1.13is published. - Treat
fickling.check_safety()as a secondary signal rather than a sandbox boundary: prefersafetensorsortorch.load(..., weights_only=True)for all untrusted model weights.
- Because
Timeline
- 2026-10-23 to 2026-10-24: pgAdmin maintainers merge fixes for
CVE-2026-116241(9be31a019f),CVE-2026-116243(9e95d9a721),CVE-2026-116242(d52fe4740e),CVE-2026-116239(269e32d5ee), and the remaining server-mode isolation flaws, shipping in pgAdmin 49.19. - 2026-10-29 to 2026-10-31 (
01:58 UTC): Trail of Bits merges commits2a28b41392,d0117098e3, and PR#343(79ae401af3) intrailofbits/fickling. - 2026-10-30 (
20:17to22:16 UTC): NVD publishes the 10 pgAdmin 4 CVEs (CVE-2026-116238,116239,116241..116245,116247..116250) and Bombadil Systems / NVD publishCVE-2026-118938andCVE-2026-16760forfickling.
From research to remediation
Check whether this pattern exists in your codebase
Turn this research into a remediation workflow. Scan dependencies and package manifests for similar supply-chain risk, then prioritize fixes with reachability context.
References
- pgadmin-org/pgadmin4 commit 9be31a019f (issue #10663: reject backslash in double-quoted identifiers in Import/Export Data query export, CVE-2026-116241)
- pgadmin-org/pgadmin4 commits d52fe4740e (#10662, CVE-2026-116242), 9e95d9a721 (#10656, CVE-2026-116243), 269e32d5ee (#10675, CVE-2026-116239), and 2afe505ef4 (#10650, CVE-2026-116249)
- trailofbits/fickling PR #343 (commit 79ae401af3: detect unsafe dotted stdlib globals across import splits and block stdlib gadgets)
- Bombadil Systems Security Advisories: CVE-2026-118938 and CVE-2026-16760 in Trail of Bits fickling
- NVD: CVE-2026-116241 and CVE-2026-118938