You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Post-syscall buffer rewriting can silently alter Falco event data thoughts on mitigations?
#3909
We've been doing research on post-syscall telemetry deception techniques specifically, whether eBPF kretprobe hooks combined with bpf_probe_write_user() can alter the data that Falco's userspace process reads from its perf/ring buffer.
The observation
Falco's architecture captures syscall events via eBPF probes in kernel space (great), but the rule matching, alerting, and decision-making all happen in userspace. The Falco process reads captured events from a perf buffer using read(). This creates a window:
Kernel: eBPF probe captures syscall event
|
v
perf buffer (kernel memory)
|
v
User: falco process calls read() on perf fd
|
v <-- buffer can be modified here via bpf_probe_write_user()
|
falco parses potentially altered event
|
rule matching on modified data → no alert or wrong alert
An attacker with root + CAP_BPF can attach a kretprobe to ksys_read, detect that the calling process is falco (via bpf_get_current_comm()), and rewrite security-relevant strings in the returned buffer for example:
exploit → nominal
critical → debug
/etc/shadow → /etc/sunshn
reverse → forward
The replacement strings are the same length, so the buffer structure stays intact. Falco continues running, appears healthy, but processes altered data.
What we tested
Falco with modern eBPF driver
28 different telemetry agents targeted by comm name prefix (5-char match)
31 redaction rules across 6 categories (security keywords, severity levels, paths, auth tokens, network indicators, process names)
Read-back verification confirms bpf_probe_write_user() succeeds on Falco's buffers
Discussion points
Is this a known concern? We couldn't find prior discussion of post-syscall buffer rewriting targeting Falco specifically.
Kernel-space rule matching Tetragon and Tracee do some detection logic in-kernel, which makes them resistant to this specific technique (the enforcement happens before data reaches userspace). Would moving critical rule matching to the eBPF layer be feasible for Falco?
Buffer integrity verification Could Falco hash or checksum the perf buffer contents in-kernel and verify them in userspace before rule evaluation?
bpf_probe_write_user() detection Falco already detects many eBPF operations. Could a rule detect bpf_probe_write_user() calls targeting Falco's own PID/buffers?
BPF_MAP_FREEZE Separately from this buffer technique, we also noticed that Falco's critical BPF maps (syscall_enter_tail, syscall_exit_tail prog_arrays) are not frozen with BPF_MAP_FREEZE. An attacker can zero these to silently disable all syscall event processing. Would freezing these maps after initialization be possible?
This is research conducted under responsible disclosure principles the tool is designed for defensive verification (testing whether your monitors can be blinded), not for offensive use.
We'd love to hear the maintainers' and community's thoughts on potential mitigations. Happy to provide more technical details or collaborate on hardening.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hey everyone,
We've been doing research on post-syscall telemetry deception techniques specifically, whether eBPF
kretprobehooks combined withbpf_probe_write_user()can alter the data that Falco's userspace process reads from its perf/ring buffer.The observation
Falco's architecture captures syscall events via eBPF probes in kernel space (great), but the rule matching, alerting, and decision-making all happen in userspace. The Falco process reads captured events from a perf buffer using
read(). This creates a window:An attacker with root + CAP_BPF can attach a kretprobe to
ksys_read, detect that the calling process isfalco(viabpf_get_current_comm()), and rewrite security-relevant strings in the returned buffer for example:exploit→nominalcritical→debug/etc/shadow→/etc/sunshnreverse→forwardThe replacement strings are the same length, so the buffer structure stays intact. Falco continues running, appears healthy, but processes altered data.
What we tested
bpf_probe_write_user()succeeds on Falco's buffersDiscussion points
Is this a known concern? We couldn't find prior discussion of post-syscall buffer rewriting targeting Falco specifically.
Kernel-space rule matching Tetragon and Tracee do some detection logic in-kernel, which makes them resistant to this specific technique (the enforcement happens before data reaches userspace). Would moving critical rule matching to the eBPF layer be feasible for Falco?
Buffer integrity verification Could Falco hash or checksum the perf buffer contents in-kernel and verify them in userspace before rule evaluation?
bpf_probe_write_user()detection Falco already detects many eBPF operations. Could a rule detectbpf_probe_write_user()calls targeting Falco's own PID/buffers?BPF_MAP_FREEZE Separately from this buffer technique, we also noticed that Falco's critical BPF maps (
syscall_enter_tail,syscall_exit_tailprog_arrays) are not frozen withBPF_MAP_FREEZE. An attacker can zero these to silently disable all syscall event processing. Would freezing these maps after initialization be possible?Our research
The technique is documented in our research tool SunnyDayBPF: https://github.com/azqzazq1/SunnyDayBPF
This is research conducted under responsible disclosure principles the tool is designed for defensive verification (testing whether your monitors can be blinded), not for offensive use.
We'd love to hear the maintainers' and community's thoughts on potential mitigations. Happy to provide more technical details or collaborate on hardening.
Azizcan Daştan, Milenium Security
All reactions