Slide 1

Slide 1 text

ͦͷਖ਼نදݱɺҟٞ͋Γʂ ʙ ReDoSʹ͍ͭͯ Shu OGAWARA(@expajp) 2019/04/24 ۜ࠲Rails #8

Slide 2

Slide 2 text

ਖ਼نදݱ࢖ͬͯ·͔͢ʁ

Slide 3

Slide 3 text

ϝΞυͷόϦσʔγϣϯʹ ਖ਼نදݱΛ࢖͍ͬͯΔਓ

Slide 4

Slide 4 text

ͦΕ͸΋͔ͯ͜͠͠ΜͳͷͰ͸ʁ 2019/04/24 4

Slide 5

Slide 5 text

໰୊ͳͦ͞͏ 2019/04/24 5

Slide 6

Slide 6 text

ग़యɿχίχɾίϞϯζ http://commons.nicovideo.jp/material/nc38409

Slide 7

Slide 7 text

͜ͷਖ਼نදݱʹ͸ɺ ੬ऑੑ͕͋Δ

Slide 8

Slide 8 text

࣮ࡍʹ͝ཡ͍ͩ͘͞

Slide 9

Slide 9 text

ςετεΫϦϓτ 2019/04/24 9 ग़యɿਖ਼نදݱͰͷϝʔϧΞυϨενΣοΫ͸ݟ௚͢΂͖ – ReDoS – yohgaki's blog https://blog.ohgaki.net/redos-must-review-mail-address-validation

Slide 10

Slide 10 text

࣮ߦ݁Ռ 2019/04/24 10

Slide 11

Slide 11 text

ݪҼ • ਖ਼نදݱΤϯδϯʹѱຐͷূ໌Λ΍Β͍ͤͯΔ • ʮ೚ҙ௕ͷจࣈྻʯදݱ͕ଓ͘ͱ ੾Ε໨͕Θ͔Βͳ͍ͷͰɺશύλʔϯΛௐ΂Δ – શύλʔϯΛௐ΂ͳ͍ͱ Ϛον͠ͳ͍͜ͱ͸֬ఆͰ͖ͳ͍ – ૊Έ߹Θ͕ͤരൃ͍ͯ͠Δ 2019/04/24 11

Slide 12

Slide 12 text

࣮ࡍʹ૊Έ߹Θ͕ͤ രൃ͍ͯ͠Δ༷ࢠΛ ͝ཡ͍ͩ͘͞

Slide 13

Slide 13 text

؆୯ͷͨΊ • ݟͤΔͷ͸͜ͷ෦෼ͷνΣοΫͷΈ 2019/04/24 13

Slide 14

Slide 14 text

૊Έ߹Θͤരൃ • host. ·ͰϚονͯ͠ɺ࣍ 2019/04/24 14

Slide 15

Slide 15 text

૊Έ߹Θͤരൃ • . (υοτ) ·ͰϚον͕ͨ͠ 2019/04/24 15

Slide 16

Slide 16 text

૊Έ߹Θͤരൃ • ͦͷޙΖ͕ҧ͏ͷͰ໭Δ 2019/04/24 16

Slide 17

Slide 17 text

૊Έ߹Θͤരൃ • ΍ͬͺΓҧ͏ͷͰ1ͭ໭ΔɺΛ܁Γฦ͠ 2019/04/24 17

Slide 18

Slide 18 text

૊Έ߹Θͤരൃ • ͜͜·Ͱ໭Δ 2019/04/24 18

Slide 19

Slide 19 text

૊Έ߹Θͤരൃ • ࠷ޙ·Ͱ໭ͬͯ΋ɺ΍ͬͺΓϚον͠ͳ͍ 2019/04/24 19

Slide 20

Slide 20 text

૊Έ߹Θͤരൃ • * Λ0ճͱղऍͯ࣍͠Λௐ΂Δ 2019/04/24 20

Slide 21

Slide 21 text

૊Έ߹Θͤരൃ • ΍ͬͺΓϚον͠ͳ͍ͷͰ1ͭͣͭޙΖʹ 2019/04/24 21

Slide 22

Slide 22 text

૊Έ߹Θͤരൃ • 1ݸͣͭ໭ͬͯ΍ͬͱϚον͠ͳ͍ͷ͕֬ఆ 2019/04/24 22

Slide 23

Slide 23 text

͜Ε͕ԿΛҙຯ͢Δ͔ʁ

Slide 24

Slide 24 text

ԿΛҙຯ͢Δ͔ • ௚લ·ͰҰகͯ͠ɺ ࠷ޙͷ1จࣈ͚ͩϚον͠ͳ͍จࣈྻΛ ϝʔϧΞυϨεཝʹ์ΓࠐΉ͚ͩͰ DoS߈ܸ͕Ͱ͖Δ 2019/04/24 24

Slide 25

Slide 25 text

DoS߈ܸ • Ϧιʔεʹҙਤతʹա৒ͳෛՙΛ͔͚ͨΓ ੬ऑੑΛ͍ͭͨΓ͢ΔࣄͰ αʔϏεΛ๦֐͢Δ߈ܸख๏ͷ͜ͱ – F5ΞλοΫͱ͔ • ਖ਼نදݱΛ࢖ͬͨDoS͸ReDoSͱݺ͹ΕΔ 2019/04/24 25

Slide 26

Slide 26 text

͞Βʹ൵͍͜͠ͱʹɺ ϝΞυͷ௕͞Ͱ஄͚ͳ͍

Slide 27

Slide 27 text

࣮ߦ݁Ռ 2019/04/24 27

Slide 28

Slide 28 text

ϝʔϧΞυϨεͷఆٛ • RFC1035, 5321ΑΓ – ϝʔϧΞυϨεશମ͸256จࣈҎ಺ – Ϣʔβ໊ʢ@ͷલʣ͸64จࣈҎ಺ – υϝΠϯ͸255จࣈҎ಺ – υϝΠϯͷϥϕϧ͸63จࣈҎ಺ • test.example.com <- ྫ͑͹͜͜ – ଞɺ࢖͑Δจࣈ΋ܾ·͍ͬͯΔ 2019/04/24 28

Slide 29

Slide 29 text

Ͳ͏͢Ε͹Α͍ͷ͔ʁ

Slide 30

Slide 30 text

จࣈྻΛ۠੾ͬͯ୹͘͠ γϯϓϧͳਖ਼نදݱͰ൑ఆ

Slide 31

Slide 31 text

ͱ͸͍͑ɺ ͍͍࣮ͪͪ૷͢Δͷ͸໘౗

Slide 32

Slide 32 text

ͱ͍͏Θ͚Ͱ (FNΛ࡞Γ·ͨ͠

Slide 33

Slide 33 text

reredos 2019/04/24 33

Slide 34

Slide 34 text

reredos • ReDoSʹڧ͍ϝΞυͷόϦσʔγϣϯΛߦ͍ɺ true/false Ͱฦ͢γϯϓϧͳgem • ࠓޙͷ༧ఆ – ଘࡏ͠ͳ͍TLDΛ஄͘ – URLʹରԠ͢Δ • PR͓଴ͪͯ͠·͢ 2019/04/24 34

Slide 35

Slide 35 text

·ͱΊ • ਖ਼نදݱͰDoS߈ܸΛ͔͚Δख๏͕͋Δ – ReDoSͱ͍͏ • ෳࡶͳਖ਼نදݱ͸ආ͚Δ΂͖ – ࢓༷ΛͪΌΜͱಡΜͰɺ୹͍୯ҐͰνΣοΫΛ͢ Δ͜ͱΛ৺͕͚Α͏ • ϝΞυͰόϦσʔγϣϯ͔͚ΔgemΛ࡞ͬͨ 2019/04/24 35

Slide 36

Slide 36 text

ฏ੒͕ऴΘΔલʹରԠ͠Α͏

Slide 37

Slide 37 text

ࣗݾ঺հ • Shu OGAWARA (@expajp ) – ϦϯΧʔζגࣜձࣾ – Ruby/Railsྺ2೥ऑ – ग़਎͸ௗऔɺେֶ͸ਆށ – झຯ͸ΫϥγοΫܥͷ߹এ 2019/04/24 37