Catch and rethrow yaml engine internal exception on generation - #609
Conversation
Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com>
Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com>
Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com>
Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com>
Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com>
Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com>
…nd testNormalGenerationWorks Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com>
Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com>
|
@pjfanning Made small change to use existing Now: we don't really have test to show how |
|
Ok: merged |
|
The OSS Fuzz trace is So we see that it is possible that org.snakeyaml.engine.v2.emitter.Emitter.expectNode can throw org.snakeyaml.engine.v2.exceptions.EmitterException under certain circumstances. I'm not sure how to make snakeyaml do this but we have some level of proof that is possible to trigger something like this. |
|
@pjfanning Ok. Given stack trace, maybe co-pilot could attempt a reproduction. FWTW, it sounds like empty YAML document, or mis-match with events. But I don't know how Fuzz case actually works; does it generate "YAML" content to round-trip (read-then-write) or something. But it does sound like there is probably a path that could trigger this. |
|
@cowtowncoder maybe it's not as important to worry about issues generating YAML or other data formats. Parsing is a more attackable API - it's harder to manipulate a scenario where issues in generators can be abused |
|
Yeah I don't really consider RuntimeException leakage a real attack vector anyway in Java, more a usability/correctness/ergonomic thing. |
see https://oss-fuzz.com/testcase-detail/4866995549175808