When Brave Shields is enabled, RTCPeerConnection.createOffer and RTCPeerConnection.createAnswer can resolve to undefined. The issue occurs when on an IP domain (e.g. 127.0.0.1 and possibly others).
Steps to Reproduce
Enable Shields.
Run the following script on the 127.0.0.1 domain (not localhost)
var pc = new RTCPeerConnection({
iceServers: [
{
urls: [
'stun:stun.l.google.com:19302',
'stun:global.stun.twilio.com:3478'
]
}
],
sdpSemantics: 'unified-plan'
})
pc.createOffer().then((offer) => {
console.log('offer:', offer) // undefined, against specification
})
Disable Shields and refresh.
Observe the above script no longer resolves to undefined.
Actual result:
Brave Shields breaks WebRTC on the 127.0.0.1 domain by causing these core WebRTC methods to resolve incorrectly.
Expected result:
Brave Shields should either reject these promises with an error or allow them to resolve correctly.
Reproduces how often:
Easily reproduced.
Brave version (brave://version info)
Version 1.10.97 Chromium: 83.0.4103.116 (Official Build) (64-bit) OSX
Version/Channel Information:
Can you reproduce this issue with the current release?
Yes.
Can you reproduce this issue with the beta channel?
Unknown - can try to reproduce if it would help.
Can you reproduce this issue with the nightly channel?
Unknown - can try to reproduce if it would help.
Other Additional Information:
Does the issue resolve itself when disabling Brave Shields?
Yes.
Does the issue resolve itself when disabling Brave Rewards?
No.
Is the issue reproducible on the latest version of Chrome?
No.
Description
When Brave Shields is enabled,
RTCPeerConnection.createOffer
andRTCPeerConnection.createAnswer
can resolve toundefined
. The issue occurs when on an IP domain (e.g.127.0.0.1
and possibly others).Steps to Reproduce
127.0.0.1
domain (notlocalhost
)undefined
.Actual result:
Brave Shields breaks WebRTC on the
127.0.0.1
domain by causing these core WebRTC methods to resolve incorrectly.Expected result:
Brave Shields should either reject these promises with an error or allow them to resolve correctly.
Reproduces how often:
Easily reproduced.
Brave version (brave://version info)
Version 1.10.97 Chromium: 83.0.4103.116 (Official Build) (64-bit) OSX
Version/Channel Information:
Can you reproduce this issue with the current release? Yes.
Can you reproduce this issue with the beta channel? Unknown - can try to reproduce if it would help.
Can you reproduce this issue with the nightly channel? Unknown - can try to reproduce if it would help.
Other Additional Information:
Does the issue resolve itself when disabling Brave Shields? Yes.
Does the issue resolve itself when disabling Brave Rewards? No.
Is the issue reproducible on the latest version of Chrome? No.
Miscellaneous Information:
See discussion of this issue here https://github.com/feross/simple-peer/issues/701.