-
Notifications
You must be signed in to change notification settings - Fork 0
bpf: object bodies beginning with "HTTP/1." are captured as a response head #3
Copy link
Copy link
Open
Labels
capture-correctnessCapture completeness or correctnessCapture completeness or correctnesscoreHTTP/S3 parsing, event correlation and request assemblyHTTP/S3 parsing, event correlation and request assemblyebpfeBPF programs, maps, uprobes, tracepoints and kernel ABIeBPF programs, maps, uprobes, tracepoints and kernel ABIknown-limitationAccepted limitation documented for usersAccepted limitation documented for usersprivacyPrivacy or sensitive-data exposure boundaryPrivacy or sensitive-data exposure boundary
Description
Metadata
Metadata
Assignees
Labels
capture-correctnessCapture completeness or correctnessCapture completeness or correctnesscoreHTTP/S3 parsing, event correlation and request assemblyHTTP/S3 parsing, event correlation and request assemblyebpfeBPF programs, maps, uprobes, tracepoints and kernel ABIeBPF programs, maps, uprobes, tracepoints and kernel ABIknown-limitationAccepted limitation documented for usersAccepted limitation documented for usersprivacyPrivacy or sensitive-data exposure boundaryPrivacy or sensitive-data exposure boundary
looks_like_http_response(bpf/include/s3tap_parse.h) is a pure 7-byte prefix test forHTTP/1., andssl_read_capture(bpf/src/s3tap.bpf.c) calls it on everySSL_readreturn with no per-connection state.
So an S3 object whose bytes happen to begin with
HTTP/1.— an HTTP log, a proxy capture,an
.httpfixture — is treated as a response head. Up to ~4095 bytes of real objectcontent are copied into
evt_tls_data, reach userspace, and can be printed unlabeled by--dump-events.This is currently an ACCEPTED tradeoff, documented at the recognizer, at the call site, and
pinned by name in
bpf/tests/parser_tests.c("http: a body chunk beginning with a status line IS misread as a head (accepted)").
Filing it so the acceptance is a tracked decision rather than only a comment.
Suggested fix
A per-
(tgid, ssl)"a response is expected now" bit: set when a request write is captured,cleared when a response head is consumed. The recognizer then only fires at a genuine
message boundary instead of on arbitrary body bytes.
Needs a new LRU map and correct handling of pipelined/persistent connections carrying
several in-flight request/response pairs, so it is a capture-path design change rather than
a small patch.
Affected
bpf/include/s3tap_parse.h,bpf/src/s3tap.bpf.c(ssl_read_capture),crates/s3tap-cli/src/main.rs(--dump-eventsrendering).