Skip to content

Stability regression in v0.39.2: attempt to subtract with overflow #950

@alex-security-guy

Description

@alex-security-guy

Good day :)

I am a security researcher with X41, and our team has recently performed a security review of Routinator, which uses your project.
During this review we were performing some fuzz testing, and found what seems to be a stability regression from version v.038.3 to v0.39.2.
The old version will respond to parsing the attached input with an Error occurred Xml(Syntax(UnclosedDoctype)), whereas the new version will panic with the aforementioned attempt to subtract with overflow.

The Routinator team was kind enough to extract only the quick-xml code, a minimal main of which you can find below:

use quick_xml::events::Event;
use quick_xml::reader::Reader;
use std::fs::File;
use std::io::BufReader;

fn main() {
    let f = File::open("crashing_notification.xml").unwrap();
    let reader = BufReader::new(f);
    let mut reader = Reader::from_reader(reader);
    let mut buf = Vec::new();
    loop {
        match reader.read_event_into(&mut buf) {
            Ok(Event::Eof) => break,
            _ => (),
        }
        buf.clear();
    }
}

And the crashing input you can find here: crashing_notification.xml

Hopefully this helps, I hope you have a nice day 😊

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions