Dev.to Security 🔐 Cybersecurity 👁 0 📖 2 min read

The Trust Flaw: Address Resolution Protocol (ARP) and Cache Poisoning

The Trust Flaw: Address Resolution Protocol (ARP) and Cache Poisoning When an application transmits data over a Local Area Network (LAN), routing operates using 32-bit IP Addresses (Layer 3). However, Ethernet network

The Trust Flaw: Address Resolution Protocol (ARP) and Cache Poisoning

When an application transmits data over a Local Area Network (LAN), routing operates using 32-bit IP Addresses (Layer 3).

However, Ethernet network interface cards (NICs) and switches possess zero awareness of IP addresses. They transmit physical frames using 48-bit MAC Addresses (Layer 2).

The protocol responsible for bridging this gap is the Address Resolution Protocol (ARP).

1. How ARP Works: Broadcast and Unicast

When Host A (192.168.1.10) needs to transmit a packet to Host B (192.168.1.20):

  1. ARP Cache Lookup: Host A inspects its local kernel ARP table (arp -a). If the mapping exists, it encapsulates the packet immediately.
  2. ARP Request (Broadcast): If unmapped, Host A broadcasts an ARP Request frame to Ethernet address FF:FF:FF:FF:FF:FF: > "Who has 192.168.1.20? Tell 192.168.1.10 at MAC AA:AA:AA:AA:AA:AA."
  3. ARP Reply (Unicast): Every host on the switch receives the broadcast, but only Host B matches the requested IP. Host B unicasts a reply: > "192.168.1.20 is at BB:BB:BB:BB:BB:BB."
  4. Caching: Host A writes the mapping into its kernel ARP cache with an expiration timer.

2. The Architectural Flaw: Stateless Trust

Designed in 1982 (RFC 826), ARP contains zero cryptographic authentication.

Crucially, ARP is stateless:

  • An operating system will accept and overwrite an existing entry in its ARP cache upon receiving an ARP Reply, even if the host never transmitted an ARP Request!

3. ARP Cache Poisoning (Spoofing)

In an ARP Spoofing attack, an attacker on the same local subnet emits forged, unsolicited ARP replies (Gratuitous ARPs):

  1. To the Victim: "192.168.1.1 (Default Gateway) is at Attacker_MAC."
  2. To the Gateway: "192.168.1.10 (Victim) is at Attacker_MAC."

Both devices update their internal ARP tables without verification:

  • All outbound traffic from the victim to the Internet is routed to the attacker.
  • The attacker forwards the traffic to the real gateway, silently capturing unencrypted credentials and session tokens (Man-in-the-Middle Attack).

Defense Mechanisms:

  • Dynamic ARP Inspection (DAI): Enterprise switches validate ARP packets against a trusted DHCP snooping database.
  • Static ARP Entries: Manually binding critical gateway IPs to physical MAC addresses.

Explore full network protocol architectures at Binary Dose.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.