Unplanned
Last Updated: 12 Apr 2023 06:49 by ADMIN
malwareinfosec
Created on: 10 Apr 2023 22:47
Type: Bug Report
0
Rule logic sequence

Hello,

I would like to know how the internal logic for rules with multiple conditions works.

For example, let's say we have 2 conditions and a rule will be matched if all conditions are met:

  1. URL contains 'example.com'
  2. Response Body contains 'string'
  • Are the conditions checked in any particular order (i.e. URL is checked first)?
  • What happens if the first condition fails, does it stop and not check for the second condition?

Thanks

4 comments
ADMIN
Nick Iliev
Posted on: 12 Apr 2023 06:49

Hello,

 

Regarding: ...what I would like to confirm is that if the first condition (in the order it appears) fails, does it then stop processing that rule and not even try to check if the second condition is true?

It should work as you described it, as it will benefit the app's performance, and we won't have to check each condition if one fails. However, I can confirm that, at this point, the conditions are not blocking, and they don't have priority - meaning that even if a match fails, we are still checking all other conditions, and only then a rule action is being applied (or not). That sounds feature that needs to be improved, so I am moving this one to the Feature Request section.

 

Regards,
Nick Iliev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

malwareinfosec
Posted on: 11 Apr 2023 22:34

Hi Nick,

I was trying to answer my question above and I think I see a potential problem.

Here's what I did:

I created a new rule with 2 conditions:

  • the first condition is very simple and should return quickly that it was not found
  • the second condition is a regular expression that will intentionally take a long time to return (and potentially freeze the UI)

If I understand the logic, it should check the first condition first and look for a string inside a URL and quickly return false. Because I selected "All these conditions" are met, if it fails on the first condition it should not even test the second condition that contains the regex.

However, it does because I am able to freeze Fiddler's UI with the second condition. The issue is that it should not have processed the second condition at all.

malwareinfosec
Posted on: 11 Apr 2023 21:44

Thanks Nick for your reply.

Regarding:

"if the matching criteria fail one of the listed conditions, the rule won't be executed"

what I would like to confirm is that if the first condition (in the order it appears) fails, does it then stop processing that rule and not even try to check if the second condition is true?

ADMIN
Nick Iliev
Posted on: 11 Apr 2023 05:53

Hello malwareinfosec,

 

Actions and rules are executed in the order they appear (from top to bottom). You can promote or demote a rule within the Rules tab or within a group to change its execution priority. That said, some actions are final, while others are non-final. Think of a final action as blocking that will prevent the execution of any other action/rule that follows. Learn more about final vs. non-final actions in the following documentation sections:

https://docs.telerik.com/fiddler-everywhere/knowledge-base/final-and-non-final-actions

https://docs.telerik.com/fiddler-everywhere/user-guide/rules#final-and-non-final-actions

https://docs.telerik.com/fiddler-everywhere/user-guide/rules#actions

Apart from the above, you can also set a matching logic that blocks the further execution of actions. For example, the logic in your screenshot is set as When all these rules are met any number of times, which means if the matching criteria fail one of the listed conditions, the rule won't be executed (on the session that doesn't meet the matching criteria), and its actions won't be applied. You can change the matching logic to match when any condition meets its criteria. For example, When any of these conditions ...

 

 

Regards,
Nick Iliev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.