From efd64e18a26175ebf6c880cab9a3fddafa41421e Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 8 Aug 2026 16:49:10 +0000 Subject: [PATCH] Add curated deserialization sinks to taint tracking Update `_SERIALISATION_SINKS` to include specific third-party deserialization functions (`dill.load`, `jsonpickle.decode`, etc.) that were added to the `PY-WL-106` rule but omitted from core taint propagation, ensuring validation provenance is correctly shed. Co-authored-by: tachyon-beep <544926+tachyon-beep@users.noreply.github.com> --- src/wardline/scanner/rules/untrusted_to_deserialization.py | 4 +++- src/wardline/scanner/taint/variable_level.py | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/wardline/scanner/rules/untrusted_to_deserialization.py b/src/wardline/scanner/rules/untrusted_to_deserialization.py index 63cc4e5b..cae39031 100644 --- a/src/wardline/scanner/rules/untrusted_to_deserialization.py +++ b/src/wardline/scanner/rules/untrusted_to_deserialization.py @@ -127,8 +127,10 @@ def _has_literal_true_kw(call: ast.Call, name: str) -> bool: "@trusted(level='ASSURED')\ndef f(p):\n blob = validate(read_raw(p))\n" " obj = pickle.loads(blob)\n return blob", # numpy.load without allow_pickle=True is safe by default (no object unpickling). + # We must not return its result directly to avoid a PY-WL-101 finding, as numpy.load + # is a serialization sink shedding validation provenance. "@external_boundary\ndef read_raw(p):\n return p\n" - "@trusted(level='ASSURED')\ndef f(p):\n return numpy.load(read_raw(p))", + "@trusted(level='ASSURED')\ndef f(p):\n numpy.load(read_raw(p))\n return 'safe'", ), ) diff --git a/src/wardline/scanner/taint/variable_level.py b/src/wardline/scanner/taint/variable_level.py index a51a6989..2ef43473 100644 --- a/src/wardline/scanner/taint/variable_level.py +++ b/src/wardline/scanner/taint/variable_level.py @@ -67,6 +67,12 @@ "tomllib.load", "tomli_w.dumps", "tomli_w.dump", + "dill.load", + "dill.loads", + "jsonpickle.decode", + "joblib.load", + "torch.load", + "numpy.load", } )