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

run workflow subtemplates with new ScanContext #5031

Conversation

tovask
Copy link
Contributor

@tovask tovask commented Apr 11, 2024

Proposed changes

When executing a workflow, the same ScanContext was used for all the Executers, and since the subtemplates in a workflow run in parallel, the OnResult callback for one template could be overwritten with another template's callback.
Running the subtemplates with a new ScanContext (keeping the same input, i.e.: targets, cookies, args) solves this problem.

fix #4933

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@GeorginaReeder
Copy link

Thanks so much for your contribution @tovask , we appreciate it!

We also have a Discord server that you're welcome to join. It's a great place to connect with fellow contributors and stay updated with the latest developments!

Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - The shared contextargs.Context preserves the internal value-sharing functionality altough in different scan.Context

Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm !

@tarunKoyalwar tarunKoyalwar requested a review from ehsandeep April 11, 2024 20:15
@ehsandeep ehsandeep merged commit 0d5e26d into projectdiscovery:dev Apr 11, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect result output from conditional workflows
5 participants