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
hatena-diary-blog-xss
Search
Yasuhiro Onishi
May 14, 2013
Technology
5
1.1k
hatena-diary-blog-xss
はてなダイアリーやブログのXSS対策の事例を紹介します
Yasuhiro Onishi
May 14, 2013
Tweet
Share
More Decks by Yasuhiro Onishi
See All by Yasuhiro Onishi
大吉祥寺.pm 基調講演
onishi
3
5.7k
YAPC::Kyoto 2023 Keynote
onishi
3
9.7k
2016 Devsumi Kansai
onishi
3
1.4k
Hatena-Camp
onishi
2
4.2k
Hatena Blog for Engineer
onishi
2
3k
Hatena Blog Development Flow
onishi
34
38k
wget.pl
onishi
3
1.4k
Redmine::ChanでIRCからプロジェクト管理
onishi
5
5.3k
The new Text::Hatena
onishi
2
240
Other Decks in Technology
See All in Technology
DroidKaigi 2024 たすけて!ViewModel
mhidaka
5
950
『GRANBLUE FANTASY Relink』ソフトウェアラスタライザによる実践的なオクルージョンカリング
cygames
0
170
エンジニア視点で見る、 組織で運用されるデザインシステムにするには
shunya078
1
310
なにもしてないのにNew Relicのデータ転送量が増えていたときに確認したこと
tk3fftk
2
230
テスト”ケース”駆動開発 で手戻りをなくそう
ryohma0510
0
320
ロリポップ! for Gamersを支えるインフラ/lolipop for gamers infrastructure
takumakume
0
130
ついに出た!OpenAIの最新モデル「o1」って何がすごいの?
minorun365
PRO
3
1.2k
サーバレスでモバイルアプリ開発! NTTコム「ビジネスdアプリ」のアーキテクチャ / The architecture of business d app
nttcom
12
240
Agile in Automotive Industry, puzzles and lights.
hiranabe
3
1.4k
Discovering AI Models
picardparis
4
3.9k
タイミーのレコメンドにおける ABテストの運用
ozeshun
1
150
「家族アルバム みてね」における運用管理・ オブザーバビリティの全貌 / Overview of Operation Management and Observability in FamilyAlbum
isaoshimizu
4
160
Featured
See All Featured
Statistics for Hackers
jakevdp
794
220k
Being A Developer After 40
akosma
84
590k
What the flash - Photography Introduction
edds
67
11k
Facilitating Awesome Meetings
lara
49
6k
KATA
mclloyd
27
13k
Intergalactic Javascript Robots from Outer Space
tanoku
268
26k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
36
1.7k
Building an army of robots
kneath
302
42k
It's Worth the Effort
3n
182
27k
YesSQL, Process and Tooling at Scale
rocio
167
14k
The Art of Programming - Codeland 2020
erikaheidi
48
13k
How to name files
jennybc
75
98k
Transcript
μΠΞϦʔͱϒϩάͱ 944 גࣜձࣾͯͳ JEPOJTIJ !4IJCVZB944JO0TBLB
ࣗݾհ wJEPOJTIJେ߁༟ wגࣜձࣾͯͳ wνʔϑΤϯδχΞ wͯͳϒϩάσΟϨΫλʔ
ͯͳͱݴ͑944
ͯͳφ
ͯͳφ
ͯͳͱ944 wਓྗݕࡧͯͳRIBUFOBOFKQ wͯͳΞϯςφBIBUFOBOFKQ wͯͳμΠΞϦʔEIBUFOBOFKQ wͯͳϒοΫϚʔΫCIBUFOBOFKQ
ͯͳͱ944 wಉҰυϝΠϯɾಉҰΫοΩʔʹΑΔ Ϣʔβʔೝূ wΫοΩʔΛୣΘΕͨΒηογϣϯϋ ΠδϟοΫ͞ΕಘΔ
ͯͳμΠΞϦʔ wϦϦʔεͷϒϩάαʔϏε wཧը໘ͱϒϩάը໘͕ಉҰυϝΠϯ wϒϩάαʔϏεˠϢʔβʔίϯςϯπ
ͦͷฤू
ͦͷฤू
Ϣʔβʔίϯςϯπ w͖ͳ͜ͱΛॻ͖͍ͨ w͖ͳσβΠϯʹ͍ͨ͠ w͖ͳϒϩάύʔπΛ͍͍ͨ
Ϣʔβʔརศੑͱ ҆શੑͷཱ྆
Ϣʔβʔίϯςϯπ w͖ͳ͜ͱΛॻ͖͍ͨˠ)5.-944 w͖ͳσβΠϯʹ͍ͨ͠ˠ$44944 w͖ͳϒϩάύʔπΛ͍͍ͨˠººº
)5.-ͷ944ରࡦ wར༻Մೳཁૉ wར༻Մೳଐੑ wελΠϧཁૉ wΠϯϥΠϯ$44
ҙ͖͢ཁૉ wTDSJQU wPCKFDU wFNCFE wJGSBNF wTUZMF w
ҙ͖͢ଐੑ wΠϕϯτϋϯυϥ PODMJDL PO wKBWBTDSJQUεΩʔϚ͕ॻ͚Δཁૉ wISFG TSD DJUF wTUZMF wޙड़
ͯͳμΠΞϦʔͷ944ରࡦ wར༻ՄೳཁૉˠϗϫΠτϦετܗࣜ wར༻ՄೳଐੑˠϗϫΠτϦετܗࣜ wಛఆͷཁૉɾଐੑˠઐ༻ͷରࡦ wεΩʔϜରࡦ wελΠϧରࡦ
$44ͷ944ରࡦ wFYQSFTTJPOରࡦ w!JNQPSUରࡦ
FYQSFTTJPO color: expression( error ? 'red' : 'blue');
FYQSFTTJPOίϝϯτ expr/* ίϝϯτ */ession
FYQSFTTJPOίʔυϙΠϯτ \0065xpression
FYQSFTTJPOશ֯ ̴̴̸͇̿́͂͂̾̽
FYQSFTTJPOจࣈ <p style="{ color: expression('blue') }">
FYQSFTTJPOҟମ expressio\207f expressioⁿ ˣ
!JNQPSU w!JNQPSUઌΛల։͢Δ w!JNQPS!JNQP!JNQ!JN!J
ϒϩάύʔπͷ944ରࡦ wϗϫΠτϦετܗࣜ wIUUQTNFUBDQBOPSHSFMFBTF )5.-8JEHFU7BMJEBUPS
ϒϩάύʔπͷ944ରࡦ wϒϩάόʔπࣗʹ੬ऑੑ͕͋Δ wυϝΠϯࣦޮˠѱҙΛ࣋ͬͨ+4࣮ߦ
944ରࡦৄ͘͠ wϔϧϓͯͳμΠΞϦʔ944ରࡦ wIUUQIBUFOBEJBSZHIBUFOBOFKQ LFZXPSEͯͳμΠΞϦʔ944ରࡦ
ͯͳͱݴ͑944
None
ͯͳϒϩά wϦϦʔε wIUUQIBUFOBCMPHDPN w IBUFOBOFKQ͡Όͳ͍ॳͷຊαʔϏε w+4ϑϦʔ
ϔομͷJGSBNFԽ iframe blog.hatena.ne.jp onishi.hatenablog.com
ͦͷฤू
ͦͷฤू
ΫϩευϝΠϯ௨৴ wXJOEPXQPTU.FTTBHF wΟϯυ ϑϨʔϜ ؒͰϝοηʔδͷ ૹड৴Λߦ͏ͨΊͷΈ // message Πϕϯτࢹ
window.addEventListener(“message”, function() {...}, false); // message ૹ৴ window.postMessage(data, “targetOrigin”);
ΫϩευϝΠϯ௨৴ wQPTU.FTTBHFඇରԠϒϥβ ݹ͍*& wMPDBUJPOIBTIʹΑΔυϝΠϯؒ௨৴ wϑϨʔϜͷMPDBUJPOIBTIॻ͖͑ wϑϨʔϜMPDBUJPOIBTIͷมԽ Λࢹ w5$1෩σʔλ௨৴ w63-੍ݶ
*&ͰόΠτ ʹΑΔύ έοτׂ
ΫϩευϝΠϯ௨৴ͷར༻ wͦͷฤू wӾཡऀͷฤूݖݶ֬ೝ wͯͳελʔ wίϝϯτ w௨ wϑΟʔυόοΫϑΥʔϜ
αʔυύʔςΟ$PPLJF wJGSBNFTDSJQUཁૉͰຒΊࠐ·Εͨ ֎෦Ϧιʔεʹ$PPLJFΛૹ৴͢Δ͔ w'JSFGPY͔ΒσϑΥϧτ0'' wJGSBNFʹΑΔΫϩευϝΠϯ௨৴͕ ͑ͳ͍
αʔυύʔςΟ$PPLJF0''ରࡦ wCMPHIBUFOBOFKQυϝΠϯͷ"1*Ξ ΫηεDPPLJFૹ৴͋Δ͔νΣοΫ wJGSBNF͔ΒXJOEPXPQFOʹ͢Δ wϢʔβʔใ͕औΕͳ͍ͷͰସ ใΛදࣔ͢Δ
JGSBNF
JGSBNF
XJOEPXPQFO
ସϔομ
ΞΫηείϯτϩʔϧ wϒϩάͷϓϥΠϕʔτ wೝূͷΈͷෳࡶԽ w֎෦ͷιʔγϟϧάϥϑೝূ wηογϣϯϋΠδϟοΫࢭ wϒϩάຖʹผυϝΠϯ wผϢʔβʔʹ࿙ΕͯͳΔ͘ͳ͍ wηογϣϯຖʹ%#ΞΫηε͠ͳ͍
ΞΫηείϯτϩʔϧ ॳճΞΫηε࣌ͷΈೝূػ͕ؔ %#ΛҾ͘ UPLFOͰϒϩάʹϦμΠϨΫτ ϒϩάຖʹӾཡ༻DPPLJFΛൃߦ ΞΫηε࣌ʹDPPLJFͷଥੑ
ݕূͷΈ ೝূػؔ .hatena.ne.jp ϒϩά anydomain Ϣʔβʔ
ΞΫηείϯτϩʔϧ ॳճΞΫηε࣌ͷΈೝূػ͕ؔ %#ΛҾ͘ UPLFOͰϒϩάʹϦμΠϨΫτ ϒϩάຖʹӾཡ༻DPPLJFΛൃߦ ΞΫηε࣌ʹDPPLJFͷଥੑ
ݕূͷΈ ೝূػؔ .hatena.ne.jp ϒϩά anydomain Ϣʔβʔ UPLFO
ΞΫηείϯτϩʔϧ ॳճΞΫηε࣌ͷΈೝূػ͕ؔ %#ΛҾ͘ UPLFOͰϒϩάʹϦμΠϨΫτ ϒϩάຖʹӾཡ༻DPPLJFΛൃߦ ΞΫηε࣌ʹDPPLJFͷଥੑ
ݕূͷΈ ೝূػؔ .hatena.ne.jp ϒϩά anydomain Ϣʔβʔ DPPLJF
ΞΫηείϯτϩʔϧ ॳճΞΫηε࣌ͷΈೝূػ͕ؔ %#ΛҾ͘ UPLFOͰϒϩάʹϦμΠϨΫτ ϒϩάຖʹӾཡ༻DPPLJFΛൃߦ ΞΫηε࣌ʹDPPLJFͷଥੑ
ݕূͷΈ ೝূػؔ .hatena.ne.jp ϒϩά anydomain Ϣʔβʔ
ΫϦοΫδϟοΩϯάରࡦ w9'SBNF0QUJPOT%&/: wϑϨʔϜ༻ͷཁૉ໌ࣔతʹڐՄ wͦͷ߹ɺ*/165ཁૉͷมߋΛࢹ
ΫϦοΫδϟοΩϯάରࡦ
·ͱΊ wͯͳμΠΞϦʔ wIBUFOBOFKQυϝΠϯͳͷͰపఈ͠ ͨϗϫΠτϦετରࡦ wͯͳϒϩά wಠࣗυϝΠϯ ΫϩευϝΠϯ௨৴
ਓࡐืू wגࣜձࣾͯͳͰΤϯδχΞͦͷଞ શ৬छΛืू͍ͯ͠·͢ wҰॹʹϒϩάΛ࡞Γ·͠ΐ͏ʂ www.hatena.ne.jp/company/staff
αϚʔΠϯλʔϯ w िؒ w8FCαʔϏε։ൃίʔε໊ఔ wେنγεςϜݚڀίʔε໊ఔ wۙʑืू։࢝͠·͢ʂʂ developer.hatenastaff.com