File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
java/src/org/openqa/selenium/chrome Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 18
18
package org .openqa .selenium .chrome ;
19
19
20
20
import com .google .auto .service .AutoService ;
21
+ import com .google .common .collect .ImmutableList ;
22
+ import com .google .common .collect .ImmutableMap ;
21
23
22
24
import org .openqa .selenium .Capabilities ;
23
25
import org .openqa .selenium .ImmutableCapabilities ;
@@ -43,7 +45,14 @@ public String getDisplayName() {
43
45
44
46
@ Override
45
47
public Capabilities getCanonicalCapabilities () {
46
- return new ImmutableCapabilities (CapabilityType .BROWSER_NAME , CHROME .browserName ());
48
+ // Allowing any origin "*" through remote-allow-origins might sound risky but an attacker
49
+ // would need to know the port used to start DevTools to establish a connection. Given
50
+ // these sessions are relatively short-lived, the risk is reduced. Also, this will be
51
+ // removed when we only support Java 11 and above.
52
+ return new ImmutableCapabilities (
53
+ CapabilityType .BROWSER_NAME , CHROME .browserName (),
54
+ ChromeOptions .CAPABILITY ,
55
+ ImmutableMap .of ("args" , ImmutableList .of ("--remote-allow-origins=*" )));
47
56
}
48
57
49
58
@ Override
You can’t perform that action at this time.
0 commit comments