Skip to content

Commit eb2a78c

Browse files
Merge branch 'master' into Encoder-Improvement
2 parents 1090950 + 7963d38 commit eb2a78c

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

core/src/main/kotlin/org/evomaster/core/EMConfig.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2537,6 +2537,11 @@ class EMConfig {
25372537
@Cfg("Strategy to classify inputs for potential vulnerability classes related to an REST endpoint.")
25382538
var vulnerableInputClassificationStrategy = VulnerableInputClassificationStrategy.MANUAL
25392539

2540+
@Experimental
2541+
@Cfg("HTTP callback verifier hostname. Default is set to 'localhost'. If the SUT is running inside a " +
2542+
"container (i.e., Docker), 'localhost' will refer to the container. This can be used to change the hostname.")
2543+
var callbackURLHostname = "localhost"
2544+
25402545
@Experimental
25412546
@Cfg("Enable language model connector")
25422547
var languageModelConnector = false

core/src/main/kotlin/org/evomaster/core/problem/security/service/HttpCallbackVerifier.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class HttpCallbackVerifier {
8686
// Regex pattern looks for URL contains the pattern generated by the [HTTPCallbackVerifier].
8787
// TODO: Change the port to Regex
8888
val pattern =
89-
"""^http:\/\/localhost:${wireMockServer!!.port()}\/EM_SSRF_\d+$""".toRegex()
89+
"""^http:\/\/${config.callbackURLHostname}:${wireMockServer!!.port()}\/EM_SSRF_\d+$""".toRegex()
9090

9191
return pattern.matches(value)
9292
}
@@ -117,7 +117,7 @@ class HttpCallbackVerifier {
117117
)
118118
)
119119

120-
val link = "http://localhost:${wireMockServer!!.port()}$stub"
120+
val link = "http://${config.callbackURLHostname}:${wireMockServer!!.port()}$stub"
121121

122122
actionStubMapping[name] = ActionStubMapping(
123123
counter,

docs/options.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ There are 3 types of options:
241241
|`aiResponseClassifierWarmup`| __Int__. Number of training iterations required to update classifier parameters. For example, in the Gaussian model this affects mean and variance updates. For neural network (NN) models, the warm-up should typically be larger than 1000. *Default value*: `10`.|
242242
|`appendToTargetHeuristicsFile`| __Boolean__. Whether should add to an existing target heuristics file, instead of replacing it. It is only used when processFormat is TARGET_HEURISTIC. *Default value*: `false`.|
243243
|`bbProbabilityUseDataPool`| __Double__. Specify the probability of using the data pool when sampling test cases. This is for black-box (bb) mode. *Constraints*: `probability 0.0-1.0`. *Default value*: `0.8`.|
244+
|`callbackURLHostname`| __String__. HTTP callback verifier hostname. Default is set to 'localhost'. If the SUT is running inside a container (i.e., Docker), 'localhost' will refer to the container. This can be used to change the hostname. *Default value*: `localhost`.|
244245
|`classificationRepairThreshold`| __Double__. If using THRESHOLD for AI Classification Repair, specify its value. All classifications with probability equal or above such threshold value will be accepted. *Constraints*: `probability 0.0-1.0`. *Default value*: `0.8`.|
245246
|`discoveredInfoRewardedInFitness`| __Boolean__. If there is new discovered information from a test execution, reward it in the fitness function. *Default value*: `false`.|
246247
|`dockerLocalhost`| __Boolean__. Replace references to 'localhost' to point to the actual host machine. Only needed when running EvoMaster inside Docker. *Default value*: `false`.|

0 commit comments

Comments
 (0)