Skip to content

feat: make the several-document YAML loaders deserialization sinks - #124

Merged
SizzleUnrlsd merged 2 commits into
mainfrom
feat/yaml-load-all-sinks
Sep 24, 2026
Merged

SizzleUnrlsd merged 2 commits into
mainfrom
feat/yaml-load-all-sinks

Conversation

@SizzleUnrlsd

Copy link
Copy Markdown
Contributor

Closes #123.

yaml.load_all, yaml.full_load_all and yaml.unsafe_load_all were not sinks: attacker input reaching them went unreported, while their single-document versions were. They are DESERIALIZATION sinks now; yaml.load_all gets the same SafeArgument as yaml.load (#121), both reading one _SAFE_YAML_LOADERS constant; yaml.safe_load_all stays a non-sink.

Tests (end to end, tests/test_safe_arguments.py): each of the three loaders reached by request.data is one finding; load_all with SafeLoader and safe_load_all are none. The usage guide's rule table lists the loaders covered and the safe-loader exception. 973 passed; ruff and mypy clean. No regression-corpus project calls these loaders.

yaml.load_all, full_load_all and unsafe_load_all reached by HTTP input
are insecure deserializations; load_all with a safe loader and
safe_load_all are not.
yaml.load_all, yaml.full_load_all and yaml.unsafe_load_all load a stream
of documents as their single-document versions do, but attacker input
reaching them went unreported. They are sinks now; yaml.load_all shares
the safe loaders of yaml.load through one constant. The usage guide
lists the loaders the rule covers and the safe-loader exception.

Closes #123
@SizzleUnrlsd SizzleUnrlsd self-assigned this Sep 24, 2026
@SizzleUnrlsd
SizzleUnrlsd merged commit a10277f into main Sep 24, 2026
10 checks passed
@SizzleUnrlsd
SizzleUnrlsd deleted the feat/yaml-load-all-sinks branch September 24, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detection: yaml.load_all, full_load_all and unsafe_load_all are deserialization sinks

1 participant