Skip to content

Commit dd85680

Browse files
committed
minor fixes
1 parent a683c90 commit dd85680

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

core/src/main/kotlin/org/evomaster/core/problem/rest/oracle/RestSecurityOracle.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ object RestSecurityOracle {
225225
// Simple XSS payloads inspired by big-list-of-naughty-strings
226226
// https://github.com/minimaxir/big-list-of-naughty-strings/blob/master/blns.txt
227227
val XSS_PAYLOADS = listOf(
228-
"javascript:alert('XSS')",
229228
"<img src=x onerror=alert('XSS')>",
230229
"<svg onload=alert('XSS')>",
231230
"<details open ontoggle=alert('XSS')>",

core/src/main/kotlin/org/evomaster/core/problem/rest/service/SecurityRest.kt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -926,9 +926,10 @@ class SecurityRest {
926926
var payloadInjected = false
927927

928928
// Attempt to inject payload into parameters
929-
actionCopy.parameters.filter { it is BodyParam || it is QueryParam || it is PathParam }.forEach { param ->
929+
actionCopy.parameters.forEach { param ->
930930

931931
// Skip if PathParam and payload contains "/" (would break URL structure)
932+
// TODO this in theory should be fine if properly escape entries in RestPath
932933
if(param is PathParam && payload.contains("/")){
933934
return@forEach
934935
}
@@ -951,7 +952,7 @@ class SecurityRest {
951952
}
952953
} catch(e: Exception){
953954
// Constraints might not allow the payload
954-
log.debug("Failed to inject XSS payload into ${gene.name}: ${e.message}")
955+
log.warn("Failed to inject XSS payload into ${gene.name}: ${e.message}")
955956
}
956957
}
957958
}
@@ -1004,7 +1005,7 @@ class SecurityRest {
10041005
}
10051006
} catch(e: Exception){
10061007
// Constraints might not allow the payload
1007-
log.debug("Failed to inject XSS payload into GET ${gene.name}: ${e.message}")
1008+
log.warn("Failed to inject XSS payload into GET ${gene.name}: ${e.message}")
10081009
}
10091010
}
10101011
}
@@ -1030,10 +1031,6 @@ class SecurityRest {
10301031
if(DefinedFaultCategory.XSS in faultsCategories){
10311032

10321033
val added = archive.addIfNeeded(evaluatedIndividual)
1033-
evaluatedIndividual.individual.seeMainExecutableActions().forEach {
1034-
println("$action - ${it.verb} ${it.path} -> ${it.auth.name} - ${added}")
1035-
}
1036-
10371034
assert(added)
10381035
continue@mainloop
10391036
}

0 commit comments

Comments
 (0)