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

iRule regex parsing might cause an indefinite hang #78

Closed
jszczepanskif5 opened this issue Jan 31, 2022 · 2 comments
Closed

iRule regex parsing might cause an indefinite hang #78

jszczepanskif5 opened this issue Jan 31, 2022 · 2 comments
Labels
bug Something isn't working jira Jira created for this issue
Milestone

Comments

@jszczepanskif5
Copy link

Environment

  • ACC Version: 1.18
  • AS3 Version: N/A
  • BIG-IP Version: N/A

Summary

Found in a client UCS archive.

Parsing the following conf file causes ACC to become unresponsive, likely stuck in an infinite loop with 100% CPU usage. The freeze seems to only happen when there's another ltm rule object somewhere after the one with this problematic regex, otherwise we get a regular exception.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Convert following config:
ltm rule /tenant_268/application_268/l4j {
when HTTP_REQUEST_DATA {
  set tmpPayload [HTTP::payload]
  set payload [URI::decode $tmpPayload]
  while { $payload ne $tmpPayload } {
    set tmpPayload $payload
    set payload [URI::decode $tmpPayload]
  }

  if {[string tolower $payload] matches_regex {\$\{\s*(j|\$\{).+?\}}} {
    drop
    event disable all
  }
}
}
ltm rule /tenant_268/application_268/foo {

}
  1. ACC is now frozen indefinitely.

Note that if we attempt to convert the first iRule without including the second one (or replacing it with any object, e.g. ltm pool), we get the following error:

/app/src/engines/parser.js:150
                if (!(line.trim().startsWith('#') && ruleFlag)) {
                           ^

TypeError: Error parsing input file. Please open an issue at https://github.com/f5devcentral/f5-automation-config-converter/issues and include the following error:
Cannot read properties of undefined (reading 'trim')
    at groupObjects (/app/src/engines/parser.js:150:28)
    at /app/src/engines/parser.js:255:30
    at Array.forEach (<anonymous>)
    at module.exports (/app/src/engines/parser.js:184:28)
    at mainRunner (/app/src/main.js:39:18)
    at main (/app/src/main.js:128:30)
@delgadillo22
Copy link

Thank you for the report, I've added this to our internal backlog as CHARON-584 and will get this prioritized.

@p-semenov-f5 p-semenov-f5 added the jira Jira created for this issue label Feb 1, 2022
@p-semenov-f5
Copy link
Collaborator

Fixed in 1.19

@mdditt2000 mdditt2000 added this to the 1.19 milestone Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jira Jira created for this issue
Projects
None yet
Development

No branches or pull requests

4 participants