DominoTree / rs-ipfix

Fast Rust IPFIX (RFC7011) parsing library with JSON export, based on nom
4 stars 3 forks source link

panic #2

Open skoky opened 3 years ago

skoky commented 3 years ago

I see this in log when using the lib

thread 'ipfix' panicked at 'range end index 297 out of range for slice of length 88', /usr/local/cargo/git/checkouts/rs-ipfix-42c2f7fc459fd94f/0714f22/src/lib.rs:130:38

Is it anything obvious?

DominoTree commented 3 years ago

My first guess would be that the data it's being sent is somehow corrupted or doesn't match the IPFIX format. Do you happen to have a pcap of traffic that triggers this?

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Thursday, February 4th, 2021 at 6:40 AM, Laco Skokan notifications@github.com wrote:

I see this in log when using the lib

thread 'ipfix' panicked at 'range end index 297 out of range for slice of length 88', /usr/local/cargo/git/checkouts/rs-ipfix-42c2f7fc459fd94f/0714f22/src/lib.rs:130:38

Is it anything obvious?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

skoky commented 3 years ago

yes, it was. I was passing in Netflow v9 starting with "0009" or even some other data. It would be wise to check netflow/ipfix version in header and also not to panic if length is invalid in "lib.rs:130" Thanks for the lib anyway

DominoTree commented 3 years ago

I'll go ahead and make that change, it really shouldn't panic on any malformed or unexpected traffic