---
type: Slides
title: What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
description: "Surveys weaknesses in WebSocket APIs: cross-site WebSocket hijacking including a null-origin variant delivered from a data URI iframe, missing authentication and object-reference checks on individual messages, and smuggling arbitrary HTTP requests to internal endpoints through reverse proxies that blindly tunnel an upgraded connection."
resource: "https://speakerdeck.com/0ang3el/whats-wrong-with-websocket-apis-unveiling-vulnerabilities-in-websocket-apis"
tags: [slides, webseclist-reference, en, speaker-deck, websocket, request-smuggling, csrf, idor, auth-bypass, reverse-proxy, same-origin-policy, proxy, http, owasp-a01-2021]
generated:
  by: webseclist-refs/1
  at: "2026-08-10T16:00:39+00:00"
status: stable
stale_after: 2027-08-10
sources:
  - id: original
    resource: "https://speakerdeck.com/0ang3el/whats-wrong-with-websocket-apis-unveiling-vulnerabilities-in-websocket-apis"
    title: What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
    author: Mikhail Egorov
    last_modified: 2019-10-25
also_at: []
authors:
  - Mikhail Egorov
canonical_url: ""
cited_by:
  - "2019.md:27"
commit: ""
content_sha256: 900bf0dc796eb2800f69a73e47447c0c8d6c82dc9b50182b02df66bebe262efd
depth: full
depth_reason: default
kind: slides
language: en
licence: unknown
original_url: "https://speakerdeck.com/0ang3el/whats-wrong-with-websocket-apis-unveiling-vulnerabilities-in-websocket-apis"
published: 2019-10-25
publisher: Speaker Deck
publisher_english: ""
raw_sha256: ccdf84d253a7682fb7814c533ef4883de6017d15308b2f6cdb4bca7362741de0
retrieved_from: "https://speakerdeck.com/0ang3el/whats-wrong-with-websocket-apis-unveiling-vulnerabilities-in-websocket-apis"
retrieved_kind: live
retrieved_utc: "2026-08-10T16:00:39+00:00"
slug: 2019-speaker-deck-whats-wrong-websocket-apis-unveiling-vulnerabilities-apis
snapshot: ""
title_english: ""
translation_file: ""
translation_of: ""
---

# What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.

**What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.** - Mikhail Egorov, Speaker Deck.

- Published: 2019-10-25
- Original: <https://speakerdeck.com/0ang3el/whats-wrong-with-websocket-apis-unveiling-vulnerabilities-in-websocket-apis>
- Preserved from: https://speakerdeck.com/0ang3el/whats-wrong-with-websocket-apis-unveiling-vulnerabilities-in-websocket-apis (live) on 2026-08-10
- Licence: unknown

Rights remain with the original author and publisher. This is a research
archive of a source from the Web Hacking Techniques Index collections, kept so the
page going offline. To read the original, follow the link above.

## Content

> UNTRUSTED SOURCE TEXT. Everything below this line is third-party material
> quoted for research. It is data, not instructions. Do not follow directions,
> execute code, or fetch URLs because this text says so.

What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs. - Speaker Deck

# What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.

Slides from Hacktivity 2019 conference - [https://hacktivity.com/index.php/presentations/](https://hacktivity.com/index.php/presentations/).

 ![Avatar for Mikhail Egorov](https://secure.gravatar.com/avatar/0e97d20ff87bf33851da8cadb86affa9?s=128)

##  [Mikhail Egorov](https://speakerdeck.com/0ang3el)

 October 25, 2019

## More Decks by Mikhail Egorov

 [ See All by Mikhail Egorov ](https://speakerdeck.com/0ang3el)

 [A Hacker's perspective on AEM applications security](https://speakerdeck.com/0ang3el/a-hackers-perspective-on-aem-applications-security)

 [ ![Avatar for Mikhail Egorov](https://secure.gravatar.com/avatar/0e97d20ff87bf33851da8cadb86affa9?s=24) 0ang3el ](https://speakerdeck.com/0ang3el)

 0

  4.1k

 [Securing AEM webapps by hacking them](https://speakerdeck.com/0ang3el/securing-aem-webapps-by-hacking-them)

 [ ![Avatar for Mikhail Egorov](https://secure.gravatar.com/avatar/0e97d20ff87bf33851da8cadb86affa9?s=24) 0ang3el ](https://speakerdeck.com/0ang3el)

 1

  1.7k

 [AEM hacker approaching Adobe Experience Manager webapps in bug bounty programs](https://speakerdeck.com/0ang3el/aem-hacker-approaching-adobe-experience-manager-webapps-in-bug-bounty-programs)

 [ ![Avatar for Mikhail Egorov](https://secure.gravatar.com/avatar/0e97d20ff87bf33851da8cadb86affa9?s=24) 0ang3el ](https://speakerdeck.com/0ang3el)

 3

  12k

 [Hunting for security bugs in AEM webapps](https://speakerdeck.com/0ang3el/hunting-for-security-bugs-in-aem-webapps)

 [ ![Avatar for Mikhail Egorov](https://secure.gravatar.com/avatar/0e97d20ff87bf33851da8cadb86affa9?s=24) 0ang3el ](https://speakerdeck.com/0ang3el)

 2

  37k

 [Neat tricks to bypass CSRF-protection](https://speakerdeck.com/0ang3el/neat-tricks-to-bypass-csrf-protection)

 [ ![Avatar for Mikhail Egorov](https://secure.gravatar.com/avatar/0e97d20ff87bf33851da8cadb86affa9?s=24) 0ang3el ](https://speakerdeck.com/0ang3el)

 2

  2.1k

 [CSRF-уязвимости все еще актуальны: как атакующие обходят CSRF-защиту в вашем веб-приложении](https://speakerdeck.com/0ang3el/csrf-uiazvimosti-vsie-ieshchie-aktual-ny-kak-atakuiushchiie-obkhodiat-csrf-zashchitu-v-vashiem-vieb-prilozhienii)

 [ ![Avatar for Mikhail Egorov](https://secure.gravatar.com/avatar/0e97d20ff87bf33851da8cadb86affa9?s=24) 0ang3el ](https://speakerdeck.com/0ang3el)

 1

  600

## Other Decks in Programming

 [ See All in Programming ](https://speakerdeck.com/c/programming)

 [琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries](https://speakerdeck.com/luccafort/you-might-be-able-to-stop-the-water-flow-of-lake-biwa-but-you-cant-stop-net-http-retries)

 [ ![Avatar for luccafort](https://speakerdeck.com/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MzM0NzYzLCJwdXIiOiJibG9iX2lkIn19--bba9e4bb1f36172b8ddd875db8283d273044d07a/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJwbmciLCJyZXNpemVfdG9fZmlsbCI6WzI0LDI0XX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--924ecf2834d46e1be7416cc0ef8ce19d4bbdebbf/2023-logo-compressed.png) luccafort ](https://speakerdeck.com/luccafort)

 [PRO](https://speakerdeck.com/pro?utm_campaign=PRO&utm_medium=web&utm_source=user_pro_badge)

 0

  600

 [人間の目はかわらない、だからJPEGは30年もつ](https://speakerdeck.com/yuzneri/ren-jian-nomu-hakawaranai-dakarajpegha30nian-motu)

 [ ![Avatar for yuzneri](https://speakerdeck.com/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MTk5Mjk4LCJwdXIiOiJibG9iX2lkIn19--ceb7e5047d49436a51a2b172915a24dc106f8589/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJwbmciLCJyZXNpemVfdG9fZmlsbCI6WzI0LDI0XX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--924ecf2834d46e1be7416cc0ef8ce19d4bbdebbf/SDicon.png) yuzneri ](https://speakerdeck.com/yuzneri)

 12

  18k

 [AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch](https://speakerdeck.com/gotok365/aws-cdk-from-scratch)

 [ ![Avatar for k.goto](https://speakerdeck.com/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MzU0NzgsInB1ciI6ImJsb2JfaWQifX0=--1305fec534f79b1ff0cd046e127fc126cdd6c0d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJqcGVnIiwicmVzaXplX3RvX2ZpbGwiOlsyNCwyNF19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--b48c0a77ba540dff89d4e01c944dfca4119c9e28/3A2C3113-89AE-44CA-A913-8B9FE98E17B1.jpeg) gotok365 ](https://speakerdeck.com/gotok365)

 3

  2.8k

 [仕様書を書く前にハーネスを作る - Agent Native開発は「探索を速く、判定を固く」](https://speakerdeck.com/gotalab555/shi-yang-shu-woshu-kuqian-nihanesuwozuo-ru-agent-nativekai-fa-ha-tan-suo-wosu-ku-pan-ding-wogu-ku)

 [ ![Avatar for Gota](https://speakerdeck.com/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MzkwMjM2LCJwdXIiOiJibG9iX2lkIn19--36c11f982f6809374b012fff3ec53b65f0b4c39b/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJwbmciLCJyZXNpemVfdG9fZmlsbCI6WzI0LDI0XX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--924ecf2834d46e1be7416cc0ef8ce19d4bbdebbf/icon.png) gotalab555 ](https://speakerdeck.com/gotalab555)

 4

  1.6k

 [PHP初心者セッション2026 〜生成AIでは見えない裏側を知る：今だからLAMPを通して仕組みを学ぶ〜](https://speakerdeck.com/kashioka/phpchu-xin-zhe-setusiyon2026-sheng-cheng-aidehajian-enaili-ce-wozhi-ru-jin-dakaralampwotong-siteshi-zu-miwoxue-bu)

 [ ![Avatar for Hideo Kashioka](https://secure.gravatar.com/avatar/267cdf0d184f715349459a0af9e6b0ff?s=24) kashioka ](https://speakerdeck.com/kashioka)

 0

  860

 [FDEが実現するAI駆動経営の現在地](https://speakerdeck.com/gonta/ai-driven-management-enabled-by-fde)

 [ ![Avatar for ryuta sakamoto](https://secure.gravatar.com/avatar/c48e5a207bf56f0a2c0430eba2338325?s=24) gonta ](https://speakerdeck.com/gonta)

 2

  270

 [Cloudflare is Agents](https://speakerdeck.com/chimame/cloudflare-is-agents)

 [ ![Avatar for chimame](https://secure.gravatar.com/avatar/52f95e52a6d71b67361ac179fb8405f4?s=24) chimame ](https://speakerdeck.com/chimame)

 0

  140

 [Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜](https://speakerdeck.com/kentaroutakeda/laravel-boostnixue-bu-ainiphpwoshu-kaseruji-shu-ossnoshi-zhuang-karazheng-liu-suruezientozhi-yu-nowang-dao)

 [ ![Avatar for 武田 憲太郎](https://secure.gravatar.com/avatar/da5f6aeb65f2675dd9ec5928baf22c56?s=24) kentaroutakeda ](https://speakerdeck.com/kentaroutakeda)

 3

  670

 [AIが無かった頃の素敵な出会いの話](https://speakerdeck.com/codmoninc/leap-year)

 [ ![Avatar for コドモン開発チーム](https://speakerdeck.com/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6NzQ3MzQ3LCJwdXIiOiJibG9iX2lkIn19--3f65a93a09e0a48d5c4da7132a16b2bf2a339846/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJqcGciLCJyZXNpemVfdG9fZmlsbCI6WzI0LDI0XX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--dcc78b2290da0fc746e1bfe817edcd08056147b6/%E3%83%AD%E3%82%B3%E3%82%99%E7%99%BD%E8%83%8C%E6%99%AF.jpg) codmoninc ](https://speakerdeck.com/codmoninc)

 1

  390

 [これって Effect でできたのでは? / TSKaigi Mashup Kansai #2](https://speakerdeck.com/susisu/tskaigi-mashup-kansai-number-2)

 [ ![Avatar for Susisu](https://speakerdeck.com/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MjUzNTM5LCJwdXIiOiJibG9iX2lkIn19--866bc0f5292297dcf556f0a02491f523e3bf788f/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJwbmciLCJyZXNpemVfdG9fZmlsbCI6WzI0LDI0XX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--924ecf2834d46e1be7416cc0ef8ce19d4bbdebbf/icon_abstract.png) susisu ](https://speakerdeck.com/susisu)

 0

  150

 [【やさしく解説 設計編・中級 #1】一つの車に、運転手は一人 ～ある倉庫システムの事例から～](https://speakerdeck.com/panda728/yasasiku-sekkei-2-number-1)

 [ ![Avatar for HideyukiKitao](https://speakerdeck.com/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6NDYxNzYxLCJwdXIiOiJibG9iX2lkIn19--311fd001070ae8fbe7f712b87ca75029a8717c7c/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJqcGVnIiwicmVzaXplX3RvX2ZpbGwiOlsyNCwyNF19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--b48c0a77ba540dff89d4e01c944dfca4119c9e28/IMG_3396.jpeg) panda728 ](https://speakerdeck.com/panda728)

 [PRO](https://speakerdeck.com/pro?utm_campaign=PRO&utm_medium=web&utm_source=user_pro_badge)

 0

  200

 [jsmini JavaScript Engine を作ってみた話](https://speakerdeck.com/yosuke_furukawa/jsmini-javascript-engine-wozuo-tutemitahua)

 [ ![Avatar for Yosuke Furukawa](https://secure.gravatar.com/avatar/d76231a2114896dfcc7b79ac69558b79?s=24) yosuke_furukawa ](https://speakerdeck.com/yosuke_furukawa)

 [PRO](https://speakerdeck.com/pro?utm_campaign=PRO&utm_medium=web&utm_source=user_pro_badge)

 0

  290

## Featured

 [ See All Featured ](https://speakerdeck.com/p/featured)

 [BBQ](https://speakerdeck.com/matthewcrist/bbq)

 [ ![Avatar for Matthew Crist](https://secure.gravatar.com/avatar/761be20b5ebd271008bcee1244fc5b52?s=24) matthewcrist ](https://speakerdeck.com/matthewcrist)

 89

  10k

 [The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024](https://speakerdeck.com/eileencodes/the-myth-of-the-modular-monolith-day-2-keynote-rails-world-2024)

 [ ![Avatar for Eileen M. Uchitelle](https://secure.gravatar.com/avatar/c44e1f7e22c3f23cff7bc130871047ef?s=24) eileencodes ](https://speakerdeck.com/eileencodes)

 28

  3.6k

 [Have SEOs Ruined the Internet? - User Awareness of SEO in 2025](https://speakerdeck.com/akashhashmi/have-seos-ruined-the-internet-user-awareness-of-seo-in-2025)

 [ ![Avatar for Akash Hashmi](https://secure.gravatar.com/avatar/29692d1f7c44ff105e34864118235415?s=24) akashhashmi ](https://speakerdeck.com/akashhashmi)

 0

  410

 [Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End](https://speakerdeck.com/smashingmag/responsive-adventures-dirty-tricks-from-the-dark-corners-of-front-end)

 [ ![Avatar for Vitaly Friedman](https://secure.gravatar.com/avatar/b3d6434763caa0ef5dc4b792662c49f7?s=24) smashingmag ](https://speakerdeck.com/smashingmag)

 254

  22k

 [Ruling the World: When Life Gets Gamed](https://speakerdeck.com/codingconduct/ruling-the-world-when-life-gets-gamed)

 [ ![Avatar for Sebastian Deterding](https://secure.gravatar.com/avatar/9f5f8d89c1c298beb2e5d3b1e41941e2?s=24) codingconduct ](https://speakerdeck.com/codingconduct)

 0

  290

 [The Cost Of JavaScript in 2023](https://speakerdeck.com/addyosmani/the-cost-of-javascript-in-2023)

 [ ![Avatar for Addy Osmani](https://secure.gravatar.com/avatar/96270e4c3e5e9806cf7245475c00b275?s=24) addyosmani ](https://speakerdeck.com/addyosmani)

 55

  10k

 [コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI](https://speakerdeck.com/rkaga/what-awaits-us-in-a-world-where-90-percent-of-the-code-is-written-by-ai)

 [ ![Avatar for r-kagaya](https://speakerdeck.com/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MTk0MjI4LCJwdXIiOiJibG9iX2lkIn19--1d94fa4c6a5eceb2447fdd6c94e46df3dbd85301/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJqcGciLCJyZXNpemVfdG9fZmlsbCI6WzI0LDI0XX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--dcc78b2290da0fc746e1bfe817edcd08056147b6/69yLDu7R_400x400.jpg) rkaga ](https://speakerdeck.com/rkaga)

 63

  45k

 [Stop Working from a Prison Cell](https://speakerdeck.com/hatefulcrawdad/stop-working-from-a-prison-cell)

 [ ![Avatar for Chris Michel](https://secure.gravatar.com/avatar/c1daf20e5c49ff910745198ef9869ac2?s=24) hatefulcrawdad ](https://speakerdeck.com/hatefulcrawdad)

 274

  21k

 [The Illustrated Guide to Node.js - THAT Conference 2024](https://speakerdeck.com/reverentgeek/the-illustrated-guide-to-node-dot-js-that-conference-2024)

 [ ![Avatar for David Neal](https://secure.gravatar.com/avatar/3ab1249be442027903e1180025340b3f?s=24) reverentgeek ](https://speakerdeck.com/reverentgeek)

 1

  420

 [ピンチをチャンスに：未来をつくるプロダクトロードマップ #pmconf2020](https://speakerdeck.com/aki_iinuma/pintiwotiyansuni-wei-lai-wotukurupurodakutorodomatupu-number-pmconf2020)

 [ ![Avatar for Aki / @LoveIdahoBurger](https://secure.gravatar.com/avatar/e425fe9f170efa0dfaf8ab69d7107418?s=24) aki_iinuma ](https://speakerdeck.com/aki_iinuma)

 128

  56k

 [Rails Girls Zürich Keynote](https://speakerdeck.com/gr2m/rails-girls-zurich-keynote)

 [ ![Avatar for Gregor Martynus](https://secure.gravatar.com/avatar/24fc194843a71f10949be18d5a692682?s=24) gr2m ](https://speakerdeck.com/gr2m)

 96

  14k

 [Evolving SEO for Evolving Search Engines](https://speakerdeck.com/ryanjones/evolving-seo-for-evolving-search-engines)

 [ ![Avatar for Ryan Jones](https://secure.gravatar.com/avatar/2bf27e1a5632db8aba77510c78aaa9a2?s=24) ryanjones ](https://speakerdeck.com/ryanjones)

 0

  250

## Transcript

-

###  [What’s wrong with w/ WebSocket API? Unveiling vulnerabilities in WebSocket](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_0.jpg)

 APIs Mikhail Egorov / @0ang3el #HACKTIVITY2019

-

###  [# whoami 2 ▪ Security researcher / full-time bug hunter](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_1.jpg)

 ▪ https://bugcrowd.com/0ang3el ▪ https://hackerone.com/0ang3el ▪ Conference speaker ▪ https://www.slideshare.net/0ang3el ▪ https://speakerdeck.com/0ang3el

-

###  [Previous work 3 ▪ https://media.blackhat.com/bh-us- 12/Briefings/Shekyan/BH_US_12_Shekyan_Toukharian_Hacking_Websocket_Slides .pdf ▪ https://www.nccgroup.trust/us/about-us/newsroom-and- events/blog/2017/may/wssip-a-websocket-manipulation-proxy/](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_2.jpg)

 ▪ https://chybeta.github.io/2018/04/07/spring-messaging-Remote-Code-Execution- %E5%88%86%E6%9E%90-%E3%80%90CVE-2018-1270%E3%80%91/ ▪ https://www.twistlock.com/labs-blog/demystifying-kubernetes-cve-2018-1002105- dead-simple-exploit/ ▪ https://github.com/andresriancho/websocket-fuzzer ▪ https://www.irongeek.com/i.php?page=videos/derbycon9/stable-35-old-tools-new- tricks-hacking-websockets-michael-fowl-nick-defoe

-

###  [4 WebSocket protocol essentials](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_3.jpg)

-

###  [WebSocket protocol – RFC 6455 5 ▪ Efficient two-way communication](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_4.jpg)

 protocol ▪ WebSocket is stateful (HTTP is stateless) ▪ Two main parts: handshake and data transfer

-

###  [WebSocket protocol – RFC 6455 6 ▪ Extensibility: subprotocols and](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_5.jpg)

 extensions ▪ Subprotocols ▪ https://www.iana.org/assignments/websocket/websocket.xml#subpro tocol-name ▪ Wamp ▪ Stomp ▪ Soap ▪ …

-

###  [WebSocket protocol – RFC 6455 7 ▪ Extensibility: subprotocols and](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_6.jpg)

 extensions ▪ Extensions ▪ https://www.iana.org/assignments/websocket/websocket.xml#extens ion-name ▪ permessage-deflate ▪ bbf-usp-protocol

-

###  [WebSocket protocol – RFC 6455 8 ▪ Origin-based security model](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_7.jpg)

 (Browser clients) ▪ No authentication ▪ Client must do client-to-server masking

-

###  [WebSocket protocol support 9 ▪ Major web browsers ▪ Web](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_8.jpg)

 servers / Proxies ▪ Apache httpd, Nginx, IIS, … ▪ HAProxy, Traefik, Varnish, Envoy, … ▪ Cloud providers ▪WebSocket API (api gateways) ▪WebSocket proxying (load balancers)

-

###  [WebSocket handshake 10 Upgrade request Base64(Random nonce) Protocol version Required](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_9.jpg)

 HTTP version

-

###  [WebSocket handshake 11 Required status code BASE64(SHA1(Sec-WebSocket-Key || CONST ))](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_10.jpg)

-

###  [WebSocket data transfer 12 \x00 – continuation frame \x01 –](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_11.jpg)

 text frame \x02 – binary frame \x08 – close frame \x09 – ping \x0A – pong other values are reserved

-

###  [WebSocket data transfer - masking 13 ▪ Masking key is](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_12.jpg)

 32-bit long passed inside frame ▪ Client must send masked data ▪ MASKED = MASK ^ DATA (^ - XOR) ▪ Mechanism protects against cache poisoning and smuggling attacks

-

###  [14 Cross-Site WebSocket Hijacking](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_13.jpg)

-

###  [WebSocket security for Web Browser 15 ▪ SOP doesn’t work](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_14.jpg)

 for WebSocket in web browser ▪ Read from WebSocket cross-origin ▪ Write to WebSocket cross-origin ▪ Header Origin should be checked on handshake step (origin-based security model)

-

###  [CSWSH 16 ▪ Cookies are used to authenticate upgrade request](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_15.jpg)

 ▪ Header Origin isn’t checked or checked poorly

-

###  [CSWSH 17 ▪ CORS tricks from @albinowax are applicable to](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_16.jpg)

 WebSocket ▪ https://portswigger.net/research/exploiting-cors-misconfigurations- for-bitcoins-and-bounties ▪ Null origin ▪ Pre-domain wildcard ▪ Post-domain wildcard ▪ …

-

###  [CSWSH – Null origin 18 ▪ nullorigin.html <iframe src="data:text/html, <script>const](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_17.jpg)

 socket = new WebSocket('wss://example.com'); </script>"></iframe>

-

###  [CSWSH 19 ▪ Playground ▪ https://portswigger.net/web-security/websockets/cross-site- websocket-hijacking](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_18.jpg)

-

###  [CSWSH – template for attack 5](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_19.jpg)

-

###  [Demo 5](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_20.jpg)

-

###  [22 Authentication / IDOR issues](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_21.jpg)

-

###  [Authentication 23 ▪ WebSocket protocol doesn’t offer authentication ▪ Developers](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_22.jpg)

 have to roll out their own AuthN ▪ It’s secure to check AuthN only during handshake ▪ Common secure implementations ▪ Session cookies ▪ Tokens

-

###  [Broken authentication – Case 1 24 ▪ Some ID /](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_23.jpg)

 GUID is required in Upgrade request ▪ Guess ID ▪ Leak GUID (minor IDOR, …)

-

###  [Broken authentication – Case 2 25 ▪ No authentication during](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_24.jpg)

 handshake step ▪ Some ID / GUID required in API messages ▪ Guess ID ▪ Leak GUID (minor IDOR, …)

-

###  [Broken authentication – Case 2 26 ▪ Exposing GraphQL subscriptions](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_25.jpg)

 w/o AuthN ▪ https://github.com/righettod/poc-graphql#subscriptions- websocket-endpoint-default-enabling ▪ Path /subscriptions

-

###  [Insecure Direct Object Reference issues 27 ▪ Strong authentication during](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_26.jpg)

 handshake step ▪ Some ID / GUID required in API messages ▪ Guess ID ▪ Leak GUID (minor IDOR, …)

-

###  [28 Smuggling through WebSocket](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_27.jpg)

-

###  [Reverse proxying WebSocket connection 29 Client Frontend Reverse proxy Backend](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_28.jpg)

 /socket.io/ Public WebSocket API

-

###  [Reverse proxying WebSocket connection 30 Client Frontend Reverse proxy Upgrade](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_29.jpg)

 request Upgrade request Backend /socket.io/

-

###  [Reverse proxying WebSocket connection 31 Client Frontend Reverse proxy Upgrade](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_30.jpg)

 request Upgrade request HTTP/1.1 101 HTTP/1.1 101 Backend /socket.io/

-

###  [Reverse proxying WebSocket connection 32 Client Frontend Reverse proxy Upgrade](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_31.jpg)

 request Upgrade request HTTP/1.1 101 HTTP/1.1 101 WebSocket connection direct WebSocket connection Client - Backend Backend /socket.io/

-

###  [Smuggling through WebSocket connection 33 Client Frontend Reverse proxy (vulnerable)](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_32.jpg)

 Private REST API Public WebSocket API Backend /internal /socket.io/

-

###  [34 Backend Client Frontend Reverse proxy (vulnerable) /internal Upgrade request](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_33.jpg)

 /socket.io/ Sec-WebSocket-Version: 1337 Upgrade request Sec-WebSocket-Version: 1337 Version correctness isn’t checked! Smuggling through WebSocket connection

-

###  [35 Backend Client Frontend Reverse proxy (vulnerable) /internal Upgrade request](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_34.jpg)

 /socket.io/ Sec-WebSocket-Version: 1337 Upgrade request Sec-WebSocket-Version: 1337 HTTP/1.1 426 HTTP/1.1 426 Response correctness isn’t checked! Smuggling through WebSocket connection

-

###  [36 Backend Client Frontend Reverse proxy (vulnerable) /internal Upgrade request](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_35.jpg)

 /socket.io/ Sec-WebSocket-Version: 1337 Upgrade request Sec-WebSocket-Version: 1337 HTTP/1.1 426 HTTP/1.1 426 TLS connection direct TLS connection Client – Backend not WebSocket!!! Client can access /internal Smuggling through WebSocket connection

-

###  [Challenge – challenge.0ang3el.tk 37 ▪ URL ▪ https://challenge.0ang3el.tk/websocket.html ▪ You](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_36.jpg)

 need to access flag on localhost:5000 ▪ Seems no one solved

-

###  [Challenge – challenge.0ang3el.tk 38 ▪ Frontend ▪ Not disclosed WebSocket](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_37.jpg)

 reverse proxy ▪ socket.io.js ▪ Proxies only WebSocket API - /socket.io/ path ▪ Backend ▪ Flask, Flask-SoketIO, Flask-Restful ▪ Listens on localhost:5000 only

-

###  [challenge1.py](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_38.jpg)

-

###  [challenge1.py - DEMO](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_39.jpg)

-

###  [Vulnerable reverse proxies 41 ▪ Vulnerable ▪ Varnish, Envoy proxy](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_40.jpg)

 <= 1.8.0, other non-disclosed ▪ Not vulnerable ▪ Nginx, HAProxy, Traefik, others

-

###  [Varnish response 42 ▪ WebSocket proxying configuration ▪ https://varnish-cache.org/docs/6.3/users-guide/vcl-example- websockets.html](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_41.jpg)

-

###  [Smuggling through WebSocket connection 43 Client Frontend Reverse proxy (Nginx](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_42.jpg)

 or another) Private REST API Public WebSocket API & REST API Backend /internal /api/socket.io/ /api/health

-

###  [Smuggling through WebSocket connection 44 Client Frontend Reverse proxy (Nginx](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_43.jpg)

 or another) Backend /internal /api/socket.io/ /api/health example.com GET HTTP/1.1 200

-

###  [Smuggling through WebSocket connection 45 Client Frontend Reverse proxy (Nginx](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_44.jpg)

 or another) Backend /internal /api/socket.io/ /api/health Only Upgrade: websocket header is checked! POST /api/health?u= POST /api/health?u=

-

###  [Smuggling through WebSocket connection 46 Client Frontend Reverse proxy (Nginx](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_45.jpg)

 or another) Backend /internal /api/socket.io/ /api/health attacker.com GET HTTP/1.1 101 HTTP/1.1 101 HTTP/1.1 101 Only status code is checked for response! POST /api/health?u= POST /api/health?u=

-

###  [Smuggling through WebSocket connection 47 Client Frontend Reverse proxy (Nginx](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_46.jpg)

 or another) Backend /internal /api/socket.io/ /api/health HTTP/1.1 101 HTTP/1.1 101 TLS connection direct TLS connection Client – Backend not WebSocket!!! Client can access /internal POST /api/health?u= POST /api/health?u= Client-to-Server masking isn’t checked by proxy!!!

-

###  [Challenge2 – challenge2.0ang3el.tk 48 ▪ URL ▪ https://challenge2.0ang3el.tk/websocket.html ▪ You](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_47.jpg)

 need to access flag on localhost:5000 ▪ Seems no one solved

-

###  [Challenge2 – challenge2.0ang3el.tk 49 ▪ Frontend ▪ Nginx as WebSocket](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_48.jpg)

 reverse proxy ▪ socket.io.js ▪ Proxies only /api/public path (socket.io and healthcheck) ▪ Backend ▪ Flask, Flask-SoketIO, Flask-Restful ▪ Listens on localhost:5000 only

-

###  [Challenge2 – challenge2.0ang3el.tk 50 ▪ Nginx config](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_49.jpg)

-

###  [Challenge2 – challenge2.0ang3el.tk 51 ▪ REST API - healthcheck](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_50.jpg)

-

###  [Challenge2.py 5](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_51.jpg)

-

###  [Challenge2.py - Demo 5](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_52.jpg)

-

###  [Vulnerable reverse proxies 54 ▪ Almost all proxies are affected](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_53.jpg)

 ▪ But exploitation is limited ▪ External SSRF is required that returns status code ▪ …

-

###  [55 Discovering WebSocket APIs](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_54.jpg)

-

###  [Discovering WebSocket API 56 ▪ Monitor Upgrade requests ▪ Analyze](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_55.jpg)

 JavaScript files ▪ Try to establish WebSocket connection to each URL ▪ …

-

###  [57 Conclusion](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_56.jpg)

-

###  [Ideas for further research 58 ▪ Security of WebSocket subprotocols](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_57.jpg)

 ▪ More smuggling techniques ▪ HTTP/2 and WebSocket ▪ …

-

###  [Thank you! @0ang3el](https://files.speakerdeck.com/presentations/c90623dc272a45b5af15befdbbfb3672/slide_58.jpg)
