-
Notifications
You must be signed in to change notification settings - Fork 459
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
windows/powershell: fix regexp constraints in event 800 parameter detail processing #3495
Conversation
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
🌐 Coverage report
|
@@ -229,7 +229,7 @@ processors: | |||
field: param3 | |||
source: |- | |||
def parseRawDetail(String raw) { | |||
Pattern detailRegex = /^(.+)\((.+)\)\:\s*(.+)?$/; | |||
Pattern detailRegex = /^([^:(]+)\((.+)\)\:\s*(.+)?$/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know the answer, but I'm wondering if these are compiled on each function invocation. If they were outside the function maybe they would only be compiled once per processor execution. No need to change anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried that and it fails to compile if they are outside the function definition.
What does this PR do?
This tightens constraints in the regular expression to prevent greedy consumption of the input and regexp complexity explosion.
Checklist
changelog.yml
file.Author's Checklist
How to test this PR locally
Related issues
Screenshots