You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Pipeline.loads/from_dict raise AttributeError instead of DeserializationError for non-mapping documents #13738
Pipeline.loads() documents :raises DeserializationError:, but a YAML document that is not a mapping reaches Pipeline.from_dict(), which reads its keys straight off the input (data.get(...)). Callers get a raw AttributeError with a traceback inside Haystack instead of the documented error.
This shows up with ordinary inputs, not just hostile ones: an empty or comment-only pipeline file unmarshals to None.
fromhaystackimportPipelinePipeline.loads("") # AttributeError: 'NoneType' object has no attribute 'get'Pipeline.loads("[]") # AttributeError: 'list' object has no attribute 'get'Pipeline.loads("42") # AttributeError: 'int' object has no attribute 'get'Pipeline.from_dict(None)
Expected behavior
DeserializationError, as documented on Pipeline.loads() and handled by callers that already catch it.
Additional context
test/fuzz/fuzz_pipeline_loads.py already records this as a known finding: it carries _KNOWN_BUGS = (AttributeError,) and tolerates that exception for the whole target, so any otherAttributeError raised from loads() is hidden too. The comment there says the tolerance should be removed once from_dict validates its input type.
Not a security report: per SECURITY.md, loading untrusted pipeline definitions is out of scope by design. This is about the documented error contract and the fuzz target's blind spot.
Activity