gateways performance. We think that this attack is
an even stronger and convincing argument than those
already published to support the banishment of the
“encryption-only” configuration of ESP.
Recall that the ESP configuration is not integrity
protected, thus the option provided in the ESP for re-
play protection makes no sense since it requires ob-
viously data integrity. We stress that our attack is
not just a reply attack since the attacker can devi-
ate/multiply the flow to different targets. We also
assume, as in (C. McCubbin, 2000; K. Paterson,
2005), that the datagrams are not checked after IPSec
processing to see if the correct IPSec policies were
applied; this is the case in the Linux kernel imple-
mentation (as pointed out in (K. Paterson, 2005)).
Although it is commonly known that encryp-
tion without authenticated integrity is dangerous and
more specifically that ESP without data authentica-
tion leads to all kind of problems there are still secu-
rity IPSec specialists that claim “when IPSec gateway
is protected in addition with a stateful firewall which
does filter the packets, most of the described above at-
tacks will not work.” We think that such an approach
is just an attempt to shift the problem, instead of erad-
icate it.
The rest of this paper is organized as follows: Af-
ter an introduction to the IPSec ESP in Sect. 2, we
present the DoS attack itself in Sect. 3.
2 PRELIMINARIES
2.1 Ipsec
IPSec provides security at the level of the IP layer.
The secure encapsulation of the payload of IP data-
grams is part of the IPSec standard and is provided by
ESP (Encapsulating Security Payload, (Kent, 2005)).
ESP provides integrity, authentication and encryption
of the IP datagrams (as an option, it is possible to add
a replay protection).
The encapsulation is connectionless, i.e. it is per-
formed on a per-datagram basis. One common use of
IPSec is to build virtual private networks where IPSec
is configured to use ESP in tunnel mode. The way
ESP modifies the datagrams in tunnel mode is shown
in the Appendix Fig. 4.
Fig. 4 shows that given a datagram to protect, ESP
creates a new datagram made of, in sequence, a new
IP header, an ESP header, the original datagram (IP
header and Inner Payload), an ESP trailer and an ESP
authentication payload. The detailed description of
the ESP header, trailer and authentication payload is
not provided since they are outside of the scope of our
attack.
IPSec supports different encryption algorithms:
AES (J. Daemen, 2002; NIST, 2002) is the most com-
monly used but other block ciphers as DES (NIST,
1977), 3DES (NIST, 1999), CAST128 (Adams,
1997b; Adams, 1997a), RC5 (Rivest, 1994), IDEA
(X. Lai, 1990), and Blowfish (Schneier, 1993) are also
allowed. All block ciphers are used in CBC mode
(R. Pereira, 1998; S. Frankel, 2003). Additionally,
AES in CTR mode is a valid alternative (Housley,
2004) but in this case the standard states that “AES-
CTR implementations MUST employ a non-NULL
ESP authentication method, since it is trivial to forge
an AES-CTR ciphertext”. As a consequence, the here-
after described attack targets only the block ciphers in
CBC mode. The attack depends only on the block size
n of the cipher, where n =64for all block ciphers ex-
cept for AES where n = 128, 192, 256.
2.2 Cbc Mode
If the to be transmitted data after ESP padding is made
of q blocks, if the plaintext blocks are denoted by
P
1
,P
2
,...,P
q
, and if e
K
(·) (d
K
(·)) denotes the en-
cryption (decryption) of blocks using an n-bit key K
then the CBC mode (NIST, 1980) works as follows.
After a random n-bit IV (Initialization Vector) is gen-
erated, the ciphertext blocks are computed according
to the equations:
C
0
= IV, C
i
= e
K
(C
i−1
⊕ P
i
), (1 ≤ i ≤ q).
At the receiver side the plaintext is recovered accord-
ing to the equations:
P
i
= C
i−1
⊕ d
K
(C
i
), (1 ≤ i ≤ q).
As pointed out in (A. Menezes, 1996; K. Paterson,
2005) a well known weakness of the CBC mode is
the “bit flipping attack”. An attacker can flip (invert)
a specific bit in the ciphertext block C
i−1
, then this
specific bit in the recovered plaintext block P
i
is also
flipped (since P
i
= C
i−1
⊕ d
K
(C
i
)). This allows
an attacker to introduce controlled changes into the
recovered plaintext block P
i
, but the previous block
P
i−1
is randomized. Hence the integrity of the IV
in CBC should be protected otherwise uncontrolled
change on the first recovered plaintext block P
1
is
possible.
2.3 Ip, TCP, Udp and RTP
Datagrams
The hereafter presented attack depends on the way the
IP stack is structured. The presentation is limited to
IPv4 headers as specified in (Tanenbaum, 2002).
The layout of the IP header is illustrated in the Ap-
pendix Fig. 5. The potential targets of the attack are
the source and the destination IP addresses (32 bits
A DOS ATTACK AGAINST THE INTEGRITY-LESS ESP (IPSEC)
193