可以通过在nginx配置文件中添加如下代码来处理:

location / {
    proxy_pass https://172.16.15.87:8444;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_cookie_path / "/; secure; HttpOnly; SameSite=None";
    add_header Set-Cookie "HttpOnly; Secure; SameSite=None";
}

location /appscan {
    # allow appscan to access the application
    allow 172.16.15.87:8090;
    deny all;

    proxy_pass https://172.16.15.87:8444;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_cookie_path / "/; secure; HttpOnly; SameSite=None";
    add_header Set-Cookie "HttpOnly; Secure; SameSite=None";
}

解释如下:

  • 第一个location块是默认的请求处理位置,将请求代理到应用服务器上,并添加了proxy_cookie_path和add_header来设置SameSite属性为None,以及HttpOnly和Secure属性。
  • 第二个location块是针对appscan的请求处理位置,只允许来自172.16.15.87:8090的请求,并添加了相同的cookie属性设置。

这样就可以通过nginx来处理appscan扫描出的不安全Cookie漏洞

appscan 扫描出漏洞具有不安全、不正确或缺少 SameSite 属性的 Cookie服务器的域名为https1721615878444并且允许https1721615878090访问如何通过nginx处理

原文地址: https://www.cveoy.top/t/topic/g7M9 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录