Springboot2.6.4中, 设置sameSite为None, 小白发问

410 阅读1分钟

想请问一下大佬们, 我在我的Springboot项目的配置中设置了

server:
  servlet:
    session:
      cookie:
        same-site: none
        secure: true

就是把sameSite设为了none 请问这样会不会有什么安全问题, (我的跨域配置, 有设置允许指定的域名访问) 我就在想, 我跨域都设置了只允许这几个域名, 别人想利用CRFS漏洞的话, 也没法利用吧

@Override
  public void addCorsMappings(CorsRegistry registry) {
    registry.addMapping("/**")
      .allowedOriginPatterns("http://localhost/", "http://192.168.43.201:5000/", "http://192.168.1.220:5000/")
      .allowedMethods("GET","HEAD","POST","DELETE","OPTIONS")
      .allowCredentials(true)
      .maxAge(3600)
      .allowedHeaders("*");
  }