It less about security because we don’t know much about HTTP/2.
I have not played any of them.
HTTP/0.9 was not official version, only documented.
Gopher came along the same time. Used to present information in catalogs (mostly recipes)
First draft in 1989.
Used for Human-Machine interaction as well as machine-to-machine interaction.
Not everything we call web uses HTTP. Like DBs, Peripheral devices, Network management etc.
Which protocol at Transport Later? Extremely simple.
Which header is used to declare media type?
CONNECT is generally used by TLS to connect through proxies.
HTTP stands for? TextFraming
DEMO1: Wireshark HTTP1
Response is only 43 bytes.
Request length is 1096 bytes
Half of that is cookies only.
DEMO2 : FF timing tool.
5 Mbps seems optimal.
Latency is more in mobile networks.
Spriting: Download large image, cut into pieces. E.g. national flags. Inlining: critical CSS/JS in HTML Concatenation: Append multiple CSS and JS into one file Sharding: Using multiple host names to parallelize TCP connections
Opportunistic encryption: There is no was to indicate if Alt-svc endpoint is unencrypted.
Un-authenticated data in server push.
Same connection to Sub-Domains also. Request may be directed to wrong server by default.
Same header may encoded with different values based on order/context.
QUIC is developed by Google.
Connection Migration: uses 64bit id. Can use same ID over multiple interfaces.
Http2 Security Perspective
A Security Perspective
Who am I?
• Not a pen-tester <Not-yet/>
• Threat Analysis Engineer
• With NULL since 2009.
• PC Gamer
•ISO-OSI Layer ?
•Official versions till dates?
•How old is HTTP?
•For most of us:
HTTP WWW Internet.
• Started by Sir Tim Berners-Lee in 1989.
• Originally designed for transferring HyperText
• The intention was to create links between pages;
• Never an official version.
• No RFC.
• Specification is only a couple of pages.
• Clients requests an HyperText document, Server delivers.
• Client creates connection.
• Client sends GET request.
• Server sends HTML document.
• Server terminates connection marking end of message.
• Requests are idempotent.
• RFC 1945 - May 1996.
• HTTP became a true messaging protocol.
• Defined request and response headers.
• Added methods:
• Added support for other media formats (MIME
• Basic Authentication.
RFC 2068 in 1997 (obsoleted by RFC 2616 in 1999)
• Added more methods
• More status codes
• Reusable connection.
• Virtual Hosts.
• Bandwidth Management.
• Response streaming.
Why new HTTP?
• Inadequate use of TCP
• Not enough data in
• One transaction per round-trip.
• Head of line blocking
• Some requests may take longer
• Pipelining issues
• Few connections per host.
• Bloated HTTP headers
• Extremely large cookies
• Headers are not compressed.
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0)
Accept-Encoding: gzip, deflate, br
Solving the Latency problem
• Partial images.
• data URI.
• One big file.
• Multiple Virtual Hosts
• More data transferred
than actually required.
• Development mess.
• Browsers need to wait
• Server administration
HTTP/2 - Overview
• RFC 7540 published on 15th May 2015.
• RFC7541 defines HPACK.
• Based on SPDY/3.x by Google.
• Retains HTTP/1.x semantics.
• Retains http:// and https:// URL formats.
• Still using TCP.
• No more minor versions.
• Next is HTTP/3
• Reduces optional parts of HTTP.
HTTP/2 - Features
• Binary framing.
• Stream multiplexing.
• Priorities and Dependencies.
• Header compression.
• Server push.
• Flow control.
• Protocol upgrade.
HTTP/2 – Binary framing
• Total frame header (9 bytes)
• Length (3 bytes)
• 3 bytes (24 bits) unsigned int value
• Can be changed by sending SETTING_MAX_FRAME_SIZE
• Does not include header length.
• Type (1 byte)
• Frame type
• Flags (1 byte)
• Specific to frame type.
• Stream ID (4 bytes)
• Reserved (1 bit)
• ID (31 bits)
• Payload (<length> bytes)
HTTP/2 – Stream Multiplexing
• One packet may contain many STREAM (Multiplexed)
• STREAM can be split over multiple packets/frames
• CONTINUE frame
• STREAM has multiple frames
• HEADERS Frame
• DATA Frame
• Frame Types:
HTTP/2 – Priorities & Dependencies
• Response may not be served in order of requests.
• Creates a dependency tree and assign weight.
• Prioritize streams based on weight.
HTTP/2 – Header Compression
• HPACK (RFC 7541)
• Uses 2 tables to map headers to
indexes and preserve ordering
• Static Table
• Used to index fixed list of standard
• Dynamic Table
• Used to index custom/non-standard
• Strings and Integer values are
represented differently to save
• Can use Huffman coding for
encoding actual values.
Byte Decoding Value
82 == Indexed - Add ==
idx = 2
86 == Indexed - Add ==
idx = 6
84 == Indexed - Add ==
idx = 4
41 == Literal indexed ==
(idx = 1)
0f Literal value (len = 15) 15
7777 772e 6578 616d 706c 652e 636f 6d www.example.com
8286 8441 0f77 7777 2e65 7861 6d70 6c65
HTTP/2 – Server Push
• Server sends data even before client requests.
• Client holds extra data in cache.
• Server sends a PUSH_PROMISE frame identifying pushed stream
• HEADERS frame of pushed stream is not like usual response
• Contains :path of pushed stream DATA.
• Client can reject pushed data.
HTTP/2 – Protocol Upgrade
• NPN (Next Protocol Negotiation)
• Designed for SPDY.
• Server’s offer, Client’s choice.
• Over TLS only.
• ALPN (Application Layer Protocol
• HTTP/2 official.
• Client’s offer, Server’s choice.
• Part of TLS handshake.
• Upgrade header (Upgrade: h2c)
• To be used on un-encrypted HTTP.
• Requires 1 extra roundtrip.
HTTP/2 - Security
• Promoted TLS
• Minimum TLS version 1.2.
• Blacklisted Cipher-Suites.
• Minimum key-size requirement.
• No TLS renegotiation.
• Cross-protocol attacks
• Not much in plain text.
• Intermediary Encapsulation Attacks
• Invalid header name/values should result in invalid request.
• Context aware compressi0n.
• Frame Padding
HTTP/2 – Security/2
• Huge rework for WAFs
• HTTP/2 is binary.
• Can use a proxy to translate to HTTP/1.1 traffic.
• Opportunistic encryption
• Alt-Svc header.
• Connection Reuse
• Action correlation.
• Caching of server push
• Limits on HEADERS block size
• Denial of Service
• Slow Read (CVE-2016-1546)
• HPACK Bomb (CVE-2016-1544, CVE-2016-2525)
• Dependency Cycle Attack (CVE-2015-8659)
• Stream Multiplexing Abuse (CVE-2016-0150)
The Future : QUIC
• Quick UDP Internet Connections
• TCP + TLS + HTTP/2 over UDP
• Long term enhancements to TCP
• No more 3 way handshake.
• Reduced Round Trip.
• Connection Migration.
• Proactive speculative retransmission.
• Automatic fallback to TCP.
You have a
All images are found via Google search. They belong to their respective owners.