insertion and evasion

term

security

Kept in this browser · My desk

The two ways a passive inspection device can disagree with the host it protects about what was sent: insertion, when the device accepts a packet the host rejects, and evasion, when the host accepts a packet the device rejects. Named by Thomas Ptacek and Timothy Newsham in 1998.

Every deep inspection engine, whether an intrusion detection system or an NGFW, has to rebuild the byte stream from packets before it can match anything, and it has to guess which packets the receiver will keep. Wherever its guess differs from the receiver's behaviour, the device and the host see different data, and a signature can be defeated without touching the attack itself. The lasting lesson is in engine design: reassemble the way the protected host does, or normalize traffic in-line so that both see the same bytes.

The paper. In January 1998 Thomas H. Ptacek and Timothy N. Newsham of Secure Networks, Inc. published "Insertion, Evasion, and Denial of Service: Eluding Network Intrusion Detection". They argued that passive protocol analysis, the way network intrusion detection systems (IDS) collected data, was "fundamentally flawed", first because "there isn't enough information on the wire" to know what is actually happening on the networked machines. An IDS sees packets and must decide which ones the end system will accept; it cannot know, for example, whether a packet's time to live will expire before reaching the host, whether the host will discard a segment with a bad checksum or a stale sequence number, or how the host will resolve overlapping fragments.

The two failures. If the IDS is less strict than the host, it accepts packets the host rejects, and its copy of the stream contains bytes the host never received: an insertion. The paper's example is a request for a vulnerable web script called phf, sent as one-character packets with an extra character that only the IDS accepts, so that the IDS reconstructs something other than phf and the signature does not match while the server receives phf. If the IDS is stricter than the host, the host accepts packets the IDS discarded and receives bytes the IDS never inspected: an evasion. Making the device stricter therefore does not fix the problem; it trades insertions for evasions. The authors tested four of the most popular network IDS products of the time and found every one vulnerable; their conclusion was that "Every IDS we examined could be completely eluded by a savvy attacker."

Normalization. The first systematic answer came in 2001. At the 10th USENIX Security Symposium in Washington, D.C., Mark Handley and Vern Paxson of the AT&T Center for Internet Research at the International Computer Science Institute, with Christian Kreibich of the Technische Universität München, proposed a traffic normalizer: a forwarding element placed in the path of traffic into a site that "patches up the packet stream to eliminate potential ambiguities before the traffic is seen by the monitor". They noted that of the four commercial systems Ptacek and Newsham had tested, none correctly reassembled fragments, worked through the ambiguities of each protocol header field by field, and measured the cost and the limits: their user-level implementation, norm, normalized a TCP stream at 100,000 packets per second in memory-to-memory copies, but a normalizer must hold state, so it can be attacked by state exhaustion, and it faces a "cold start" problem with connections already open when it restarts. Normalizing also bends end-to-end semantics, the trade-off the paper examined most closely.

Active mapping. In 2003 Umesh Shankar of the University of California, Berkeley and Vern Paxson proposed the opposite approach at the Institute of Electrical and Electronics Engineers (IEEE) Symposium on Security and Privacy: leave the traffic alone and teach the detector how each protected host behaves. Active Mapping builds profiles of the network topology and of each host's TCP/IP policies, such as which copy of an overlapping fragment it keeps, so that the intrusion detection system can interpret traffic per host. Their tests on about 6,700 hosts found "wide variation" across operating systems' stack policies, the reason a single reassembly rule cannot be right for every target.

What changed. The fragment and reassembly ambiguities the paper exploited were already known to filter designers, RFC 1858 (October 1995) having described how TCP header fields could be pushed into a second fragment, and RFC 3234 (2002) notes that many stateful firewalls reassemble fragments for this reason. Inspection engines responded with stream reassembly that models the receiving host and with in-line normalization, and the rule languages expose the result: a Snort rule can require that it match only on reassembled streams (only_stream) or only on defragmented packets (only_frag). National Institute of Standards and Technology (NIST)'s intrusion detection guide (SP 800-94, 2007) still lists "threats disguised by the use of evasion techniques" among what signature-based detection largely misses.

Removing ambiguity at the source. Protocol designers also closed some of the gaps. RFC 5722 (December 2009) updated IPv6 to forbid overlapping fragments altogether: when a node reassembling a datagram finds that any fragments overlap, the datagram, including fragments not yet received, "MUST be silently discarded". The lesson generalizes: every rule a protocol leaves to the receiver's choice is a place where a monitor and a host can disagree. What changed most since 1998, though, is encryption: a passive monitor that cannot read the payload faces no insertion or evasion problem at that layer only because it can see nothing there, which is why inspection moved into TLS-terminating devices and onto the hosts themselves. Neighbours in this glossary: IDS, intrusion prevention system (IPS), deep packet inspection (DPI), traffic normalization, fragmentation, time to live (TTL), packet filter and stateful inspection.

Also known as: ids evasion, insertion attack, evasion attack, ptacek and newsham, inserção e evasão

Sources

← Back to I Back to the glossary