OSI Model, Attacked Layer by Layer

Every layer of the network stack has its own attacks and its own defences. Here are all seven, from the cable to the browser, plus where today’s protocols really sit and which VPNs are still worth running.

7layers, each with its own attacks
27common attacks mapped below
4layers the internet actually runs on (TCP/IP)
1VPN protocol to retire today: PPTP

The OSI model is a teaching model: the internet itself runs on the four-layer TCP/IP stack, and protocols such as TLS and ARP sit awkwardly between OSI layers. It survives because it is the best map we have for one question: at which layer does this attack work, and therefore at which layer must the defence sit? A web application firewall cannot stop ARP poisoning, and port security cannot stop SQL injection. Defence in depth means having a control at every layer, because attackers will look for the one you skipped.

1 · Seven Layers, Attacked

Top to bottom, the way a request leaves a browser.

LayerCommon attacksDefences
7 · ApplicationPhishing, malware delivery, SQL injection, cross-site scripting (XSS)Web application firewall, input validation, MFA, secure coding to OWASP guidance
6 · PresentationSSL stripping, weak or downgraded encryption, man-in-the-middle where encryption is optionalTLS 1.2/1.3 only, strong cipher suites, HSTS, proper key and certificate management
5 · SessionSession hijacking, session fixation, cookie theft, replaySession timeouts, new session ID at login, cookies with Secure, HttpOnly and SameSite, signed short-lived tokens
4 · TransportSYN flood, port scanning, TCP reset injection, UDP amplificationFirewalls, IDS/IPS, SYN cookies, rate limiting, closing unused ports
3 · NetworkIP spoofing, volumetric DDoS, routing (BGP) hijacks, network-level man-in-the-middleNetwork segmentation, ACLs, anti-spoofing filters, RPKI route validation, IPsec, zero-trust network policies
2 · Data linkMAC spoofing, ARP poisoning, VLAN hopping, MAC (switch) floodingPort security, dynamic ARP inspection, DHCP snooping, 802.1X port authentication, disabling auto-trunking
1 · PhysicalWiretapping, hardware keyloggers, signal jamming, physical tamperingLocked server rooms, access control, CCTV, shielded or fibre cabling, tamper-evident seals

▸ Two notes the usual charts get wrong. Certificate pinning is no longer recommended for websites (browsers dropped HPKP) — it survives mainly in mobile apps. And TLS 1.0 and 1.1 are formally deprecated (RFC 8996, 2021); anything still offering them fails a modern audit.

2 · Where Today’s Protocols Actually Sit

The protocols that keep the internet running, placed on the stack, with the one security fact worth knowing about each.

ProtocolLayerWhat it doesSecurity note
HTTP/37Web traffic over QUICEncryption is mandatory — there is no plaintext HTTP/3
DNS / DoH7Names to addresses; DoH carries DNS inside HTTPSPlain DNS is spoofable and visible; DoH hides lookups from attackers — and from your own monitoring
SMTP7Moves email between serversSender spoofing is stopped by SPF, DKIM and DMARC, not by SMTP itself
SSH7Secure remote access and tunnellingKey-based login only; tunnels can bypass firewalls — see Authentication Protocols
gRPC / WebSocket / MQTT7Service calls, two-way app messaging, IoT publish/subscribeLong-lived connections need authentication on connect and authorisation per message
DHCP7Hands out network configurationA rogue DHCP server redirects traffic — DHCP snooping blocks it
TLS5–6Encrypts and authenticates a connectionUse 1.3 where possible; it removed the legacy ciphers attackers relied on
TCP / UDP4Reliable streams / fire-and-forget datagramsTCP is SYN-floodable; UDP is spoofable and used for amplification
QUIC4Encrypted, multiplexed transport over UDPTLS 1.3 is built in; older middleboxes cannot inspect it
IPv4 / IPv6, ICMP, NAT3Addressing, error reporting, address translationIPv6 is often enabled but unmonitored — a blind spot
BGP / OSPF3Routing between and within networksBGP trusts announcements by default; RPKI is the fix for hijacks
ARP2–3Maps IPv4 addresses to MAC addressesNo authentication at all — hence ARP poisoning
Ethernet, Wi-Fi, VLAN, PPP2Frames on wired, wireless and point-to-point linksUse WPA3 on Wi-Fi; VLANs separate traffic but are not a security boundary on their own

3 · VPN Types: Which Still Deserve to Run

A VPN is a tunnel built at a particular layer. The layer decides what it protects, how it gets through firewalls, and how it fails.

VPNLayerTypical useVerdict
IPsec (IKEv2)3Site-to-site tunnels between firewalls; also remote accessUse. The standard for site-to-site; needs UDP 500/4500 open
SSL/TLS VPN4–7Remote-access clients and browser portals (e.g. OpenVPN and vendor clients)Use, and patch fast. Runs over 443, so it passes most firewalls; internet-facing VPN appliances are a top target for exploits
WireGuard3Modern remote access and site linksUse. Small code base, modern fixed cryptography, fast
L2TP/IPsec2 over 3Legacy remote accessPhase out. L2TP adds no encryption itself; it relies on IPsec and adds overhead
PPTP2Very old Windows remote accessRetire. Its MS-CHAPv2 authentication is broken; treat a PPTP tunnel as unencrypted

▸ A VPN puts a user on the network, which is exactly what zero trust tries to avoid. For remote access to applications, zero-trust network access (ZTNA) grants one app at a time, after checking identity and device. Keep VPNs for site-to-site links and the cases ZTNA cannot cover.

Bottom line

  • Defend where the attack lives — a layer-7 control cannot stop a layer-2 attack, and vice versa.
  • Layer 2 is the forgotten one — ARP has no authentication; turn on DAI, DHCP snooping and 802.1X.
  • Encrypt by default — TLS 1.3, HSTS, no TLS 1.0/1.1; HTTP/3 and QUIC make it mandatory anyway.
  • Encryption cuts both ways — DoH and QUIC also blind your own monitoring; plan visibility at the endpoint.
  • Retire PPTP, patch SSL VPNs, prefer ZTNA for user access.

Sources & method. Layer definitions from ISO/IEC 7498-1 (the OSI reference model); protocol facts from the relevant IETF RFCs (QUIC RFC 9000, HTTP/3 RFC 9114, TLS 1.3 RFC 8446, deprecation of TLS 1.0/1.1 RFC 8996, DoH RFC 8484, WireGuard design paper). Placing a protocol on a single OSI layer is a simplification, and the layer column says so where it spans two. Original analysis; no third-party graphics or text reproduced.

← Back to Cyber security