You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
suricata/rust/src
Sascha Steinbiss 713c379427 rfb: make sure size calculations do not overflow
Addresses #3570 by extra checking of calculated size requests.

With the given input, the parser eventually arrived at
parser::parse_failure_reason() which parsed from the remaining four
bytes (describing the string length) that the failure string to follow
would be 4294967295 bytes long. While calculating the total size of the
data to request via AppLayerResult::incomplete(), adding the four bytes
for the parsed but not consumed string length caused the u32 length to
overflow, resulting in a much smaller value triggering the bug condition.

This problem was addressed by more careful checking of values in each step
that could overflow: one subtraction, one addition (which could overflow
the usize length values), and a final check to determine whether the result
still fit into the u32 values required by AppLayerResult::incomplete().
If so, we would safely convert the values and pass them to the result type.
If not, we simply return AppLayerResult::err() but do not erroneously and
silently request the wrong amount.
6 years ago
..
applayertemplate app-layer: extend AppLayerResult to add convenience 6 years ago
dhcp rust: merge parser.rs into applayer.rs 6 years ago
dns rust: merge parser.rs into applayer.rs 6 years ago
ftp rust: Add types annotation when required 6 years ago
ikev2 rust: merge parser.rs into applayer.rs 6 years ago
krb rust: merge parser.rs into applayer.rs 6 years ago
nfs rust: merge parser.rs into applayer.rs 6 years ago
ntp rust: merge parser.rs into applayer.rs 6 years ago
rdp rust: merge parser.rs into applayer.rs 6 years ago
rfb rfb: make sure size calculations do not overflow 6 years ago
sip app-layer: extend AppLayerResult to add convenience 6 years ago
smb rust: merge parser.rs into applayer.rs 6 years ago
snmp app-layer: extend AppLayerResult to add convenience 6 years ago
tftp app-layer: change return codes 6 years ago
x509 rust/x509: map decoding errors to decoder events 6 years ago
applayer.rs app-layer: extend AppLayerResult to add convenience 6 years ago
common.rs rust: add common function to exchange CString objects from/to C 6 years ago
conf.rs
core.rs dns: register parsers from Rust 6 years ago
filecontainer.rs
filetracker.rs files: simplify pruning logic 6 years ago
json.rs
kerberos.rs rust: use the streaming version of combinators to fix incomplete reads 6 years ago
lib.rs ssl/tls: use the rust decoder to decode X.509 certificates 6 years ago
log.rs
lua.rs