mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-29 21:33:06 +00:00
fix(code): do NOT compile single code protocol w/o request.SelfContained
Signed-off-by: Dwi Siswanto <git@dw1.io>
This commit is contained in:
parent
e945ac1e25
commit
9811d31172
@ -47,7 +47,7 @@ var (
|
||||
ErrCodeExecutionDeadline = errkit.New("code execution deadline exceeded").SetKind(errkit.ErrKindDeadline).Build()
|
||||
)
|
||||
|
||||
// Request is a request for the SSL protocol
|
||||
// Request is a request for the code protocol
|
||||
type Request struct {
|
||||
// Operators for the current request go here.
|
||||
operators.Operators `yaml:",inline,omitempty"`
|
||||
@ -70,6 +70,9 @@ type Request struct {
|
||||
// description: |
|
||||
// Source File/Snippet
|
||||
Source string `yaml:"source,omitempty" json:"source,omitempty" jsonschema:"title=source file/snippet,description=Source snippet"`
|
||||
// description: |
|
||||
// SelfContained specifies if the request is self-contained.
|
||||
SelfContained bool `yaml:"-" json:"-"`
|
||||
|
||||
options *protocols.ExecutorOptions `yaml:"-" json:"-"`
|
||||
preConditionCompiled *goja.Program `yaml:"-" json:"-"`
|
||||
@ -130,6 +133,11 @@ func (request *Request) Compile(options *protocols.ExecutorOptions) error {
|
||||
}
|
||||
request.preConditionCompiled = preConditionCompiled
|
||||
}
|
||||
|
||||
if !request.options.IsMultiProtocol && !request.SelfContained {
|
||||
return errorutil.NewWithTag(request.TemplateID, "could not compile single %q protocol without enabling self-contained", request.Type())
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user