mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2026-01-31 15:53:10 +08:00
Restore backwards compat for JavaScript protocol
templates that omit the `Port` argument.
Regression was introduced in f4f2e9f2, which
removed the fallback for empty `Port` in
`(*Request).ExecuteWithResults`, causing templates
without `Port` to be silently skipped.
Now, if no `Port` is specified, the engine
executes the JavaScript block using the target
URL's port.
Fixes #6708.
Signed-off-by: Dwi Siswanto <git@dw1.io>
24 lines
544 B
YAML
24 lines
544 B
YAML
id: javascript-no-port-args
|
|
|
|
info:
|
|
name: JavaScript Template Without Port Args
|
|
author: dwisiswant0
|
|
severity: info
|
|
description: |
|
|
Test backwards compatibility for JavaScript templates without Port in args.
|
|
Templates should execute even when Port arg is not explicitly specified.
|
|
|
|
javascript:
|
|
- code: |
|
|
// Simple JavaScript code that does not require Port
|
|
let result = "executed";
|
|
Export(result);
|
|
|
|
args:
|
|
TestArg: "test-value"
|
|
|
|
matchers:
|
|
- type: dsl
|
|
dsl:
|
|
- success == true
|