Attacker is able to inject own assertion in login process
- Fixed in 3 months
- Paid in 2 months
- Disclosed after 3 months
As already discussed with Dan Callahan by email, here is a more
detailed bug report of one of our findings.
During the login process (initiated by navigator.id.get or
navigator.id.request) an attacker (e.g., in an advertisement iframe)
can inject postMessages in the communication between the login dialog
and the BrowserID JavaScript (include.js) running at the web page of
the relying party. The communication between the login dialog and
include.js is handled by the WinChan library, which doesn't check the
sender of a received postMessage.
To abuse this insufficient handling of received postMessages, a
malicious JavaScript can, for instance, send the following postMessage
to the relying party:
{
"a" : "response",
"d" : {
"assertion" : <assertion for [address removed]>,
"email" : ""
}
}
Such a message can be constantly sent by the malicious JavaScript.
When the user wants to sign in at the relying party, she clicks on the
"Login with Persona" button, which then triggers either
navigator.id.get or navigator.id.request. Next, the login process
starts, which opens the login dialog using the WinChan library. A
postMessage handler gets registered by include.js at the relying
party's document (and also in the login dialog). Now, when the
postMessage handler at the relying party's document receives the
malicious message, it handles it as a valid response from the login
dialog. The login dialog is then instantly closed (probably without
the user noticing that a window has popped up for a very short
time). The malicious assertion is handed over to the onlogin handler
of the relying party, while the communication_iframe is informed that
no one is logged in. As the malicious assertion received by the
relying party can be a valid assertion for [address removed] (which
such an attacker can easily generate by himself), the relying party
considers the user to be logged in as
[address removed]. Alternatively, the malicious assertion can be
invalid, which then blocks the login completely (as constantly new
invalid assertions arrive at the relying party's document and all
further login dialogs get closed immediately).
The faked email address sent in such a malicious response is sent to
the communication_iframe, which double-checks if the user is logged in
at Persona and if the received email address is recorded as logged in
at the relying party in the localStorage. However, the
communication_iframe is only able to send "login" or "logout"
postMessages and no special error message. It is up to the relying
party how to handle (or detect) postMessages sent by the
communication_iframe in the case of mismatch. Further, if the attacker
knows which email address the user uses at the relying party, he can
send this email address in order to keep the communication_iframe
quiet. Additionally, the attacker can send an empty string as the
email address, which would also prevent the communication_iframe from
detecting a mismatch, if the user is not logged in at Persona or has
never been logged in at the relying party with her current browser.
To fix this issue, the onMessage function of the WinChan library
should be modified to check that the origin is the expected one
(Persona). Additionally, the redundant email address sent in the
"response" postMessage sent from the login dialog could be removed as
the email address is also contained in the assertion, where it can't
be spoofed. Further, after the communication_iframe has been informed
about the email address in the assertion, the include.js in RP could
wait for some acknowledgement (all checks ok) by the
communication_iframe before handing over the assertion to the onlogin
handler.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A high-severity security bug in Server: Identity. Mozilla made it public on 8 August 2013.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.