Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
その正規表現、異議あり! 〜 ReDoSについて
Search
Shu OGAWARA
April 24, 2019
Technology
2
6.1k
その正規表現、異議あり! 〜 ReDoSについて
2019/04/24の銀座Rails#8での発表資料です。
スライド中で紹介している拙作gemはこちら
https://github.com/expajp/reredos
Shu OGAWARA
April 24, 2019
Tweet
Share
More Decks by Shu OGAWARA
See All by Shu OGAWARA
あなたの知らないDateのひみつ / The Secret of "Date" You Haven't known #tqrk16
expajp
0
130
入門 FormObject / An Introduction to FormObject #kaigionrails
expajp
2
5.3k
あなたの「仮説検証」、ゆがんでいませんか? / Isn't Your "Hypothesis Verification" Distorted? #emoasis
expajp
2
440
Rubyはなぜ「たのしい」のか? / Why is Ruby a programmers' best friend? #tqrk15
expajp
5
2.1k
エンジニアリングマネージャーはどう学んでいくのか #devsumi / How Do Engineering Managers Continue to Learn and Grow?
expajp
9
5.6k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
550
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
490
ActiveSupport::Concernで開くメタプログラミングの扉 #heiseirubykaigi / The door of meta-programing is opened by ActiveSupport::Concern
expajp
1
2.4k
実践Railsアプリケーション設計 #meetup_rails / Practical Rails Application Design
expajp
4
40k
Other Decks in Technology
See All in Technology
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
#22 CA × atmaCup 3rd 1st Place Solution
yumizu
1
220
「違う現場で格闘する二人」——社内コミュニティがつないだトヨタ流アジャイルの実践とその先
shinichitakeuchi
0
410
Data Hubグループ 紹介資料
sansan33
PRO
0
2.6k
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.3k
歴史から学ぶ、Goのメモリ管理基礎
logica0419
14
2.8k
Vivre en Bitcoin : le tutoriel que votre banquier ne veut pas que vous voyiez
rlifchitz
0
260
戰略轉變:從建構 AI 代理人到發展可擴展的技能生態系統
appleboy
0
200
2025年の医用画像AI/AI×medical_imaging_in_2025_generated_by_AI
tdys13
0
340
習慣とAIと環境 — 技術探求を続ける3つの鍵
azukiazusa1
2
270
Introduction to Bill One Development Engineer
sansan33
PRO
0
350
SwiftDataを覗き見る
akidon0000
0
270
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
99
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.9k
Technical Leadership for Architectural Decision Making
baasie
0
210
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Google's AI Overviews - The New Search
badams
0
890
[SF Ruby Conf 2025] Rails X
palkan
0
710
Testing 201, or: Great Expectations
jmmastey
46
7.9k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
100
It's Worth the Effort
3n
188
29k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Transcript
ͦͷਖ਼نදݱɺҟٞ͋Γʂ ʙ ReDoSʹ͍ͭͯ Shu OGAWARA(@expajp) 2019/04/24 ۜ࠲Rails #8
ਖ਼نදݱͬͯ·͔͢ʁ
ϝΞυͷόϦσʔγϣϯʹ ਖ਼نදݱΛ͍ͬͯΔਓ
ͦΕ͔ͯ͜͠͠ΜͳͷͰʁ 2019/04/24 4
ͳͦ͞͏ 2019/04/24 5
ग़యɿχίχɾίϞϯζ http://commons.nicovideo.jp/material/nc38409
͜ͷਖ਼نදݱʹɺ ੬ऑੑ͕͋Δ
࣮ࡍʹ͝ཡ͍ͩ͘͞
ςετεΫϦϓτ 2019/04/24 9 ग़యɿਖ਼نදݱͰͷϝʔϧΞυϨενΣοΫݟ͖͢ – ReDoS – yohgaki's blog https://blog.ohgaki.net/redos-must-review-mail-address-validation
࣮ߦ݁Ռ 2019/04/24 10
ݪҼ • ਖ਼نදݱΤϯδϯʹѱຐͷূ໌ΛΒ͍ͤͯΔ • ʮҙͷจࣈྻʯදݱ͕ଓ͘ͱ Ε͕Θ͔Βͳ͍ͷͰɺશύλʔϯΛௐΔ – શύλʔϯΛௐͳ͍ͱ Ϛον͠ͳ͍͜ͱ֬ఆͰ͖ͳ͍ –
Έ߹Θ͕ͤരൃ͍ͯ͠Δ 2019/04/24 11
࣮ࡍʹΈ߹Θ͕ͤ രൃ͍ͯ͠Δ༷ࢠΛ ͝ཡ͍ͩ͘͞
؆୯ͷͨΊ • ݟͤΔͷ͜ͷ෦ͷνΣοΫͷΈ 2019/04/24 13
Έ߹Θͤരൃ • host. ·ͰϚονͯ͠ɺ࣍ 2019/04/24 14
Έ߹Θͤരൃ • . (υοτ) ·ͰϚον͕ͨ͠ 2019/04/24 15
Έ߹Θͤരൃ • ͦͷޙΖ͕ҧ͏ͷͰΔ 2019/04/24 16
Έ߹Θͤരൃ • ͬͺΓҧ͏ͷͰ1ͭΔɺΛ܁Γฦ͠ 2019/04/24 17
Έ߹Θͤരൃ • ͜͜·ͰΔ 2019/04/24 18
Έ߹Θͤരൃ • ࠷ޙ·ͰͬͯɺͬͺΓϚον͠ͳ͍ 2019/04/24 19
Έ߹Θͤരൃ • * Λ0ճͱղऍͯ࣍͠ΛௐΔ 2019/04/24 20
Έ߹Θͤരൃ • ͬͺΓϚον͠ͳ͍ͷͰ1ͭͣͭޙΖʹ 2019/04/24 21
Έ߹Θͤരൃ • 1ݸͣͭͬͯͬͱϚον͠ͳ͍ͷ͕֬ఆ 2019/04/24 22
͜Ε͕ԿΛҙຯ͢Δ͔ʁ
ԿΛҙຯ͢Δ͔ • લ·ͰҰகͯ͠ɺ ࠷ޙͷ1จࣈ͚ͩϚον͠ͳ͍จࣈྻΛ ϝʔϧΞυϨεཝʹ์ΓࠐΉ͚ͩͰ DoS߈ܸ͕Ͱ͖Δ 2019/04/24 24
DoS߈ܸ • ϦιʔεʹҙਤతʹաͳෛՙΛ͔͚ͨΓ ੬ऑੑΛ͍ͭͨΓ͢ΔࣄͰ αʔϏεΛ͢Δ߈ܸख๏ͷ͜ͱ – F5ΞλοΫͱ͔ • ਖ਼نදݱΛͬͨDoSReDoSͱݺΕΔ 2019/04/24
25
͞Βʹ൵͍͜͠ͱʹɺ ϝΞυͷ͞Ͱ͚ͳ͍
࣮ߦ݁Ռ 2019/04/24 27
ϝʔϧΞυϨεͷఆٛ • RFC1035, 5321ΑΓ – ϝʔϧΞυϨεશମ256จࣈҎ – Ϣʔβ໊ʢ@ͷલʣ64จࣈҎ – υϝΠϯ255จࣈҎ
– υϝΠϯͷϥϕϧ63จࣈҎ • test.example.com <- ྫ͑͜͜ – ଞɺ͑Δจࣈܾ·͍ͬͯΔ 2019/04/24 28
Ͳ͏͢ΕΑ͍ͷ͔ʁ
จࣈྻΛ۠ͬͯ͘͠ γϯϓϧͳਖ਼نදݱͰఆ
ͱ͍͑ɺ ͍͍࣮ͪͪ͢Δͷ໘
ͱ͍͏Θ͚Ͱ (FNΛ࡞Γ·ͨ͠
reredos 2019/04/24 33
reredos • ReDoSʹڧ͍ϝΞυͷόϦσʔγϣϯΛߦ͍ɺ true/false Ͱฦ͢γϯϓϧͳgem • ࠓޙͷ༧ఆ – ଘࡏ͠ͳ͍TLDΛ͘ –
URLʹରԠ͢Δ • PR͓ͪͯ͠·͢ 2019/04/24 34
·ͱΊ • ਖ਼نදݱͰDoS߈ܸΛ͔͚Δख๏͕͋Δ – ReDoSͱ͍͏ • ෳࡶͳਖ਼نදݱආ͚Δ͖ – ༷ΛͪΌΜͱಡΜͰɺ͍୯ҐͰνΣοΫΛ͢ Δ͜ͱΛ৺͕͚Α͏
• ϝΞυͰόϦσʔγϣϯ͔͚ΔgemΛ࡞ͬͨ 2019/04/24 35
ฏ͕ऴΘΔલʹରԠ͠Α͏
ࣗݾհ • Shu OGAWARA (@expajp ) – ϦϯΧʔζגࣜձࣾ – Ruby/Railsྺ2ऑ
– ग़ௗऔɺେֶਆށ – झຯΫϥγοΫܥͷ߹এ 2019/04/24 37