File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import (
1313 "github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/contextargs"
1414 "github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/generators"
1515 "github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/helpers/writer"
16+ "github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/replacer"
1617 "github.com/projectdiscovery/nuclei/v3/pkg/scan"
1718 "github.com/projectdiscovery/nuclei/v3/pkg/types"
1819 "github.com/projectdiscovery/utils/env"
@@ -90,8 +91,12 @@ func GetLazyAuthFetchCallback(opts *AuthLazyFetchOptions) authx.LazyFetchSecret
9091 if strings .HasPrefix (v .Value , "$" ) {
9192 env .ExpandWithEnv (& v .Value )
9293 }
93- if val , ok := cliVars [v .Key ]; ok && val != "" {
94- v .Value = types .ToString (val )
94+ if strings .Contains (v .Value , "{{" ) {
95+ // if variables had value like {{username}}, then replace it with the value from cliVars
96+ // variables:
97+ // - key: username
98+ // value: {{username}}
99+ v .Value = replacer .Replace (v .Value , cliVars )
95100 }
96101 vars [v .Key ] = v .Value
97102 ctx .Input .Add (v .Key , v .Value )
You can’t perform that action at this time.
0 commit comments