svg-hush
svg-hush copied to clipboard
Consider using reliable crash-resistant xml parser instead of xml-rs.
After introducing libfuzzer https://github.com/cloudflare/svg-hush/pull/2#issuecomment-1201314078, found out that xms-rs crate has at least one place to crash with add to attempt with overflow.
Moreover xml-rs doesn't have contributions for almost a year and it seems to be abandoned.
cc @kornelski
The state of Rust XML parsers is a bit sad. I've tried quick-xml, but it wasn't better.
I tested this with the latest xml-rs version (v0.8.13) and the crash does not reproduce anymore. Consider updating the dependencies for this repository.
Just FYI, I have tested this again and found 2 more panics in xml-rs through the svg-hush harness:
- https://github.com/netvl/xml-rs/issues/225 (only with debug assertions enabled)
- https://github.com/netvl/xml-rs/pull/226 (fix got merged)
I've fixed and improved a bunch of things in xml-rs, and I think it's a good choice now. There might still be some bugs left, so please keep fuzzing!