Skip to content

fix(userspace): Escape output controls - #3899

Closed
mark-liu wants to merge 1 commit into
falcosecurity:masterfrom
mark-liu:userspace/escape-output-controls
Closed

mark-liu wants to merge 1 commit into
falcosecurity:masterfrom
mark-liu:userspace/escape-output-controls

Conversation

@mark-liu

Copy link
Copy Markdown

What type of PR is this?

/kind bug

Any specific area of the project related to this PR?

/area engine

What this PR does / why we need it:

Escapes control characters in plain text Falco output so event field values cannot inject forged lines or terminal control sequences.

  • I kept JSON output on nlohmann::json::dump() so structured consumers do not get double-escaped values
  • I handled internal plain text messages because they use the same output sinks
  • I left the libs formatter path alone because Falco owns the text serialization boundary here

Which issue(s) this PR fixes:

Closes #3895

Special notes for your reviewer:

Assumption: downstream JSON consumers expect decoded output_fields values to stay unchanged.

Out of scope: format_event() still assumes a non-empty rule output format before indexing message_format[0].

Does this PR introduce a user-facing change?:

Plain text outputs now escape control characters in rendered alert text.

Signed-off-by: Mark Liu <mark@prove.com.au>
@poiana

poiana commented May 24, 2026

Copy link
Copy Markdown
Contributor

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@poiana

poiana commented May 24, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mark-liu
Once this PR has been reviewed and has the lgtm label, please assign ekoops for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana

poiana commented May 24, 2026

Copy link
Copy Markdown
Contributor

Welcome @mark-liu! It looks like this is your first PR to falcosecurity/falco 🎉

@github-actions

Copy link
Copy Markdown

This PR may bring feature or behavior changes in the Falco engine and may require the engine version to be bumped.

Please double check userspace/engine/falco_engine_version.h file. See versioning for FALCO_ENGINE_VERSION.

/hold

@ekoops

ekoops commented May 27, 2026

Copy link
Copy Markdown
Contributor

Hey @mark-liu . Thank you for this contribution, but as mentioned in #3895 (comment), the issue was already fixed, and the fix was delivered with Falco 0.44.0.
For this reason, I'm gonna close it. Feel free to reopen if you find out some corner-case still needs to be addressed.

@ekoops ekoops closed this May 27, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in Falco Roadmap May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Log injection via unencoded control characters in event field values

3 participants