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
Shivani Bhardwaj 77c21b05d2 tls/subject: use byte array instead of string
TLS parsers use x509-parser crate which parses X.509 certificates that
use ASN.1 DER encoding that can allow arbitrary byte sequences. An
attacker could inject null byte in a certificate anywhere to stump the
common language parsers terminating the string at a null byte leading to
a bypass of a possibly malicious certificate.

So far, the rust TLS parser for "Subject" used a pattern that involved:
-> Get ASN.1 DER encoded raw data from the x509-parser crate
-> Convert this raw data to a decoded string (Rust)
-> Convert the Rust string to CString
-- The problem lies here. CString only accepts proper strings/byte
buffers and converts it into an owned C-compatible, null-terminated
string. However, if any null byte occurs in the string passed to the
CString then it panics.
In the rust TLS parser, this panic is handled by returning NULL.

This means that the parser will error out during the decoding of the
certificate. However, Suricata must be able to detect the null byte
injection attack being an IDS/IPS.

Hence, replace all such string patterns w.r.t. TLS Subject with a byte
array.

Bug 7887
4 months ago
..
.cargo
derive rust: EnumString derive accepts a enum_string_style parameter 6 months ago
htp http: do not use a loop to find the tx count 4 months ago
src tls/subject: use byte array instead of string 4 months ago
suricatactl
suricatasc rust: pin indexmap 6 months ago
sys conf: add SCConfNodeChildValueIsFalse to check for false value 4 months ago
.gitignore
Cargo.lock.in rust/htp: convert to nom 8 5 months ago
Cargo.toml.in rust: add nom8 as a dependency 6 months ago
Makefile.am rust: bindgen more file functions 5 months ago
cbindgen.toml rust: bindgen SCSRepCatGetByShortname 6 months ago
rustfmt.toml