Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix decode_cef handling of escaped LF and CR #29268

Merged

Conversation

andrewkroh
Copy link
Member

@andrewkroh andrewkroh commented Dec 3, 2021

What does this PR do?

Escaped LF and CR were not handled inside of CEF extension value.
Those characters are now accepted and replaced with their unescaped
equivalents.

Fixes #16995

Why is it important?

CEF decoding was broken by presence of \n or \r in extension values.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Dec 3, 2021
@andrewkroh andrewkroh force-pushed the bugfix/fb/decode-cef-escaped-newline branch from 330dd65 to 82c012e Compare December 3, 2021 17:31
@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Dec 3, 2021
@andrewkroh andrewkroh force-pushed the bugfix/fb/decode-cef-escaped-newline branch from 82c012e to 2ddc373 Compare December 3, 2021 17:32
@andrewkroh andrewkroh added backport-v7.16.0 Automated backport with mergify backport-v8.0.0 Automated backport with mergify and removed backport-skip Skip notification from the automated backport with mergify labels Dec 3, 2021
@andrewkroh andrewkroh requested a review from a team December 3, 2021 17:35
@elasticmachine
Copy link
Collaborator

elasticmachine commented Dec 3, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-12-06T18:15:48.958+0000

  • Duration: 93 min 31 sec

  • Commit: 520b4c4

Test stats 🧪

Test Results
Failed 0
Passed 2415
Skipped 152
Total 2567

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Escaped LF and CR were not handled inside of CEF extension value.
Those characters are now accepted and replaced with their unescaped
equivalents.

Fixes elastic#16995
@andrewkroh andrewkroh force-pushed the bugfix/fb/decode-cef-escaped-newline branch from 2ddc373 to 046ad0a Compare December 6, 2021 17:44
@elastic elastic deleted a comment from mergify bot Dec 6, 2021
Replace fgoto with fnext
@andrewkroh andrewkroh force-pushed the bugfix/fb/decode-cef-escaped-newline branch from 046ad0a to 520b4c4 Compare December 6, 2021 18:15
@andrewkroh andrewkroh requested a review from efd6 December 8, 2021 13:37
@andrewkroh andrewkroh merged commit 28d00c7 into elastic:master Dec 9, 2021
mergify bot pushed a commit that referenced this pull request Dec 9, 2021
* Fix decode_cef handling of escaped LF and CR

Escaped LF and CR were not handled inside of CEF extension value.
Those characters are now accepted and replaced with their unescaped
equivalents.

Replace fgoto with fnext to fix generated Go code that had duplicate 'goto' statements.

Fixes #16995

(cherry picked from commit 28d00c7)
mergify bot pushed a commit that referenced this pull request Dec 9, 2021
* Fix decode_cef handling of escaped LF and CR

Escaped LF and CR were not handled inside of CEF extension value.
Those characters are now accepted and replaced with their unescaped
equivalents.

Replace fgoto with fnext to fix generated Go code that had duplicate 'goto' statements.

Fixes #16995

(cherry picked from commit 28d00c7)
andrewkroh added a commit that referenced this pull request Dec 9, 2021
* Fix decode_cef handling of escaped LF and CR

Escaped LF and CR were not handled inside of CEF extension value.
Those characters are now accepted and replaced with their unescaped
equivalents.

Replace fgoto with fnext to fix generated Go code that had duplicate 'goto' statements.

Fixes #16995

(cherry picked from commit 28d00c7)

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
andrewkroh added a commit that referenced this pull request Dec 9, 2021
* Fix decode_cef handling of escaped LF and CR

Escaped LF and CR were not handled inside of CEF extension value.
Those characters are now accepted and replaced with their unescaped
equivalents.

Replace fgoto with fnext to fix generated Go code that had duplicate 'goto' statements.

Fixes #16995

(cherry picked from commit 28d00c7)

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.16.0 Automated backport with mergify backport-v8.0.0 Automated backport with mergify bug Filebeat Filebeat :Processors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filebeat decode_cef parser error with \n\r chars in message
3 participants