-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Incorrect result output from conditional workflows #4933
Comments
The issue seems to be that all templates in a workflow use the same |
I think workflows should have never been implemented in the actual way and should be deprecated as a whole. I think that the implementation should have been from the very beginning as proposed in #641 (comment) in a scripting like fashion. As now finally a scripting engine has been introduced, it would be just more functional to extend the The reported example would become more concise and readable, something like: if run(always_match1.yaml) {
if run(never_match.yaml) {
run(always_match3.yaml)
}
run(always_match2.yaml)
} |
The big advantage of the workflow feature is that it allows templates to be executed from separate files, which is really useful when we have a lot of (conditionally concatenated) tests to run or when we want to reuse some templates in multiple scans. |
remove unused callbacks from ScanContext (OnError, OnResult, OnWarning) fix projectdiscovery#4933
@tovask This would be already covered by the previous syntax with the additional benefit of more complex control flow. The template loading would not be limited to one file name but to patterns (ex. |
@Mzack9999 you're right! Btw, another advantage of the workflows is that the templates (in the same level) can run in parallel. Not sure how hard to achieve that from |
I have some complex scenarios with workflows:
(This may sounds complicated, so better to check out the example below 😉⬇️)
Nuclei version:
3.1.0 - 3.2.2
Steps To Reproduce:
I created this simplified workflow to reproduce the issue:
always_match1.yaml
:Similarly, there're
always_match2.yaml
,always_match3.yaml
and anever_match.yaml
template (this last one has an always_false matcher of course).Current Behavior:
If
always_match2
finishes beforenever_match
, thenalways_match3
is executed, despitenever_match
did not match:Or when the
always_match2
is slowler thannever_match
, then even thealways_match2
does not show up:Expected Behavior:
Until version 3.0.4 it works as expected:
So it seems like the results of the templates got mixed inside the workflow. Any guess or idea?
Using Matcher Name based conditions might be a workaround, but in my case it's not an option, as I have templates with
matchers-condition: and
, and couldn't get it work by referring a named matcher.The text was updated successfully, but these errors were encountered: