less than 1 minute read

Tags:

一姊

  • browser 保護 user 的一朝~

cross-origin-writes 允許 cros 的寫入

  • link, form submit

cross-origin embedding 允許 cros 的嵌入

  • <script src="xxx"></script>
  • <link rel="style">
  • <link rel="stylesheet" href="xxxx"> 
  • <img>
  • <video>
  • <iframe>

CORS

Access-Control-Allow-Origin: *            			# 允許所有網站發送的請求
Access-Control-Allow-Origin: http://foo.example  	# 只允許 http://foo.example 的請求

Preflight Request

Interceptor Http

JSONP

JSON with Padding

Proxy

  • Client

    • img

    • EX: Angular add Proxy

      • "ng serve --proxy-config proxy-file.json"
  • Server

    • img
  • Server 之間

    • img

https://sketch.io/sketchpad/

Prevent

  • <img src='https://books.com/delete?id=3' width='0' height='0' />

  • Server sameSite

// Server
// Set-Cookie: key=value   SameSite有三個值 None, Strict & Lax 
Set-Cookie: cat_image_loaded=1, SameSite=None 不限制同源
Set-Cookie: cat_image_loaded=1, SameSite=Strict 限同源網站,完全禁止第三方cookies
Set-Cookie: cat_image_loaded=1, SameSite=Lax 部分request允許 (<a>, <link> )

clickjacking