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
6.3k
2
Share
その正規表現、異議あり! 〜 ReDoSについて
2019/04/24の銀座Rails#8での発表資料です。
スライド中で紹介している拙作gemはこちら
https://github.com/expajp/reredos
Shu OGAWARA
April 24, 2019
More Decks by Shu OGAWARA
See All by Shu OGAWARA
人生を変えた一冊「独学大全」のはなし / Self-study ENCYCLOPEDIA: The Book Which Change My Life #独学大全 #EM推し本
expajp
0
140
あなたの知らないDateのひみつ / The Secret of "Date" You Haven't known #tqrk16
expajp
0
150
入門 FormObject / An Introduction to FormObject #kaigionrails
expajp
2
6.5k
あなたの「仮説検証」、ゆがんでいませんか? / Isn't Your "Hypothesis Verification" Distorted? #emoasis
expajp
2
540
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.7k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
610
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
510
ActiveSupport::Concernで開くメタプログラミングの扉 #heiseirubykaigi / The door of meta-programing is opened by ActiveSupport::Concern
expajp
1
2.4k
Other Decks in Technology
See All in Technology
TUNA Camp 2026 京都Stage ヒューリスティックアルゴリズム入門
terryu16
0
670
AIにより大幅に強化された AWS Transform Customを触ってみる
0air
0
310
Cortex Codeでデータの仕事を全部Agenticにやりきろう!
gappy50
0
290
「決め方」の渡し方 / How to hand over the "decision-making process"
pauli
6
1.2k
GitHub Advanced Security × Defender for Cloudで開発とSecOpsのサイロを超える: コードとクラウドをつなぐ、開発プラットフォームのセキュリティ
yuriemori
1
130
Tour of Agent Protocols: MCP, A2A, AG-UI, A2UI with ADK
meteatamel
0
200
Kubernetes基盤における開発者体験 とセキュリティの両⽴ / Balancing developer experience and security in a Kubernetes-based environment
chmikata
0
170
OPENLOGI Company Profile for engineer
hr01
1
62k
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
3
2.1k
Databricks Lakebaseを用いたAIエージェント連携
daiki_akimoto_nttd
0
150
建設的な現実逃避のしかた / How to practice constructive escapism
pauli
3
140
ログ基盤・プラグイン・ダッシュボード、全部整えた。でも最後は人だった。
makikub
1
210
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Writing Fast Ruby
sferik
630
63k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
250
Ruling the World: When Life Gets Gamed
codingconduct
0
190
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
160
Building the Perfect Custom Keyboard
takai
2
720
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
660
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
320
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.4k
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