Appears in C. Pautasso, T. Gschwind (Eds.):
2nd ECOWS Workshop on Emerging Web Services Technology – WEWST 2007,
CEUR Workshop Proceedings (CEUR-WS.org) Vol-313, ISSN 1613-0073, 2008.

SSL-over-SOAP: Towards a Token-based
Key Establishment Framework for Web Services
Sebastian Gajek, Lijun Liao, Bodo Möller, and Jörg Schwenk
Horst Görtz Institute for IT Security, Ruhr-Universität Bochum{sebastian.gajek | lijun.liao | joerg.schwenk}@nds.rub.de,bmoeller@crypto.rub.de

Abstract. Key establishment is essential for many applications ofcryptography. Its purpose is to negotiate keys for other cryptographic
schemes, usually for encryption and authentication. In a web services
context, WS-SecureConversation has been specified to make use ofnegotiated keys. The most popular key establishment scheme in theInternet is the (handshake protocol of the) Secure Socket Layer orTransport Layer Security protocol (SSL/TLS). However, SSL/TLS
has primarily been designed to secure HTTP, by encrypting andauthenticating TCP connections. It is thus not usable to negotiate keys
in SOAP connections with intermediaries. We propose SSL-over-SOAP,
a family of key establishment protocols for Web services. It is based
the design of the SSL handshake, so security analysis results forstandard SSL/TLS apply to our new proposal. We have implemented
this protocol in the framework of WS-Trust and WS-SecureConversation.
Keywords: Web Services Security, Key Establishment Protocol

1

Introduction

1.1

Motivation

Security is important for any distributed computing environment: Many passive
and active attacks have been described against such systems. Particularly challenging are service-oriented environments where the architecture is implemented
based on a range of technologies, and where applications are created as loosely
coupled and interoperable services. The Internet and its underlying infrastructure is the most pervasive IT system ever built—accordingly, more and more
applications are implemented as Web services. Thus, preserving the privacy andintegrity of these messages in service-oriented architectures becomes a challenging part of business integration, and secure message exchange a requirement forthe proliferation of Web services.
Because of the complexity of XML based security standards, the well-known
Secure Socket Layer (SSL) or Transport Layer Security (TLS) 1 protocol has
1

TLS is the official name for the more recent protocol versions in the SSL/TLS family.
We use the traditional name SSL as an umbrella term since our ultimate goal is to
move the protocol ideas away from the transport layer.

1become a de facto security standard for Web services. SSL provides a protected
TCP channel that can be used by higher order protocols, such as e.g. SOAP over
HTTP for Web Services. Because of its eminent role for the Web (as well as forother Internet protocols), the SSL protocol has been examined intensely [13–15],
without finding any severe security flaws.
However, classical SSL has some shortcomings when deployed in the context
of Web Services. First, SSL is a point-to-point security protocol. Web Services,by contrast, are loosely coupled applications: that is, messages may pass throughmultiple intermediary nodes, and the bindings to service endpoints may change.
In order to establish a secure SSL channel between two service endpoints, eachintermediary connection must be protected by SSL, and the application must
be able to decide which of the intermediary SSL certificates are trustworthy.
Second, SSL is a transport layer security protocol: SSL-protected messages are
secured while in transit on the network; after reception, the message plaintext(as recovered by the SSL layer) is forwarded to the application logic. Third,
SSL is not aware of the message structure, so messages are protected in an allor-nothing fashion. Higher layers do not directly benefit from SSL session keys.
One benefit of XML security technologies, in contrast, is to provide element-wisesigning and encryption: intermediaries can read and alter information only as
they are permitted to.
1.2

Motivating Example

Consider an example where a business flow requires passing an invoice throughmultiple parties. The invoice contains some vital information that only the ultimate receiver is allowed read; however, certain parts of the invoice are to beprocessed by intermediary parties. SSL fails because intermediaries have accessto the complete invoice in plaintext (or they would not be able to examine theinvoice at all). By contrast, SSL-over-SOAP allows for establishing a session key
between sender and ultimate receiver. This key can be used to authenticate andencrypt the invoice information to protect it from intermediaries. The sendercan choose which pieces of information to encrypt.
1.3

Contribution

The WS-* family of security schemes [1] aims to provide a security frameworkthat addresses all the security issues around web services. In particular, WSSecureConversation [2] defines how to use session keys in WS-Security, but does
not specify any specific key exchange protocols.
In this work, we close this gap by re-specifying the SSL handshake protocol
and the SSL record layer at the SOAP level, creating a new cryptographic protocol to be used with WS-SecureConversation. We thus do not need the “classical”
SSL at TCP level any more. Instead, we are able to provide all security services
offered by SSL (confidentiality, authentication, security of key establishment) at
SOAP level.
2

Incorporating the practically proven SSL protocol technology into the WS-*
family of security scheme allows us to design a protocol framework that benefits
from both technologies.
The main contribution of the SSL protocol to the web services world is security. In SSL, key agreement and authentication are closely connected, andexplicit key confirmation is provided by the Finished messages at the end of
the handshake protocol. By contrast, it is easy to show the the authenticatedvariant of the Diffie-Hellman key exchange [7] is vulnerable to man-in-the-middle
attacks in combination with XML wrapping attacks [12].
We propose SSL-over-SOAP as the first member of a family of practical
Web Services key establishment protocols. SSL-over-SOAP provides sufficient
protocol flexibility for the security requirements of today’s business models. Asa first step, we have implemented the following:– The SSL-over-SOAP handshake protocol is a key transport protocol based on
X.509 binary security tokens. It is implemented in the WS-Trust framework.
– The SSL-over-SOAP record layer protects the complete body of SOAP messages, and the Finished messages. It provides confidentiality (XML encryption) and authentication (HMAC from XML signature) within the frameworkof WS-SecureConversation.
1.4

Related Work

Hada and Maruyam [9] propose a session authentication protocol for Web Services. Although they consider the aspect of session resumption, they do notdesign a key establishment scheme. Follow-up work by Zhang and Xu [18] similarly does not regard key establishment. Herzberg [10] introduces the secure
XML transport protocol (SeXTP), which is a ping pong protocol based on XML
Encryption and XML Signature. The work does not fit into the Web Services
terminology, as it dates back from a time when the WS-standards were in pending state. Although the author illustrates that present XML security standards
are capable to negotiate a shared secret, [10] only mentions the Diffie-Hellman
key exchange. In contrast to this, our protocol provides a framework for a wide
variety of different algorithms and authentication mechanisms, and is open to extensions. Fang et al. [8] have implemented the AuthA protocol for Web services.
AuthA is a password-based authenticated key exchange protocol. This protocol
is restricted to the use of passwords. By contrast, SSL-over-SOAP provides protocol flexibility. That is, SSL-over-SOAP captures the requirements of different
security models and allows the use of modular authentication mechanisms, suchas passwords, digital certificates, or Kerberos ticket.
1.5

Organization

The paper is structured as follows. We shortly review the relevant Web Services
technologies in Section 2. Then, we present our proposal by first formulating SSL
in terms of SOAP message exchanges in Section 3, and subsequently describing
3

a concrete instantiation of this framework in Section 4. We discuss the protocol’s
security in Section 5. Finally, we conclude our work in Section 6.

2

WS-* Building Blocks

2.1

Notation

We use the following XML syntax style:– Instead of writing an element <AAA></AAA>, we drop the tag from theclosing bracket and write <AAA></> or <AAA/>.
– When writing an element that spans several lines, we rely on indentation to delimit the body, omitting the closing bracket. For example,<AAA><BBB></BBB></AAA> is written as<AAA><BBB />– We omit the namespace definition in the messages and use the following
prefixes:
Prefix
ds
soap
tls
wsse
wst
wsc
wsu
xenc
2.2

Namespacehttp://www.w3.org/2000/09/xmldsig#
http://schemas.xmlsoap.org/soap/envelope/
http://www.example.org/tls#
http://docs.oasis-open.org/wss/2004/01/
oasis-200401-wss-wssecurity-secext-1.0.xsd
http://schemas.xmlsoap.org/ws/2005/02/trust
http://schemas.xmlsoap.org/ws/2005/02/sc
http://docs.oasis-open.org/wss/2004/01/
oasis-200401-wss-wssecurity-utility-1.0.xsd
http://www.w3.org/2001/04/xmlenc#

SOAP and WS-Security

SOAP is a mechanism for inter-application communication between systems
across the Internet, where system implementations can be written in arbitrary
languages. SOAP messages are in XML to allow the exchange of structured
information.
WS-Security [3] describes how to use XML Signature [17], XML Encryption [16], and security tokens in SOAP messages. (Note that [17] specifies theuse of symmetric-key authentication, not just public-key digital signatures: The
term “signature” or “digital signature” is extended to cover symmetric authentication.) To this purpose, WS-Security defines a <Security> element to be added
to the SOAP header as a container for all security related content. For WSSecurity, it is strongly recommended to identify signed elements via ID attributes(not via XPath expressions). A typical WS-Security message is as follows:4<soap : Envelope><soap : Header><wsse : S e c u r i t y /><soap : Body>

2.3

WS-SecureConversation

WS-SecureConversation (the Web Services Secure Conversation Language) specifies secure communication between services. It defines the message structure forestablishing and sharing security contexts, and for deriving keys from security
contexts. As with WS-Security, WS-SecureConversation is only a building blockand does not provide a complete security solution.
The
core
element
of
WS-SecureConversationisthe<wsc:SecurityContextToken> element. It consists of the mandatory childelement <wsc:Identifier> and several optional elements. The security context
is addressed by a UUID specified in <wsc:Identifier>.
2.4

WS-Trust

WS-Trust enables applications to construct trusted SOAP message exchanges,
which is determined by security tokens. A typical security token request consistsof:<wst : R e q u e s t S e c u r i t y T o k e n Context ? . . . ><wst : TokenType/>?
<wst : RequestType/>...
The optional element <wst:TokenType> describes the requested token type.
The mandatory element <wst:RequestType> specifies the class of function. It allows to add additional elements for the special purpose. The<wst:RequestSecurityTokenResponse> specifies the response to a security token request and is used to retrieve a security token.

3

SSL-over-SOAP Framework

3.1

Design Goals

We lift the SSL framework from the transport layer to the world of Web Services,using the WS-* framework. We use SOAP instead of TCP for handshake messages transfer. WS-Trust and WS-SecureConversation provide the framework to
describe handshake protocol messages, and WS-Security allows us to put security related metadata into the <Security> header element. Our specification of
SSL-over-SOAP complies with the recent version of SSL, namely TLS 1.1 [6].
5For the handshake protocol, we put the handshake messages into payloads of
the SOAP exchange, such that all elements are contained in the body part of the
SOAP message—never in the header. This is important to allow us to duplicate
the renegotiation feature of the original SSL protocol: An SSL handshake canalso be carried out over a connection that is already protected using SSL/TLS(for example, to transfer client certificates in encrypted form). In the case of SSLover-SOAP, this means that we want to be able to apply WS-Security and WSSecureConversation even to those SOAP messages constituting a new handshake.
In such a situation, the cryptographic parameters used in the WS-Security header
stem from the original session, while the parameters of the next session are
negotiated using the handshake protocol.
Additionally, we define how the Finished message is generated. In the
SSL/TLS standards, this is done by computing a pseudorandom function taking
as input the exchanged secret and a concatenation of all message bytes exchanged for the current handshake, and then sending this message over the new
cryptographically secured channel. Such authentication is important to thwart
man-in-the-middle attacks: If an attacker has modified some handshake message
to influence parameter negotiation, then verifying the peer’s Finished messages
will reveal that something is wrong (assuming that only ciphersuites providing
reasonably strong authentication are ever negotiated).
In SSL-over-SOAP, we use the same pseudorandom function for the Finishedmessage. Its inputs are the new master secret and the concatenation of the (serialized canonicalized) bodies of the SOAP messages for the handshake. Putting
parts of the handshake messages into the SOAP header instead of the body mightmake the protocol vulnerable to attacks, or could lead to a much more complex
computation of the Finished message (see Section 5 for more discussions).
3.2

ClientHello (Message 1)

For convenience, we will refer to the initiating service as “client” and to the responding service as “server”, thus adopting SSL terminology. In SSL-over-SOAP,
the initial message is the ClientHello (Fig. 1). Using the framework of WSTrust, we embed the messages into the <wst:KeyExchangeToken> within the<wst:RequestSecurityToken> element. The <wst:RequestKET> indicates thatan additional message from the server is required to complete the key establishment. The <wst:RequestSecurityToken> has an attribute @tls:Id with a UUID
value so that we can reference to this message later.
The <tls:ClientHello> specifies the SSL version of the client(<tls:Version>), the ciphersuites (<tls:CipherSuites>) and compression methods (<tls:CompressionMethods>) as well as the client’s nonce(<wst:Entropy>). The version number 3.2 indicates that TLS version 1.1
is used [6, Section 6.2.1]. While the ciphersuite in SSL is identified by
two bytes, it is identified here by a URI. For example, the ciphersuite
TLS RSA WITH AES 256 CBC SHA-1 is identified by http://www.example.org/tls#tls RSA with AES256 SHA-1.
6

<s o a p : E n v e l o p e><soap:Body>
3<w s t : R e q u e s t S e c u r i t y T o k e n t l s : I d = ’ uuid:UUID−msg1 ’>
4<wst:TokenType> . . . / s c / s c t</>5
<wst:RequestType> . . . / t r u s t /KET</>6<wst:RequestKET />7<wst:KeyExchangeToken>
8< t l s : C l i e n t H e l l o>
9< t l s : V e r s i o n>3 . 2</>10
< t l s : C i p h e r S u i t e s>
11<t l s : C i p h e r S u i t e>. . . # tls RSA with AES256 SHA1</>
12<t l s : C o m p r e s s i o n M e t h o d s>
13
<t l s : C o m p r e s s i o n M e t h o d>. . . # c o m p r e s s i o n n u l l</>14
<w s t : E n t r o p y>
15
<w s t : B i n a r y S e c r e t Type= ’ . . . / Nonce ’>M7o9 . . . MO0o=</>12

Fig. 1. ClientHello message sent from Client to Server in order to initiate the handshake

3.3

ServerHello, Certificate, ServerKeyExchange,
CertificateRequest (Message 2)

The second message is the server’s response to the security token request (Fig. 2).
The response contains mandatory and optional elements. As with SSL, the choiceof elements depends on the ciphersuite selected (<tls:ServerKeyExchange>) andon whether the server requests client authentication (<tls:CertRequest>).
<tls:ServerHello> contains the SSL protocol version of the server(<tls:Version>), the session ID (<tls:SessionID>), the ciphersuite selected by the server (<tls:CipherSuite>), the compression method(<tls:CompressionMethod>), and the server nonce (<wst:Entropy>). The
session ID is adopted from SSL to manage the session and used to execute theabbreviated handshake.
Fig. 2 illustrates an example message where client and server are mutuallyauthenticated on the basis of X.509v3 Certificates. Such certificates are handled
by including a <wsse:BinarySecurityToken> into the <tls: Certificates > element. The type X509PKIPathv1 indicates that this token specifies a certificate
chain.
<tls:ServerKeyExchange> would contain key material for DH key exchange.
In Fig. 2, client and server opt for key transport based on RSA where the server’s
public key is provided by the certificate. Hence, <tls:ServerKeyExchange> is anempty tag, and could be omitted.
The <tls:CertificateRequest> element is used to signal the client that is has
to authenticate using a X.509 security token. The tag contains security policies
which specify the client certificate’s requirements. In Fig. 2, the server requiresclient authentication and opts for a client certificate that is issued for RSA
signatures from the Certificate Authority Test Root CA.
7

The SSL/TLS message ServerHelloDone serves only as a delimiter. We omit
ServerHelloDone in SSL-over-SOAP, since we combine multiple SSL elements
into one <wst:KeyExchangeToken>.

<s o a p : E n v e l o p e><soap:Body>
3<w s t : R e q u e s t S e c u r i t y T o k e n R e s p o n s e t l s : I d = ’ uuid:UUID−msg2 ’>
4<wst:TokenType> . . . / t r u s t /KET</>5<w s t : R e q u e s t e d S e c u r i t y T o k e n>6
<wst:RequestKET />7<wst:KeyExchangeToken>
8< t l s : S e r v e r H e l l o>
9< t l s : V e r s i o n>3 . 2</>10
< t l s : S e s s i o n I D>Vz2e . . . 4WU=</>11<t l s : C i p h e r S u i t e>. . . # tls RSA with AES256 SHA1</>
12<t l s : C o m p r e s s i o n M e t h o d>. . . # c o m p r e s s i o n n u l l</>13
<w s t : E n t r o p y>
14
<w s t : B i n a r y S e c r e t Type= ’ . . . / Nonce ’>ihsK . . . 7 CYA=</>15<t l s : S e r v e r K e y E x c h a n g e>
16
< t l s : C e r t i f i c a t e s>
17
<w s s e : B i n a r y S e c u r i t y T o k e n
18
ValueType= ’ . . . # X509PKIPathv1 ’>MIIC . . . iw==</>
19<t l s : C e r t R e q u e s t>
20<t l s : C e r t t y p e>. . . # r s a s i g n</>21
<t l s : C A s>
22<t l s : C A>CN=Test Root CA</>
1
2

Fig. 2. ClientHello, ServerKeyExchange, Certificate, and CertificateRequest
message sent from Server to Client. Server and Client agree on the ciphersuite“#tls RSA with AES256 SHA1”.

3.4

ClientKeyExchange, Certificate, CertificateVerify, Finished(Message 3)

Here the message structure becomes a little more complicated, since wehave to combine unprotected parts (ClientKeyExchange, Certificate,
CertificateVerify) and protected parts (Finished) into one SOAP message
in order to comply with the SSL protocol specification (Fig. 3).
The <tls:PreMasterSecret> (lines 34–37) within <tls:ClientKeyExchange>(lines 33–37) contains the encrypted premaster secret (recall that client andserver negotiated the RSA ciphersuite). The premaster secret is encrypted withthe server’s public key. Since client authentication has been requested in theprevious message, the client makes use of the <tls: Certificates > element (lines
38–40) to send a certificate chain containing its certificate and the certification authority’s certificates. The <tls: CertificateVerify > (lines 41–50) has only
8

one child element, <ds:Signature> (lines 42–50). For more details, see Section 4. The <ds:Reference> elements in lines 46–47 reference the exchanged
messages (messages 1 and 2) via the @URI with the prefix urn:uuid. The last two<ds:Reference> elements in lines 48–48 reference the <tls:ClientKeyExchange>(lines 33–37) and the <tls: Certificates > (lines 38–40) in the same message.
The <wst:SecurityContextToken> (lines 28–29) specifies that the master secretshould be addressed by the UUID specified, UUID-sct.
After choosing a premaster secret, the client computes the master secret andderives the session keys. In order to confirm the correct generation of session
keys, it computes the content Finished message as follows:client finished = PRFmaster secret “client finished”,

MD5 (exchanged messages) || SHA1 (exchanged messages) [0...11]
In the SSL framework, the exchanged messages are those visible at the handshakelayer and do not include record layer headers. Hence in SSL-over-SOAP, theexchanged messages are the SOAP bodies in messages 1 and 2, and the SOAP
body except the <tls:Finished> in this message. The SOAP bodies are firstcanonicalized with the algorithm Exclusive C14N and then concatenated. The
result is then used as the input of the hash algorithms MD5 and SHA-1.
The client then constructs the Finished message by encoding the result of
the TLS PRF: <tls:Finished>Base64(client finished)</>. The <tls:Finished>is then encrypted and signed in the following way:
The client inserts a <wsse:Security> (lines 3–23) into the SOAP header<soap:Header>. Then, the client adds a <wst:SecurityContextToken> (lines 4–5) to <wsse:Security>. This token has the same properties as the token within
the SOAP body (lines 28–29). However, we may not move this security token
to the body, since only if it is located in the SOAP header, the token canbe used for decryption and signature verification. Then, the client computes
a derived key token <wsc:DerivedKeyToken> that specifies the client write key,
and is used to encrypt the content of <tls:Finished> (lines 51–56).The<wsc:DerivedKeyToken> (lines 17–21) and a new <xenc:ReferenceList> (lines
22–23) that locates the encrypted <tls:Finished> are then added to the<wsse:Security> element. Finally, the client computes a derived key token<wsc:DerivedKeyToken> (lines 6–10) that specifies the client write MAC secretused to sign the encrypted <tls:Finished> with the client MAC secret. The signature is represented by a <ds:Signature> (lines 11–16). Both elements are thenadded to the <wsse:Security>.
Note that in message 3 and in message 4 (see Sect. 3.5), the session ID
is added to the <wst:KeyExchangeToken> so that the receivers (the server inmessage 3 and the client in message 4) can chain the messages.
3.5

Finished (Message 4)

The
server’s<wst:RequestSecurityTokenResponse>contains
the<tls:Finished> message (see Fig. 4). To compute the content of the Finished9<s o a p : E n v e l o p e><s o a p : H e a d e r>
3
<w s s e : S e c u r i t y>4
<w s c : S e c u r i t y C o n t e x t T o k e n w s u : I d= ’ Id−s c t ’>5
< w s c : I d e n t i f i e r>uuid:UUID−s c t</>6
<wsc:DerivedKeyToken w s c : A l g o r i t h m= ’ . . . # TLS PRF ’
7w s u : I d= ’ Id−clientMACKey ’>
8<w s s e : S e c u r i t y T o k e n R e f e r e n c e>
9<w s s e : R e f e r e n c e URI= ’#Id−s c t ’ />10
<w s c : L e n g t h>20</><w s c : O f f s e t>0</>11<d s : S i g n a t u r e>
12<d s : S i g n e d I n f o>
13
<d s : R e f e r e n c e URI= ’#Id−f i n i s h e d ’>
14
<d s : K e y I n f o>
15
<w s s e : S e c u r i t y T o k e n R e f e r e n c e>
16
<w s s e : R e f e r e n c e URI= ’#Id−clientMACKey ’ />17
<wsc:DerivedKeyToken w s c : A l g o r i t h m= ’ . . . # TLS PRF ’
18
w s u : I d= ’ Id−clientWrtKey ’>
19<w s s e : S e c u r i t y T o k e n R e f e r e n c e>
20
<w s s e : R e f e r e n c e URI= ’#Id−s c t ’ />21
<w s c : L e n g t h>32</><w s c : O f f s e t>40</>22<x e n c : R e f e r e n c e L i s t>
23
<x e n c : D a t a R e f e r e n c e URI= ’#Id−E n c F i n i s h e d ’ />24<soap:Body>
25<w s t : R e q u e s t S e c u r i t y T o k e n R e s p o n s e>
26
<wst:TokenType> . . . / t r u s t /KET</>27<w s t : R e q u e s t e d S e c u r i t y T o k e n>28
<w s c : S e c u r i t y C o n t e x t T o k e n>29
< w s c : I d e n t i f i e r>uuid:UUID−s c t</>30
<wst:KeyExchangeToken>
31< t l s : S e s s i o n I D>Vz2e . . . 4WU=</>32<wst:RequestKET />33<t l s : C l i e n t K e y E x c h a n g e Id= ’ Id−cke ’>34<t l s : P r e M a s t e r S e c r e t>
35
<xenc:EncryptedKey>
36<xenc:EncryptionMethod Algorithm= ’ . . . # r s a −1 5 ’ />37
<d s : K e y I n f o /><x e n c : C i p h e r D a t a />38
< t l s : C e r t i f i c a t e s Id= ’ Id−c e r t s ’>
39
<w s s e : B i n a r y S e c u r i t y T o k e n ValueType=40’ . . . # X509PKIPathv1 ’>MIIC . . . y/Z/</>41< t l s : C e r t i f i c a t e V e r i f y>
42
<d s : S i g n a t u r e>
43
<d s : S i g n e d I n f o>
44
<d s : C a n o n i c a l i z a t i o n M e t h o d />45
<d s : S i g n a t u r e M e t h o d Algorithm= ’ . . . # r s a −sha1 ’ />46
<d s : R e f e r e n c e URI= ’ urn:uuid:UUID−msg1 ’ />47
<d s : R e f e r e n c e URI= ’ urn:uuid:UUID−msg2 ’ />48
<d s : R e f e r e n c e URI= ’#Id−cke ’ />49
<d s : R e f e r e n c e URI= ’#Id−c e r t s ’ />50
<d s : S i g n a t u r e V a l u e>RR4p . . . vFvA=</>51< t l s : F i n i s h e d Id= ’ Id−f i n i s h e d ’>52
<x enc: E ncry ptedD ata Id= ’ Id−E n c F i n i s h e d ’>53
<d s : K e y I n f o>
54
<w s s e : S e c u r i t y T o k e n R e f e r e n c e>
55
<w s s e : R e f e r e n c e URI= ’#Id−clientWrtKey ’ />56
<x e n c : C i p h e r D a t a />1
2

Fig. 3. ClientKeyExchange, Certificate, CertificateVerify, and Finished sentfrom Client to Server.

10

message, the server uses the same PRF function as the client except the following
differences: 1) the label is “server finished”; 2) for the exchanged message,
we refer to the SOAP bodies in messages 1, 2 and 3. In the SSL framework,
the headers in the record layer are not considered, hence we first decrypt themessage 3 and use the decrypted SOAP body (namely the <tls:Finished> is
not encrypted).
The message allows the client to verify that the server has received all theprevious messages from the client. As with the previous message, the server’s
Finished has the same SOAP header structure, but differs in the keys used, i.e.
the server uses server write MAC secret for the HMAC and server write key forthe encryption.

<s o a p : E n v e l o p e><s o a p : H e a d e r>( S i m i l a r a s i n Message 3 )</>
3<soap:Body>
4<w s t : R e q u e s t S e c u r i t y T o k e n R e s p o n s e>5
<wst:TokenType> . . . / t r u s t /KET</>6<w s t : R e q u e s t e d S e c u r i t y T o k e n>7
<wst:KeyExchangeToken>
8< t l s : S e s s i o n I D>Vz2e . . . 4WU=</>9< t l s : F i n i s h e d w s u : I d= ’ Id−F i n i s h e d 2 ’>10<x enc: E ncry ptedD ata Id= ’ Id−E n c F i n i s h e d 2 ’ />1
2

Fig. 4. Finished message sent from Server to Client that confirms the negotiatedciphersuite and derived session keys.

4

A Token-based Protocol

We present additional details for a concrete Web Services protocol that instantiates the framework described in the previous section. Specifically, we show aprotocol variant using X.509 certificates as security tokens. The framework cansimilarly be instantiated using other security token types, requiring other protocol variants: for example, password-based authenticated key exchange using ascheme such as “SOKE” [4] would use user name tokens. Recall that during theexecution of the protocol, the services endpoints may decide which authentication token to use.
The X.509v3 binary token authentication protocol is illustrated in Fig. 5. The
protocol’s goal is to negotiate a tuple of session keys between two services W1
and W1 , while the services authenticate on the basis of X.509v3 binary tokens.
Assuming that in a setup stage the tokens have been stored in credential stores.
We denote the certified public pairs of W1 and W2 by (pk1 , sk1 ) and (pk2 , sk2 ),respectively.
11

Web Service W1

Web Service W2(pk1 , sk1 )Choose N1 ← {0, 1}∗(pk2 , sk2 )ClientHello : [N1 , ..]−−−−−−−−−−−−−−−−−−−→
ServerHello : [N2 , sid, ...]
Certificate : [pk2 ]CertificateRequest←−−−−−−−−−−−−−−−−−−−

Choose N2 , sid ← {0, 1}∗∗

Choose kPMK ← {0, 1}

kMSK ← PRFkPMK (0 10 , N1 || N2 )Symmetric keys: {k1ENC , k1MAC , k2ENC , k2MAC } ← PRFkMSK (0 10 , N1 || N2 )Hsig ← Hash(... || ClientKeyExchange || Certificate)
H1 ← (Hash(... || Certificate || ClientVerify)
H2 ← (Hash(... || ClientVerify || Finished)
SIG 1 ← Signsk1 (Hsig )F1 ← PRFkMSK (0 10 , H1 )t1 ← HMACk1MAC (F1 )ClientKeyExchange : [Epk2 (kPMK )]Certificate : [pk1 ]ClientVerify : [SIG 1 ]Finished : [EkENC (F1 , t1 )]−−−−−−−−−−−−1−−−−−−−→
Verify (SIG 1 , pk1 , Hsig )ABORT if ⊥; else
Decrypt Epk2 (kPMK )Decrypt Ek1ENC (F1 , t1 )Verify t1 = HMACk1MAC (F1 )ABORT if false; else
Verify F1 = PRFkMSK (0 10 , H1 )ABORT if false; else
F2 ← PRFkMSK (0 10 , H2 )t2 ← HMACk2MAC (F2 )Finished : [Ek2ENC (F2 , t2 )]←−−−−−−−−−−−−−−−−−−−
session keys ← accept

Decrypt Ek2ENC (F2 , t2 )Verify t2 = HMACk2MAC (F2 )ABORT if false; else
Verify F2 = PRFkMSK (0 10 , H2 )ABORT if false; else
session keys ← accept

Fig. 5. Key establishment protocol based on X.509v3 tokens

12W1 initiates the handshake. It randomly chooses a client nonce N1 and forwards this parameter to W2 . Then, W1 chooses a nonce N2 and appends to thenonce its certified public key pk2 . Upon receiving the message, W1 randomly
chooses a premaster secret kPMK and encrypts the premaster secret with the public key pk2 from W2 . The premaster secret kPMK is used to derive the mastersecret kMSK , using the pseudo-random function PRF parameterized by the services’ nonces and the labeling string “master secret”, abbreviated with “1” inthe protocol description. This is the pseudorandom function as specified by SSL.
(Other PRF constructions could be used.)
W1 applies the master secret kMSK to compute the tuple of session keys
{k1ENC , k1MAC , k2ENC , k2MAC }. Here kiENC and kiMAC are encryption and authentication keys,
respectively. W1 feeds the pseudorandom function PRF with the labeling string“key expansion” and the concatenation of the services’ nonces N1 and N2 . In
addition, W1 proves its identity by signing the digest of previously negotiatedmessages SIG 1 using its certified private key sk1 . Finally, W1 confirms the session key generation, using the pseudorandom function PRF that takes as input
the master secret kMSK , the string “client finish” and the hash value H1 of all
previous messages. It then authenticates and encrypts the output F1 with thesession keys {k1ENC , k1MAC }.
Upon receiving the message, W1 decrypts the premaster secret and verifies
SIG1 , using the client’s certified public key pk1 . It ensures that it is connected toW1 , i.e. it checks that W1 is a valid endpoint. Otherwise W2 aborts the session.
In the positive case, W2 derives in analogy to W1 the same master secret kMSK
and the same tuple of session keys {k1ENC , k1MAC , k2ENC , k2MAC }. Then, W2 decrypts
Ek1ENC (F1 , t1 ) and verifies that tag t1 := HMACk1MAC (F1 ), where F1 is the hash overall previous messages. If this verification fails, W2 aborts the protocol. Otherwise,
W2 confirms the negotiated session keys using the pseudorandom function PRF
that takes as input the master key kMSK , the labeling string “server finish”, andthe hash value over all previous messages H2 . It then authenticates and encrypts
the output F2 with the session keys {k2ENC , k2MAC }.
Finally, when W1 receives the message Ek2ENC (F2 , t2 ), it decrypts the message
and verifies that tag t2 := HMACk2MAC (F2 ), where F2 is the hash value of all previously received messages. If the verification fails, W1 aborts the session. Otherwise, W1 and W2 start to use the negotiated keys {k1ENC , k1MAC , k2ENC , k2MAC } forsymmetric cryptography.

5

Security Discussion

Although our SSL-over-SOAP protocol on the outside looks very different fromstandard transport-layer SSL/TLS, the handshake quite closely follows the original protocol. We have replaced the SSL/TLS data formats using an XML-based
approach, but without changing the cryptographic essence. Thus, previous analyses of the SSL/TLS handshake as appearing in [13–15] apply similarly: the longexperience with SSL/TLS provides evidence that our proposal is cryptographically sound as well.
13

To get a feel for the cryptographic approach in these protocols (both theoriginal SSL/TLS and our SSL-over-SOAP), observe that most of the handshake negotiation is not cryptographically authenticated immediately. Besides
signatures in certificates, authentication appears only in the form of digital signatures if either a ServerKeyExchange message is used (the server signs its key
share along with the client and server random nonces, thus binding the key shareto the current handshake), or if a CertificateVerify message is used (in which
the client presents a signature on the handshake so far to authenticate itself tothe server).
Many typical scenarios involve neither message. An attacker can manipulate the handshake protocol messages being exchanged to influence the handshake outcome: For example, if the client offers multiple ciphersuites in the
ClientHello message, an attacker could remove the client’s preferred ciphersuites from the list, leaving the server with fewer ciphersuites to choose from—such as just those ciphersuites that are the easiest to break. This changes only inthe moment when the Finished messages are exchanged. These messages cover
the complete handshake as well as the resulting master secret, thus retroactively
authenticating everything in the current handshake, provided that the mastersecret could only be known to the legitimate protocol participants. (For example, in an RSA-based handshake, the client encrypts the premaster secret for theserver’s certified public key, thus ensuring that the premaster secret and thus themaster secret remains secret from any attacker.) Accordingly, it is a fundamental
security requirement the any party engaging in a handshake only be willing tonegotiate ciphersuites that can be assumed to provide security in this sense. Any
further security properties, notably those of application data encryption, rely on
this.
The Finished message is the first piece of data to be encrypted and authenticated under the newly negotiated keys and algorithms, thus also providing averification that negotiation succeeded as intended and that both parties now
are indeed using compatible cryptography. Once the Finished messages havebeen verified, application data is encrypted and authenticated the same way.
In the standard SSL/TLS protocol, symmetric authentication is added to theplaintext before encryption.
This is done differently in our SSL-over-SOAP setting (see Fig. 3), wheresymmetric authentication (following the XML Digital Signatures specification)
is applied to the ciphertext. This change is not cryptographically trivial, butdoes not harm the protocol. The combination of symmetric authentication withencryption can be considered authenticated encryption [5]. As discussed in [5],for general composition of an encryption scheme with a MAC, the “encryptthen-MAC” approach does the best job of providing authenticated encryption.
(“MAC-then-encrypt” as used in standard SSL/TLS in general has some problems, although these do not apply to the standard ciphersuites [11].) That is,while SSL-over-SOAP differs from standard SSL/TLS in its use of symmetric
cryptography, the approach used in SSL-over-SOAP is in fact cryptographicallysound.
14

6

Conclusion and Outlook

The SSL-over-SOAP approach provides a practical framework for key establishment for Web Services. We use the experience with the practically proven
SSL/TLS protocol family for this purpose. This allows us to transfer SSL/TLS
protocol ideas to reuse them for Web Services, while giving us much more flexibility and security than direct use of SSL/TLS at the transport layer. Our
prototype implementation has shown the feasibility of implementing complex
cryptographic protocols within the WS-* framework.
In this paper, we only looked at one basic form of an SSL handshake as an
example—an RSA-based handshake (involving an encrypted premaster secret).
The SSL-over-SOAP approach applies to many more protocol variants. For example, we can directly transfer the work that has been done in [4] for passwordbased authenticated key exchange in TLS, where parties rely on low-entropy
secrets instead of certificates for authentication. So besides X.509v3 binary token authentication as described in Section 4, we can also specify password token
authentication using the “SOKE” scheme from [4]. We plan to complete an open
source software library for SSL-over-SOAP, which will offer ciphersuites for bothfor X.509v3 binary token authentication and for password token authentication.
Our experiences with SSL-over-SOAP should be considered as a starting
point for the definition of other key agreement protocols, e.g., the IPsec OAKLEY protocol, or group key agreement protocols. However, security analysesof such protocols can not be directly transferred to the web services world,e.g. considering XML wrapping attacks. Necessary conditions for key agreement
protocols to be secure in an XML context (e.g. explicit key confirmation) haveto be researched.

References
1. Security in a Web Services World: A Proposed Architecture and Roadmap,
April 7, 2002. http://www.ibm.com/developerworks/library/specification/
ws-secmap/.
2. WebServices
SecureConversation
LanguageSpecification(WSSecureConversation), February 1, 2005.
ftp://www6.software.ibm.com/
software/developer/library/ws-secureconversation.pdf.
3. Web Services Security: SOAP Message Security 1.1 (WS-Security 2004) Working
Draft, November 7, 2005. http://www.oasis-open.org/committees/download.
php/15251/oasis-wss-soap-message-security-1.1.pdf.
4. M. Abdalla, E. Bresson, O. Chevassut, B. Möller, and D. Pointcheval. Provably
secure password-based authentication in TLS. In S. Shieh and S. Jajodia, editors,
Proceedings of the 2006 ACM Symposium on Information, Computer and Communications Security (ASIACCS’06), pages 35–45, 2006.
5. M. Bellare and C. Namprempre. Authenticated encryption: Relations among notions and analysis of the generic composition paradigm. In T. Okamoto, editor,
Advances in Cryptology – ASIACRYPT 2000, volume 1976, pages 531–545, 2000.
6. T. Dierks and E. Rescorla. The Transport Layer Security (TLS) protocol, version
1.1. RFC 4346. http://www.ietf.org/rfc/rfc4346.txt, 2006.

15

7. W. Diffie, P. C. van Oorschot, and M. J. Wiener. Authentication and Authenticated
Key Exchanges. Designs, Codes and Cryptography, 2(2):107–125, 1992.
8. L. Fang, S. Meder, O. Chevassut, and F. Siebenlist. Secure password-based authenticated key exchange for web services. In SWS ’04: Proceedings of the 2004
workshop on Secure web service, pages 9–15, New York, NY, USA, 2004. ACM
Press.
9. S. Hada and H. Maruyama. Session authentication protocol for web services. In
SAINT-W ’02: Proceedings of the 2002 Symposium on Applications and the Internet (SAINT) Workshops, page 158, Washington, DC, USA, 2002. IEEE Computer
Society.
10. A. Herzberg.
Secure XML transport protocol.
Lecture Notes, Chapter
14, 2000. http://www.cs.biu.ac.il/~herzbea/Chapters/Chapter%2014%20XML%
20Security.pdf.
11. H. Krawczyk. The order of encryption and authentication for protecting communications (or: How secure is SSL?). In J. Kilian, editor, Advances in Cryptology –CRYPTO 2001, volume 2139, pages 310–331, 2000.
12. M. McIntosh and P. Austel. Xml signature element wrapping attacks and countermeasures. In ACM Workshop on Secure Web Services, 2005.
13. J. C. Mitchell, V. Shmatikov, and U. Stern. Finite-state analysis of SSL 3.0. In
7th USENIX Security Symposium, 1998.
14. L. C. Paulson. Inductive analysis of the internet protocol TLS. ACM Transactions
on Computer and System Security, (3):332–351, 1999.
15. B. Schneier and D. Wagner. Analysis of the SSL 3.0 protocol. In Proceedings ofthe 2nd USENIX Workshop on Electronic Commerce, 1996.
16. W3C Consortium. XML-encryption syntax and processing, 2002. http://www.w3.
org/TR/xmlenc-core.
17. W3C Consortium. XML-signature syntax and processing, 2002. http://www.w3.
org/TR/xmldsig-core.
18. D. Zhang and J. Xu. Multi-party authentication for web services: Protocols,
implementation and evaluation. In Seventh IEEE International Symposium on
Object-Oriented Real-Time Distributed Computing (ISORC’04), pages 227–234,
Los Alamitos, CA, USA, 2004. IEEE Computer Society.

16