ãã»ãã¥ãªãã£ãã¼ã ããã°ãªã¬ã¼2åç®ã
ããã«ã¡ã¯ãã¨ã³ã¸ãã¢ãªã³ã°ã°ã«ã¼ãã®å±±æ¬ã§ãã
ã»ãã¥ãªãã£ãã¼ã ã¯ãã¨ã³ã¸ãã¢ãªã³ã°ã°ã«ã¼ãå ¨ä½ã®ã»ãã¥ãªãã£ãåä¸ãããããã®ãã¼ãã£ã«ãã¼ã ãªã®ã§ãããåãããã¯ãéçºãã¼ã ã®ãµã¼ãã¹ããã§ãã¯ãã¦ãååããªããå ¨ä½ã®ã»ãã¥ãªãã£ãåä¸ããã¦ããã®ãããã·ã§ã³ã§ãã ãã®ãä»äºã®ä¸ç°ã¨ãã¦ããã®é¨åãã»ãã¥ãªãã£ãããã足ããªãããå ¥ãã¦ãã ããï¼ãã¨ããããã¨ããæ¥å¸¸çã«è¡ãªã£ã¦ãã¾ãã
ä»æ¥ã¯ãã®ãã»ãã¥ãªãã£ããããã¨ãããã®ãä¸ä½ä½ãªã®ããä»ãã人ã«èããªãã¢ã¬ã³ã¬ãåãã¾ã¨ãã¦ã¿ããã¨æãã¾ãã
- ã»ãã¥ãªãã£ããã
- æ¯è¼çå®å ¨ãªã»ãã¥ãªãã£ããã
- å°ã調æ»ãå¿ è¦ãªã»ãã¥ãªãã£ããã
- ããèãã¦ããå°å ¥ãããã»ãã¥ãªãã£ããã
- Cookieããã
- 観念ãã¦ããããå ¥ãã¾ããã
- We are Hiring!
ã»ãã¥ãªãã£ããã
HTTPã®ã»ãã¥ãªãã£ãããã¨å¼ã°ãããã®ã¯ããã¤ãããã¾ãããããå ¥ããããªã«ãå¬ããã®ãããªã«ãå¬ãããªãã®ããå±éºãªã®ãããã§ãªãã®ãã ãããããããªããã©å ¥ãã¦ã¿ã¾ããï¼ãã¨ããå½¢ã§ãåé¡ãªããã¨ã¯ããã¾ãããæ°è¦ã®ã·ã¹ãã ã«å ¥ãããªãã¾ã ãããæ¢åã·ã¹ãã ã«å ¥ãã¦ããã¨ãªãã¨ãããªãã«èª¿æ»ãå¿ è¦ã¨ãªããã¨ãå¤ãã¨æãã¾ãã
ä»åã¯ã»ãã¥ãªãã£ãããã¨å¼ã°ãããã®ã«ã¤ãã¦åãã¾ã¨ãã¦ã¿ããã¨æãã¾ãã
ããããã»ãã¥ãªãã£ãããã¨ã¯ï¼
ã»ãã¥ãªãã£ãããã¨å¼ã°ãããã®ã¯HTTPã®ã¬ã¹ãã³ã¹ãããã®ãã¡ä¸é£ã®ãã®ã§ããããããå
¥ãã¦ãããã¨ã«ãã£ã¦ãã©ã¦ã¶ã«å¯¾ãã¦ç¹å®ã®åããå¶éããããã«è¦è«ãããã®ã§ãã
å種åå¨ããã®ã§ãããStrict-Transport-Security
ã®ããã« RFCã§è¦æ ¼åããã¦ãããã®ãããã°ãX-Content-Type-Options
ã®ããã«Xä»ãã®éæ¨æºããããããã¾ãã(Xä»ãã®ãããã¯RFC 6648ã§éæ¨å¥¨ã¨ãªã£ã¦ããã®ã§ãããç¾å®ã¨ãã¦ä½¿ããã¦ããã®ã§ããã§ãæãã¦ããã¾ãã)
- RFC 6797 - HTTP Strict Transport Security (HSTS)
- RFC 6648 - Deprecating the "X-" Prefix and Similar Constructs in Application Protocols
æ¯è¼çå®å ¨ãªã»ãã¥ãªãã£ããã
X-Content-Type-Options
X-Content-Type-Options: nosniff
ä¸è¨ã®ããã«è¨è¿°ãããã¾ãããã©ã¦ã¶ã¯MIME ã¹ãããã£ã³ã°ã¨å¼ã°ããææ³ã§ã³ã³ãã³ãã®å½¢å¼(Content-Type
)ãæ¨å®ãããã¨ãã¾ããä»®ã«Content-Type: text/html
ã¨æ¸ãã¦ãã£ã¦ããä¸èº«ãããã¨ã¯æããªãæã«ã¯ image/jpeg
ã§ããã¨å¤æããã¨ãããããªå½¢ã§ãã
nosniff
ã¯ãã®ãããªæ¨æ¸¬ã許å¯ããªããã¨ããã©ã¦ã¶ã«ä¼ãã¾ãã
ããã«ãã£ã¦ãªã«ãé²ããã®ã§ãããã ä¾ãã°ã¦ã¼ã¶ãç»åãã¢ãããã¼ããããµã¼ãã¹ã«ããã¦ãæªæããJavaScriptãä»è¾¼ã¾ããHTMLããç»åã¨ãã¦ãã¢ãããã¼ãããã¨ãã¾ããã¢ãããã¼ãããããç»å(å®ã¯ã¹ã¯ãªããå ¥ãã®JavaScipt)ããããURLãä»äººã«è¸ã¾ãããã¨ã§ãå½è©²JavaScriptã¯ãã®ãµã¼ãã¹ãè¡ãªã£ã¦ãããµã¤ãã®JavaScriptã¨ãã¦å®è¡ããããã¨ã«ãªãã¾ããã¹ãããã£ã³ã°ãç¦æ¢ããã°ç»åã¨è§£éãããããXSSãé²å¾¡ã§ããã®ã§ãã
æ®éã«èãã¦ãContent-Type
éãã«è§£éãã¦ããããã¨ã¯æ£ããæåã§ããã¯ããªã®ã§nosniff
ãä»ä¸ãããã¨ã®å¼å®³ã¯ã»ã¼ããã¾ãããå°ãªãã¨ãç§ã¯è³ã«ãããã¨ãããã¾ããã
追è¨ï¼ä¸è¨è¨è¿°ã«é¢ãã¦ãTwitter㧠Content-Type
ã«ã¤ãã¦ããã¨ãã°ãJSONPãªã®ã«text/htmlãapplication/jsonãè¿ãã¦ãããåããªããªãã¾ããã¨ã®ãææ(https://twitter.com/ockeghem/status/1668489591157063681)ãããã ãã¾ãããContent-Type
ã¨ãã¦ç¾ç¶ã§ãæ£ããããã®ãè¿ãã¦ããã¤ããã§ããå®ã¯MIMEã¹ãããã£ã³ã°ã«é ¼ã£ã¦ãã¦å®éã«ã¯ç°ãªã£ã解éã§åä½ããã¦ããã¨ããå ´åãåå¨ããããããã¾ããã®ã§ã注æãå¿
è¦ã§ããããã§ããããã¡ãã£ã¨é å¼µãã¾ãï¼
X-XSS-Protection
ãã®ãããã¯ä»®ã«ä½¿ãã¨ããã°æ¬¡ã®ããã«ä½¿ãã¾ãã
X-XSS-Protection: 1; mode=block
ãããã¿ããã©ã¦ã¶ã¯èªèº«ã®ä¸ã«ãã¤XSSãã£ã«ã¿(XSSã¨æããããã¿ã¼ã³ãæ¤ç¥ããã¨ãã«ãã¼ã¸ã®å¦çãåæ¢ãã)ãæå¹åãããã¨ãæ±ãããã¾ãã
ãããâ¦ãå®ã¯ãã®æ©è½ã¯ãã¯ãæ代é ãã¨ãªã£ã¦ãã¾ãã¾ãããæ¢ã«ãµãã¼ãããã¦ããªãã®ã§ãã æ°è¦ã«å ¥ããå¿ è¦ã¯ããã¾ããããå ´åã«ãã£ã¦ã¯æ害ã«ãªãå ´åããããããã§ã(ä¸è¨ãªã³ã¯å åç §)ã®ã§æ¢ã«å ¥ã£ã¦ããå ´åã¯æ©ä¼ãè¦ã¦å¤ãã¦ããã¨ããããã§ãã
XSS対çã¨ãã¦ã¯æ¢ã«æå³ããªãã¦ããªããããå¾è¿°ã® Content-Security-Policy
ããããæ´»ç¨ãããã¨ãæ±ãããã¾ãã
Strict-Transport-Security
ããã¯ãããããHSTSãã¨å¼ã°ãããã®ã§ãã
ä¸è¨ã®ããã«ä½¿ãã¾ãã
Strict-Transport-Security: max-age=31536000; includeSubDomains
æèã®é«ãçæ§ã¯ä»ã©ãHTTP(not HTTPS)ã使ã£ã¦ãããªã©ã¨ãããã¨ã¯ãªãã¨æãã®ã§ãããå¤ãã·ã¹ãã ã§ã©ãããã«æ®ã£ã¦ããã¨ãããã¨ãããããããã¾ãããããã§ãæ®éã¯HTTPSã§ããµã¼ãã¹ãæä¾ãã¦ããã¨ã¯æãã¾ãããHTTPã¢ã¯ã»ã¹ãæ¥ãã301ã§HTTPSã«ãªãã¤ã¬ã¯ãããã¦ããã®ã§ã¯ãªããã¨æãã¾ãã
HSTS(HTTP Strict Transport Security) 㯠HTTPã§ã¢ã¯ã»ã¹ãããã¨ãã¦ãããã©ã¦ã¶å´ã§åæã«HTTPSã«é£ã°ãã¦ãã¾ããã¨ãè¦æ±ããã¨ããæ©è½ã§ãã
max-age
ã¯è¦ãã¦ããç§æ°ãincludeSubDomains
ã¯ãä¾ãã° https://example.com/
ã§ãã®ããããè¦ãããå ´åã http://sub.example.com/ ã®ãããªãµããã¡ã¤ã³ã¢ã¯ã»ã¹ãå«ãã¦ã https://sub.example.com/ ã¸ã¨ç½®ãæãããã¨ãè¦æ±ãããã®ã§ãã
ä¾ãã°ã§ãããhttps://example.com/ ã§ç´ æµãªãµã¼ãã¹ãæä¾ãã¦ããã¨ãã¾ãããã®æã(å½ã®ããªã¼Wi-Fiãªã©ã§DNSãä¹ã£åããã¦ãããªã©ãã¦)æªæã®ããå½ç©ã® http://example.com/ ã«èªå°ãããã¨ã¯ããå¾ã¾ããããããæ¬ç©ã® https://example.com/ ã«proxyãã¦ãã¾ãã°ãããããä¸éè æ»æãæç«ãã¾ãã
ãã®æã§ããhttps://example.com/ ã§ä¸åº¦ã§ãHSTSããããèªã¿è¾¼ãã§ããã°ãã©ã¦ã¶ã https://example.com/ ã«åæã«ãªãã¤ã¬ã¯ããã¦ãããããã証ææ¸ã®æ¤è¨¼ããªããããã¨ã§ãã®ãããªä¸éè æ»æãé²ããã®ã§ãã
ã©ããã¦ãHTTPã使ãããã¨ããäºä¾ãªã©ã¯ã»ã¼æ¶æ» ãã¦ããã¨æãã¾ãã®ã§ããã»ã©æ¸å¿µãªãå°å ¥å¯è½ã§ããã¾ãããã®ãããã¯HTTPã§éä¿¡ãããã®ã§ã¯ããã¾ãããHTTPSã§éä¿¡ãã¦ãã ããã
å°ã調æ»ãå¿ è¦ãªã»ãã¥ãªãã£ããã
X-Frame-Options
ä¸è¨ã®ã©ã¡ããã使ãã¾ãã
X-Frame-Options: DENY X-Frame-Options: SAMEORIGIN
<frame>
<iframe>
<embed>
ãªã©ã®ã½ã¼ã¹ã¨ãã¦ãªã«ã許ãã®ãã¨ãã話ã§ããDENY
ã¯å®å
¨ä¸è¨±å¯ã SAMEORIGIN
ã¯ãããããã»ã¤ã ãªãªã¸ã³ãã§ããã¤ã¾ãåããã¹ãã§åãã¹ãã¼ã (https/http)ã§åããã¼ãã§ããã°è¨±å¯ããã¨ãããã¨ã§ãã
ãã®ããããä»ä¸ãã¦ãããã¨ã§ãèªãµã¤ãã®ã³ã³ãã³ããä»ãµã¤ãã«åãè¾¼ã¾ããªãããä¿è¨¼ãããã¨ãã§ãã¾ãã
ãã® X-Frame-Options
ãéæ¨å¥¨ãªã®ã§ãããããã代æ¿ãããã®ã Content-Security-Policy
ã§ãããå°ãé£æ度ãä¸ãããã X-Frame-Options
ãå
¥ãã¦ãã¾ããã¨èªä½ã¯åé¡ãªãã¨èãã¦ãã¾ãã
追è¨ï¼ãã¡ãå½åã®èª¬æã誤ã£ã¦ããããã§ãã®ã§Twitterã§ã®ãææ(https://twitter.com/bakera/status/1668448460113321984)ãåãã¦ä¿®æ£ãããã¾ããã失礼ãããã¾ããã(å½åãåéããã¦ãèªãµã¤ãã«åãè¾¼ã¾ãããã¨ãé²ããã®ãããªèª¬æãæ¸ãã¦ããã¾ãããããä»ãµã¤ãã«èªãµã¤ããåãè¾¼ã¾ããã®ãé²ããã¨ããã®ãæ£è§£ã§ããã以ä¸ã®ãªã³ã¯å ãåç §ã)
ããèãã¦ããå°å ¥ãããã»ãã¥ãªãã£ããã
Content-Security-Policy
CSPã¨å¼ã°ãããã®ã§ãã
以ä¸ã®ãããªè¤éãªæ§é ãåãã¾ãã
Content-Security-Policy: ãã£ã¬ã¯ãã£ã1 ã½ã¼ã¹1 ã½ã¼ã¹2...; ãã£ã¬ã¯ãã£ã2 ã½ã¼ã¹1 ã½ã¼ã¹2...;
ãã£ã¬ã¯ãã£ãã¯ä¾ãã° default-src
ã script-src
ãframe-ancestors
ã¨ãã£ããã®ã§ããã½ã¼ã¹ã¯ä¾ãã° self
ã https://*
https://example.com/
ã¨ãã£ããã®ã§ããä¾ãã°ã¹ã¯ãªããã®å ´åãªãã° <script src="...">
ã® src
ã¨ãã¦è¨è¿°å¯è½ãªãã¡ã¤ã³ãå¶éãããã¨ããæã«å©ç¨ãããã¾ãã
詳細ã¯ã¨ã¦ãæ¸ããããªãã®ã§ä»¥ä¸ãåç §ãã¦ãã ããã
ããã¯å¤ãã®å ´åã¯XSSã®ãªã¹ã¯ã軽æ¸ãããããã®ãã®ã¨ãªãã¾ããå¿
è¦ãªãã¡ã¤ã³ããããå¿
è¦ãªã³ã³ãã³ããèªã¿è¾¼ã¾ãªãã¨ãããã¨ã§ãããç¹ã« default-src 'self';
ã¨ã ãæ¸ãã°å
¨ã¦ã®è¦ç´ ã«ã¤ãã¦same-originããã®ã¿ã®èªã¿è¾¼ã¿ã許å¯ããã¨ãããã¨ã«ãªãã¾ãã®ã§ãæ¯è¼çå®å
¨ã§ããã¾ã default-src
ã¯ãªãããã®å¤(ex. 'self'
)ãå
¥ãã¦ããã¦ãã ãããããããªãã¨ãæå®ãããªãã£ãè¦ç´ ã«ã¤ãã¦ã¯è¨±å¯ããªããã¦ãã¾ãã¾ãã
ãã ãä¾ãã°ç»åã¯å¥ãã¡ã¤ã³ã«ç½®ãã¦ããå ´åãªã©ãããã¾ãã®ã§ãããã«ã¤ãã¦ã¯å¥é img-src: 'self' https://image.example.com/;
ã®ããã«æ¸ãã¦ä¸æ¸ãããå¿
è¦ãããããããã¾ãããã¾ããç»åã«ã¤ãã¦ã¯ *
ã§å
¨ä½ã許å¯ãããã¨ãã¦ãããããã¯ã¼ã¯ã¹ãã¼ã (ex. https, wss)ãã許å¯ãããªãããã§ããå¿
è¦ãªãã° blob:
ãªã©ãæ示çã«è¨±å¯ããå¿
è¦ãããã¾ãã
è¨å®ãã¦ããä¸ã§ç¹ã«åé¡ã«ãªããããã®ãã¤ã³ã©ã¤ã³ã¹ã¯ãªããã§ããscript-src: 'self' 'unsafe-inline'
ã¨æ¸ãã°ã¤ã³ã©ã¤ã³ã®ã¹ã¯ãªããã¯è¨±å¯ããã¾ãããããããã¯èå¼±ãªè¨å®ã§ãããã®ã§æ©ã¿ã©ããã§ãããããåé¿ããããã«ã¯ãnonceã¨å¼ã°ããå¤ã<script nonce="å¤">
ã®ããã«ã¿ã°ã«è¨å®ãã¦ãããscript-src: 'nonce-å¤';
ã®ãããªè¨è¿°ããã¦ããã¦ç¹å®ã®ã¤ã³ã©ã¤ã³ã¹ã¯ãªããã ãã許å¯ããã¨ããå½¢ãã¨ãå¿
è¦ãããã¾ããåæ§ã§ããsha256ãªã©ã§ããã·ã¥ãã¤ãã¦ç¹å®ã®ã¹ã¯ãªããã ãã許å¯ãããã¨ãã§ãã¾ãã
以ä¸ã®ãµã¤ãã«ããã°ãscript-src
ã§ãã¯ã¤ããªã¹ãã«å
¥ãããã¡ã¤ã³ãããã¤ãã¹ãã¦ã¹ã¯ãªãããå®è¡ãããããæ»æãããããã§ããã§ãã®ã§ãå¯è½ãªéããã¯ã¤ããªã¹ããå»æ¢ãã¦å®å
¨ã ã¨ç¢ºèªããã¹ã¯ãªããã ãã nonce
ãªã©ã§æå®ãã¦ããã®ã好ã¾ããã¨è¨ãããã§ãã
Content Security Policy (CSP) Bypass - HackTricks
ã¾ããGoogle ã¢ããªãã£ã¯ã¹ãã®ä»ãå¤é¨ã®ãã¼ã«ã使ã£ã¦ããå ´åããããã¨ã§ãããããã®ãããªå ´åã«ãªã«ãèããã«CSPãè¨å®ãã¦ãã¾ãã¨ãããã®ãã¼ã«ã¯å ¨ã¦åæ¢ãã¦ãã¾ãã¾ãã
ãã®ããã«ãContent-Security-Policy
ã¯é常ã«å¼·åã§ç´°ããªãã¨ãã§ããä¸æ¹ã§ããã¡ãã¨åæºåãè¸ãã ã®ã¡ã«å°å
¥ããå¿
è¦ãããã¨ãããã¨ãèªèããå¿
è¦ãããã¾ãã
Cookieããã
Cookieãããã¯ä»¥ä¸ã®å½¢ãåãã¾ãã
Set-Cookie: <cookie-name>=<cookie-value> Expires=æ¥ä»; å±æ§ç¾¤
Expireã®æç¡
Expireã¯è¨ãã¾ã§ããªãCookieã®æç¶æéã§ããããã¯çç¥ã§ãã¦ããã®å ´åã¯ã»ãã·ã§ã³Cookieã¨ãã¦ãã©ã¦ã¶çµäºã«ãã£ã¦ç ´æ£ããããã¨ã¨ãªãã¾ããæå®ããå ´åã¯ãã¼ã·ã¹ãã³ãCookieã¨ãã¦ãã©ã¦ã¶çµäºå¾ãæ®ãã¾ãã
ãã°ã¤ã³ã®éµã¨ãªãCookieãªã©ããã¾ãã«ãé·ãæéä¿æããããã¨ã¯å±éºã§ããã¨ããè¦åãåãããã¨ãããã¾ããå©ä¾¿æ§ã®åé¡ãããããç¨éã«åããã¦æ±ºãããã¨ã¨ãªãã¾ããã¾ããä¾ãã°éè¦ãªã·ã¹ãã ã®ã»ãã·ã§ã³æ å ±ãªã©ã¯ãã©ã¦ã¶ã§ã®Cookieä¿æã¨é¢ä¿ãªãä¾ãã°30åéæä½ããªãã£ããç ´æ£ãããããªãµã¼ãå´ã§ã®è¨å®ãããããããã¾ããã®ã§ããã®è¾ºãã¨ã®å ¼ãåãã¨ããªãã¾ãã
Secureå±æ§
æè¿ã®ã·ã¹ãã ãªãã°å¸¸ã«ã¤ãã¦ããã¨ããããã§ããHTTPSã®æã®ã¿Cookieã®éä¿¡ããã¨ããè¨å®ã§ãã大æµã®å ´åãªã«ãèããªãã¨ãHTTPããHTTPSã«ãªãã¤ã¬ã¯ãããã¾ãããHTTPã®ãµã¤ãã¯å½ç©ã§ããå¯è½æ§ãçãå¿ è¦ãããã¾ãã®ã§Cookieãè©åãããããªãããã§ãã
HSTSã®è¨å®ãå ¥ãã¦ããã°HTTPã«ã¯ã¢ã¯ã»ã¹ããããªãã®ã§ãããã ã¨ãã¦ãå ¥ãã¦ããã¦æããããã¨ã¯ããã¾ããã
HttpOnlyå±æ§
ã¡ãã£ã¨ååãæ··ä¹±ãæããããªæ°ãããå±æ§ã§ãããç°¡åã«è¨ãã°ã¹ã¯ãªããããã®Cookieã¢ã¯ã»ã¹ãç¦æ¢ããã¨ããè¨å®ã§ããdocument.cookie
ã«ãã£ã¦JavaScriptããã¢ã¯ã»ã¹ã§ããªãã¨ããè¨ãæ¹ããã¦ãããããã§ãã
XSSã«ããJavaScriptããã®ã»ãã·ã§ã³æ å ±çã¿åºããªã©ã«å¼·ããªãã¨ããæå³ã§ãããåºæ¬çã«ã¯è¨å®ãã¦ããå¿ è¦ãããã¾ããããã¾ã«JavaScriptããCookieãå©ç¨ãã¦ãããããªä¾ãè¦ããã¾ãã®ã§ããã¹ããã¦ããå°å ¥ããå¿ è¦ãããã¾ãã
SameSiteå±æ§
CSRF対çã¨ãªãã¾ãã ãåç¥ã®æ¹ãå¤ãã¨ã¯æãã¾ãããCSRFã¨ã¯æ¬¡ã®ãããªæ»æã§ãã
- ãµã¤ãAã«æ£è¦ã«ãã°ã¤ã³ãã¦æ£è¦ã«ãã°ã¤ã³Cookieãåå¾
- æªæã®ãããµã¤ãBãé²è¦§
- ãµã¤ãBã¯ãµã¤ãAã¸ã®æªæãããªã³ã¯ãè¸ã¾ãã
- ãµã¤ãAã«æ£è¦ã«ãã°ã¤ã³ãã¦ããã®ã§ããµã¤ãAã¸ã®ãã°ã¤ã³ç¶æ ã§ä½ããã®ãããªãåä½ãè¡ããã(ex. mixiã®æ¥è¨ã«å¯¾ãã¦ãã¼ãã¯ã¾ã¡ã¡ãããã¨æ稿ãã)
SameSiteã¨ã¯ãå¤é¨ãµã¤ãããã®é·ç§»ããã£ãéã®ã¢ã¯ã»ã¹ã«ããã¦ãCookieãèªã¿åºãããã©ãããå¶å¾¡ããå±æ§ã§ããã¤ã¾ãä¸ã®ä¾ãªãã°ãµã¤ãBãããµã¤ãAã¸ã®é·ç§»ã«ããã¦ãµã¤ãAã«åæã«ãã°ã¤ã³ã§ãããã©ããããã®å±æ§ã«ãã£ã¦æ±ºãããã¨ãã§ãã¾ãã
è¨å®ã§ããå¤ã¯ä»¥ä¸ã®3ã¤ã§ãã
- SameSite=None
- SameSite=Lax (Chromeç³»ã®ããã©ã«ã)
- SameSite=Strict
None
ã¯å¤é¨ãµã¤ãããã®é·ç§»ã§ãCookieãèªã¿åºããã¾ããLax
㯠GETãªã¯ã¨ã¹ãã®æã®ã¿èªã¿åºããã¾ããæå¾ã« Strict
ã¯å¸¸ã«èªã¿åºããã¾ããã
ä¾ãã°Yahoo! Japanã®ã»ãã·ã§ã³Cookieã Strict
ã ã£ãã¨ãã¾ãã
ãããããªãã°å¤é¨ããYahoo!ã®ãµã¤ãã¸ã®URLãªã³ã¯(ã¤ã¾ããGETãªã¯ã¨ã¹ãã§ã®ãªã³ã¯)ãè²¼ã£ã¦ãã£ãã¨ãã¦ããStrict
ã®ããã§æ¯åãã°ã¢ã¦ãç¶æ
ã«ãªã£ã¦ãã¾ãã¾ããããã¯ä¸ä¾¿ã§ããã
å
ã»ã©ç¢ºããã¦ã¿ã¾ããããå®é㯠Lax
ã§ããããã¡ããã¨ãã°ã¤ã³ç¶æ
ã«ãªãã¾ãããããããç§ãä¾ãã°åæã«Yahoo!ã§æ稿ãããããªPOSTã®ãã©ã¼ã ãå¤é¨ãµã¤ãã«ä½ã£ã¦ãCookieã¯éä»ããããã°ã¤ã³æå¦ãããã®ã§ãã(ãã¡ãããCSRF対çã¯Cookieã®ã¿ã§ã¯ããã¾ããã®ã§ãã以å¤ã§ãé²å¾¡ããã¦ããã§ããããNone
ã ã£ããå¿
ãCSRFã«èå¼±ã§ããã¨ãããããæå³ã§ã¯ããã¾ããã)
ã¾ããSiteSiteå
ã§ã®é·ç§»ã«ã¯å½±é¿ããªãã®ã§ããããã㯠SameOriginã¨ã¯å°ãæå³ãç°ãªãã¾ããSameOriginã¯åãFQDN/ã¹ãã¼ã /ãã¼ãã§ããå¿
è¦ãããã¾ãããSameSite ã®å ´åã¯ãåãããµã¤ããã§ããã°åãã§ãããã©ã¦ã¶ã«ãã£ã¦ç°ãªãé¨åãããã¾ãããhttps://a.example.com/
㨠https://b.example.com/
https://example.com/
https://x.y.example.com/
ãªã©ã¯ãµããã¡ã¤ã³ãç°ãªã£ã¦ã SameSite ã¨ãªãã¾ãã
å¤ãã®å ´å㯠Lax
ã§åé¡ãªãã¨æããã¾ãããå³å¯ãªãµã¼ãã¹ãæä¾ãããå ´å㯠Strict
ãæ¤è¨ãã¦ã¿ã¦ãã ãããã¾ãã念ã®ããã§ããããã¯CSRF対çã®ä¸é¨ã§ããããã¾ãããSameSiteå±æ§ãå
¥ãããã対çå®äºã¨ãã話ã§ã¯ãªããããCSRFãã¼ã¯ã³ãªã©ã§ä¸å
¨ã®å¯¾çãåã£ã¦ãã ããã
観念ãã¦ããããå ¥ãã¾ããã
XSSãä¸éè
æ»æãã¯ãªãã¯ã¸ã£ããã³ã°ãCSRF対çãã®ä»ã®æ»æãããããããã1ã¤ã§ç·©åã§ãããªãã°é常ã«æ¥½ã§ãã
æ°è¦ãµã¼ãã¹ã§ã¯å¸¸èã¨ãã¦å
¥ãã¦ããããã§ãããæ¢åãµã¼ãã¹ãä¸ã¤ä¸ã¤ææãã¦è¿½å ãã¦ãã£ã¦ããã£ã¦ããã¨ããã§ãã(Content-Security-Policy
ã¯å°ãé£èªãã¦ãã¾ãã)
ãã ããã¤ããããã§ãããããããå ¥ãããã大ä¸å¤«ã§ããã¨ãã話ã§ã¯ããã¾ãããå種対çã®ä¸ã¤ã¨ãã¦å®æ½ãã¦ããã¾ãããï¼
We are Hiring!
ã¨ã ã¹ãªã¼ã§ã¯ã»ãã¥ãªãã£ã«èå³ã®ããã¨ã³ã¸ãã¢ãæ±ãã¦ããã¾ãã
éçºãã¼ã ãå å²ãã¦ãã·ãã·åç· ã§å符ãåã£ã¦ããä»äºã§ã¯ãªãã®ã§ããããã®ãããªåéã«ãèå³ããã°æ¯éã声ãããã ããï¼