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

flow: fix empty template.xxx in flow #5106

Merged
merged 1 commit into from
Apr 25, 2024
Merged

flow: fix empty template.xxx in flow #5106

merged 1 commit into from
Apr 25, 2024

Conversation

tarunKoyalwar
Copy link
Member

@tarunKoyalwar tarunKoyalwar commented Apr 25, 2024

Proposed Changes

[JS] <nil>
[WRN] [CVE-2024-4040] Could not execute step: [:RUNTIME] failed to execute flow
log(template)
if ( !template.hasOwnProperty('username') || !template.hasOwnProperty('password') ) {
  // if username or password is not provided, run unauthenticated exploit
  http("unauth-exploit")
} else {
  // if username and password is provided, run login script and authenticated exploit
  http("login") && http("auth-exploit")
}

 <- TypeError: Cannot read property 'hasOwnProperty' of undefined or null at <eval>:2:7(6)
[INF] No results found. Better luck next time!
  • this type error ( javascript ) happens if template is nil , this pr creates a empty map instead of nil/null so that it can be easily used in flow without additional check for ( template != null )

@tarunKoyalwar tarunKoyalwar self-assigned this Apr 25, 2024
@tarunKoyalwar tarunKoyalwar marked this pull request as ready for review April 25, 2024 11:06
@ehsandeep ehsandeep merged commit 7ce1b3e into dev Apr 25, 2024
12 checks passed
@ehsandeep ehsandeep deleted the fix-nil-template-vars branch April 25, 2024 11:25
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.

2 participants