SIP relay attack summary: It's a big User Agent FAIL.
To summarise the document, it claims there are essentially 3 different attacks, all similar in the result - a 3rd party could use a victims valid credentials for authentication, resulting in - for example - the victim being charged for calls made by the attacker.
Attack 1: Direct Relay (fig 1)
bob alice p2.com @rogue.com proxy.com @proxy.com | | | | | | INVITE F1 | INVITE F2 | | |--------------->|--------------->| | | 200 OK F4 | 200 OK F3 | | | | | ACK F5 | ACK F6 | | |--------------->|--------------->| | | | | | | mediasession | | |.................................| | | | | | | INVITE F8 | INVITE F7 | | | | modify | | | the request | | | INVITE F9 | | | | | 407 F10 | | | |--------------->| | | | ACK F11 | | | | | reverse | | | the changes | | | | 407 F12 | 407 F13 | | |--------------->|--------------->| | | ACK F15 | ACK F14 | | | | | INV w/auth F17| INV w/auth F16 | | | | modify | | | the request | | | | | | | INV w/auth F18 | | | | | | | |
In this attack, the attacker sends an INVITE directly to the victim. The victim answers and the call starts. The attacker then forces the victim to send a re-INVITE: possible though session timers, or possibly through social engineering (e.g, getting the call put on hold).
Once the attacker receives the re-INVITE send by the victim, an INVITE is sent to the proxy of the service provider that the victim uses. The service provider will respond back to the attacker with a 407 along with a Proxy-Authenticate header containing a realm and nonce.
The attacker then copies the Proxy-Authenticate header in to it's own 407 response (to the in-dialog re-INVITE), which the victim receives. The victim then re-sends the re-INVITE with valid Proxy-Authorization header credentials.
At this point, the attacker receives the re-INVITE with credentials in, and adds into the INVITE it originally sent to the service provider.
Because these credentials are legitimate, and the information covered by the response in the authorization header is the same, the call is allowed.
Solution
The solution to this attack is really simple, and something that all UAs should be doing already: A SIP UA must limit the scope in which it will send authentication credentials.
While it seems like every UA out there should already be doing that, it would appear many don't.
Summary
This is a SIP User Agent security FAIL, not a problem with SIP.
Attack 2: Through outbound proxy (fig 2)
bob alice p2.com @rogue.com proxy.com @proxy.com | | | | | | INVITE F1 | INVITE F2 | | |--------------->|--------------->| | | 200 OK F4 | 200 OK F3 | | | | | ACK F5 | ACK F6 | | |--------------->|--------------->| | | | | | | mediasession | | |.................................| | | | | | | INVITE F8 | INVITE F7 | | | | modify | | | the request | | | INVITE F9 | | | | | 407 F10 | | | |--------------->| | | | ACK F11 | | | | | reverse | | | the changes | | | | 407 F12 | 407 F13 | | |--------------->|--------------->| | | ACK F15 | ACK F14 | | | | | INV w/auth F17| INV w/auth F16 | | | | modify | | | the request | | | | | | | INV w/auth F18 | | | | | | | |
So presuming we've got a well configured SIP User Agent that only sends credentials to 407 responses received through the proxy it's configured with, the second attack highlighted in the draft is a method by which the attacker can perform the same operation, but through the proxy that the victim uses, by sending a call to the UA through the proxy.
Of course, any sensibly configured outbound proxy would remove credentials at the edge of the network that relate to the realms that the administrative domain the proxy is in may generate, rather than leave them in.
Assuming a well configured proxy is at play, this leaves an attack where a SIP User Agent which has credentials for 2 authentication realms - lets say proxy.atlanta.com andproxy.billoxi.com may potentially be tricked into sending credentials for proxy.atlana.comthrough it's proxy.billoxi.com proxy, and therefore wouldn't be protected by the network stripping out the credentials.
Solution
As in Attack #1, a User Agent should simply ensure that the scope in which it will send credentials is limited. A UA registered with two providers should only ever send proxy authentication details to the outbound proxy those credentials have been configured for.
Summary
This is a SIP User Agent security FAIL, and not a problem with SIP.
Attack 3: Directed Response (fig 3)
bob alice proxy.com @rogue.com proxy.com @proxy.com | | | | | | INVITE F1 | INVITE F2 | | | | remove proxy.com | | | from Record-Route | | | and Via headers | | | | 200 OK F3 | | |-------------------------------->| | | ACK F4 | | | | | | | | | mediasession | | |.................................| | | | | | | INVITE F6 | INVITE F5 | | | | modify | | | the request | | | INVITE F7 | | | | | 407 F8 | | | |--------------->| | | | ACK F9 | | | | | reverse | | | the changes | | | | 407 F10 | | |-------------------------------->| | | ACK F11 | | | | | INV w/auth F12 | | | | modify | | | the request | | | | | | | INV w/auth F13 | | | | | | | |
If the attacker can get the victim to call the attacker through it's proxy and the proxy is victim is publicly accessible, then the attacker could theoretically remove any Record-Route and Via headers from the request, and send a 200 response directly back to the victim. As the call originally went through the proxy, the UA could conceivably think this call was secured, and thus when the re-INVITE is triggered, it would send the credentials.
Solution
As with both the other attacks, a User Agent should simply ensure that the scope in which it will send credentials is limited. A UA should never send credentials to in any request that is not within the scope the credentials have been provided for.
Similarly, it's common for a device to have an option similar to send in-dialog requests through outbound proxy (i.e, draft-outbound style routing), in which case even a badly written the User Agent is not vulnerable.
Summary
This is a SIP User Agent security FAIL, and not a problem with SIP.Summary
In summary, I don't think this document presents any security issues in SIP itself, but does highlight and document some attack vectors that UA vendors should take on board when developing SIP User Agents, and a useful reminder to SIP service providers that you really need to really think about your network deployment (or pay me to do it for you).
Most specifically, a SIP user agent that is configured with proxy credentials should only ever send them in requests being transmitted directly to the outbound proxy the credentials have been provided for, and never to a 3rd party.
Service providers should ensure they remove authorization headers that relate to any realms they are administratively responsible for at the edge.
An important point in the above attacks is that a user agent appears to need to know when a request containing authentication is actually coming from it's proxy or not. In reality this is not the case, as the answer to the question of if credentials should be sent or not lies inwhere those credentials are going to be send to, not where the request for them came from.
Without sending all (including in-dialog) requests via an outbound proxy, it's not always going to be possible to tell when the next hop is really the proxy wanting authentication or not, specifically due to the fact that an in-dialog next hop may be a different hostname - for example sbc-13.b.london.edge.voip.co.uk - rather than the proxy itself - for example outbound.voip.co.uk.
The answer to this lies in (mutual) TLS between a SIP user agent and it's proxy, either TLS over TCP or more recently and cutting edge, DTLS over UDP. This allows for a client to be sure of where it's sending a request to before actually doing it, and thus that it doesn't leak it's proxy credentials when it shouldn't.
Until [D] TLS is universally deployed, a temporary workaround to this is ensure that the IP address you're sending to is in the SRV or A/AAA records of the proxy. While this is far from perfect, in reality it will work for most deployed service providers today. Note that if you do implement this, please remember to refresh the list based on TTL values in RRsets as well as the fact hosts may have both A, AAAA, and SRV records! and for goodness sake make the setting optional!
End-to-End & Multi-Hop proxy authentication
The above attacks don't cover end-to-end (WWW-Auth instead of proxy authentication), or multi-hop proxy authentication.
It's far harder to limit the scope in which the authentication should be released in these scenarios, as it's not a simple case of "only if sending to the proxy the credentials are for".Identity could be considered instead in these scenarios.
Although note that Identity isn't perfect yet - it has some issues with "baiting" - a subject for another day.