$30 off During Our Annual Pro Sale. View Details »
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
120
入門 FormObject / An Introduction to FormObject #kaigionrails
expajp
2
4.9k
あなたの「仮説検証」、ゆがんでいませんか? / Isn't Your "Hypothesis Verification" Distorted? #emoasis
expajp
2
430
Rubyはなぜ「たのしい」のか? / Why is Ruby a programmers' best friend? #tqrk15
expajp
5
2.1k
エンジニアリングマネージャーはどう学んでいくのか #devsumi / How Do Engineering Managers Continue to Learn and Grow?
expajp
8
5.5k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
530
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
480
ActiveSupport::Concernで開くメタプログラミングの扉 #heiseirubykaigi / The door of meta-programing is opened by ActiveSupport::Concern
expajp
1
2.3k
実践Railsアプリケーション設計 #meetup_rails / Practical Rails Application Design
expajp
4
40k
Other Decks in Technology
See All in Technology
MariaDB Connector/C のcaching_sha2_passwordプラグインの仕様について
boro1234
0
920
GitHub Copilotを使いこなす 実例に学ぶAIコーディング活用術
74th
3
3.5k
AWS CLIの新しい認証情報設定方法aws loginコマンドの実態
wkm2
7
760
障害対応訓練、その前に
coconala_engineer
0
120
SQLだけでマイグレーションしたい!
makki_d
0
1.1k
MLflowダイエット大作戦
lycorptech_jp
PRO
1
140
AI時代のワークフロー設計〜Durable Functions / Step Functions / Strands Agents を添えて〜
yakumo
3
890
AI駆動開発の実践とその未来
eltociear
1
280
AIプラットフォームにおけるMLflowの利用について
lycorptech_jp
PRO
1
170
20251219 OpenIDファウンデーション・ジャパン紹介 / OpenID Foundation Japan Intro
oidfj
0
190
Fashion×AI「似合う」を届けるためのWEARのAI戦略
zozotech
PRO
2
870
5分で知るMicrosoft Ignite
taiponrock
PRO
0
400
Featured
See All Featured
Technical Leadership for Architectural Decision Making
baasie
0
180
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
The SEO identity crisis: Don't let AI make you average
varn
0
32
Rails Girls Zürich Keynote
gr2m
95
14k
Ethics towards AI in product and experience design
skipperchong
1
130
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
2
2.7k
What's in a price? How to price your products and services
michaelherold
246
13k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
400
End of SEO as We Know It (SMX Advanced Version)
ipullrank
2
3.8k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
30
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
0
38
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